mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-18 20:14:32 +00:00
feat: recognize env via -e argument in addition to HUGO_ENV
Also, see https://github.com/gohugoio/hugo/issues/6456#issuecomment-546524056
This commit is contained in:
1 parent
5abeaaac7e
commit
24bfa6fa4d
3 files changed
+3
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{{ $ga := site.Params.marketing.google_analytics | default site.GoogleAnalytics | default "" }}
|
{{ $ga := site.Params.marketing.google_analytics | default site.GoogleAnalytics | default "" }}
|
||||||
{{ $gtm := site.Params.marketing.google_tag_manager | default "" }}
|
{{ $gtm := site.Params.marketing.google_tag_manager | default "" }}
|
||||||
|
|
||||||
{{ if eq (getenv "HUGO_ENV") "production" | and $ga | and (not $gtm) }}
|
{{ if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") | and $ga | and (not $gtm) }}
|
||||||
|
|
||||||
{{ $gtag_config := cond site.Params.privacy_pack "{ 'anonymize_ip': true }" "{}" }}
|
{{ $gtag_config := cond site.Params.privacy_pack "{ 'anonymize_ip': true }" "{}" }}
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{$ga}}"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{$ga}}"></script>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{{ if eq (getenv "HUGO_ENV") "production" | and site.Params.marketing.google_tag_manager }}
|
{{ if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") | and site.Params.marketing.google_tag_manager }}
|
||||||
<script>
|
<script>
|
||||||
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
{{ $css_comment := printf "/*!* Source Themes Academic v%s (https://sourcethemes.com/academic/) */\n" site.Data.academic.version }}
|
{{ $css_comment := printf "/*!* Source Themes Academic v%s (https://sourcethemes.com/academic/) */\n" site.Data.academic.version }}
|
||||||
{{ $css_bundle_head := $css_comment | resources.FromString "css/bundle-head.css" }}
|
{{ $css_bundle_head := $css_comment | resources.FromString "css/bundle-head.css" }}
|
||||||
{{ $css_options := dict "targetPath" "css/academic.css" }}
|
{{ $css_options := dict "targetPath" "css/academic.css" }}
|
||||||
{{- if (eq (getenv "HUGO_ENV") "production") -}}
|
{{- if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") -}}
|
||||||
{{- $css_options = merge $css_options (dict "outputStyle" "compressed") -}}
|
{{- $css_options = merge $css_options (dict "outputStyle" "compressed") -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ $sass_template := resources.Get "scss/main.scss" }}
|
{{ $sass_template := resources.Get "scss/main.scss" }}
|
||||||
|
|||||||
Reference in new issue
Block a user