hugo-profile
hugo-profile copied to clipboard
Do not put Google Analytics code when running in hugo server
Would be great to avoid running Google Analytics when creating content locally with hugo
. Proposing this based on the discussion: here https://github.com/gohugoio/hugo/issues/7422#issuecomment-648977676 and here https://discourse.gohugo.io/t/how-to-exclude-google-analytics-when-running-under-hugo-local-server/6092/34
Excerpt from Hugo docs: https://gohugo.io/variables/site/
.Site.IsServer
a boolean to indicate if the site is being served with Hugo’s built-in server.