hugo-profile icon indicating copy to clipboard operation
hugo-profile copied to clipboard

Do not put Google Analytics code when running in hugo server

Open Didainius opened this issue 2 years ago • 0 comments

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.

Didainius avatar Feb 12 '23 13:02 Didainius