<(getenv "HUGO_ENV") eq "production">: can't give argument to non-function getenv "HUGO_ENV"
I was digging around to find out, how this error might come up. Using the latest version at this time:
Hugo Static Site Generator v0.74.3-DA0437B4/extended linux/amd64 BuildDate: 2020-07-23T16:30:30Z
These lines:
10: {{ if (getenv "HUGO_ENV") eq "production" }}
11 {{ template "_internal/google_analytics.html" . }}
12 {{ end }}
in _baseof.html
lead to plenty of these errors and stop site compilation. I read this and some other posts about this kind of error, but I fail to “get it” in regards to my code line.
Can someone please enlighten me what the problem is here? It worked back in 0.53 (one of these older pages) and in other more current posts I see getenv
used quite often, so it’s not a deprecated function.