No, but the common way of doing this is to check a user defined environment variable:
{{ if eq (getenv "env") "prod" }}
// include google analytics
{{ end }}
You need to then do:
HUGO_ENV=prod hugo
When you publish your site.
No, but the common way of doing this is to check a user defined environment variable:
{{ if eq (getenv "env") "prod" }}
// include google analytics
{{ end }}
You need to then do:
HUGO_ENV=prod hugo
When you publish your site.