mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
* Adds GetEnvironmentName and IsProduction partial functions, which improve DRY * Add prioritization for determining environment name, which favors the existing methods: the `HUGO_ENV` environment variable and site config `env` theme parameter * Adds `useHugoEnv` theme parameter to use the value of `.Hugo.Environment` for the build environment name
16 lines
363 B
HTML
16 lines
363 B
HTML
{{/*
|
|
IsProduction
|
|
|
|
@return false, unless the build environment is set to production via one of
|
|
the methods supported in the func/GetEnvironment partial.
|
|
*/}}
|
|
|
|
{{ $isProduction := false }}
|
|
{{ $env := partial "func/GetEnvironmentName.html" . }}
|
|
|
|
{{ if eq $env "production" }}
|
|
{{ $isProduction := true }}
|
|
{{ end }}
|
|
|
|
{{ return $isProduction }}
|