#101: Simplifying environment detection
This commit is contained in:
parent
f996392dda
commit
4d405ead5d
4 changed files with 7 additions and 9 deletions
|
@ -41,7 +41,7 @@
|
|||
<meta property="article:tag" content="">
|
||||
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
|
||||
|
||||
{{ if and (.Site.GoogleAnalytics) (or (eq (getenv "HUGO_ENV") "production") (eq .Site.Params.env "production")) }}
|
||||
{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
{{ if $resource }}
|
||||
{{ $resource := $resource | resources.ExecuteAsTemplate $targetFilename . }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $resource = $resource | resources.Minify }}
|
||||
{{ end }}
|
||||
{{ $resource = $resource | resources.Fingerprint "sha256" }}
|
||||
|
@ -26,4 +26,4 @@
|
|||
{{ else if eq .type "js" }}
|
||||
<script src="{{ .filename | absURL }}?rnd={{ now.Unix }}" type="text/javascript" charset="utf-8"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue