Hi, this is forked off from #217 to track a systemic fix for how Docsy by-default sets all your pages to noindex. I think this is a fairly high-severity issue: sites migrating to Docsy might find themselves delisted from Google until Google reindexes.
https://discourse.gohugo.io/t/checking-env-variable-prevents-site-from-being-indexed-by-google-on-aws/23707
suggests that instead of
{{ if eq (getenv “HUGO_ENV”) “production” }}
we should use
{{ if eq hugo.Environment “production” }}
Then running with
hugo will build for production config.
hugo.Environment is defined at https://gohugo.io/variables/hugo/
I wonder how much backwards-compatibility concerns there are here for people updating though.