mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-08 22:49:44 +00:00
feat(scripts): only enable google analytics in production environment (#260)
Should set env to production, e.g.: `hugo serve -e production` Default environments are **development** with `hugo serve` and **production** with `hugo`.
This commit is contained in:
parent
50aa3f8d55
commit
f6a183a5c3
1 changed files with 1 additions and 1 deletions
|
@ -93,7 +93,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<!-- Analytics -->
|
<!-- Analytics -->
|
||||||
{{- if and (not .Site.IsServer) .Site.GoogleAnalytics -}}
|
{{- if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") | and .Site.GoogleAnalytics -}}
|
||||||
{{ template "_internal/google_analytics_async.html" . }}
|
{{ template "_internal/google_analytics_async.html" . }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue