-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Hugo's built in build environment feature #574
Comments
Exactly, if we do this, then Ananke would treat any website with the default It's an easy code change, but a difficult effort in communication to make sure everyone gets the memo. |
@regisphilibert I found this today! I'd say it would be worth it to document it at least as this theme is used in the getting started tutorial from Hugo. It can be confusing since it kinds of conflicts with what's specified in the docs. BTW, I got the memo lol |
closes #625 closes #733 closes #453 closes #574 Signed-off-by: Patrick Kollitsch <[email protected]>
Hugo has built-in support for multiple build environments that is exposed to templates via the
hugo.Environment
andhugo.IsProduction
variables. This is controlled via the--environment
command line argument with theHUGO_ENV
environment variable as a fallback.Ananke has some support for build environments, but it does it by checking the
HUGO_ENV
environment variable directly:gohugo-theme-ananke/layouts/_default/baseof.html
Line 12 in 5a8b531
This means Ananke's view of the build environment will match Hugo's if it was set by the environment variable but not if it was set via the command line.
It looks like this could be simplified to just using
hugo.IsProduction
. This would result in a change in behaviour when no environment is set at all. According to the docs, here are the results:The text was updated successfully, but these errors were encountered: