Skip to content
Permalink
Browse files

feat: recognize env via -e argument in addition to HUGO_ENV

  • Loading branch information...
gcushen committed Oct 30, 2019
1 parent 5abeaaa commit 24bfa6fa4d084b0ac3f64ddcb2d71e4916c0e583
@@ -1,7 +1,7 @@
{{ $ga := site.Params.marketing.google_analytics | default site.GoogleAnalytics | 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 }" "{}" }}
<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>
(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],
@@ -103,7 +103,7 @@
{{ $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_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") -}}
{{- end -}}
{{ $sass_template := resources.Get "scss/main.scss" }}

0 comments on commit 24bfa6f

Please sign in to comment.
You can’t perform that action at this time.