Skip to content
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

HUGO_ENVIRONMENT env variable is not respected, only outdated HUGO_ENV is. #733

Closed
davidsneighbour opened this issue Oct 13, 2024 · 2 comments

Comments

@davidsneighbour
Copy link
Collaborator

          HUGO_ENVIRONMENT env variable is not respected, only outdated HUGO_ENV is.

Originally posted by @bubenkoff in #201 (comment)

@jmooring
Copy link
Contributor

jmooring commented Oct 17, 2024

getenv "HUGO_ENV" is used throughout the code base (5 instances). Not sure why we're using an OS template function instead of one of these: hugo.Environment, hugo.IsDevelopment, hugo.IsProduction, or hugo.IsServer.

Perhaps we kept the using os.GetEnv for backwards compatibility, but that's no longer relevant due to the minimum version specified here:
https://github.com/theNewDynamic/gohugo-theme-ananke/blob/master/config/_default/hugo.toml#L1-L2

Related: #453, #625, #574

@davidsneighbour
Copy link
Collaborator Author

davidsneighbour commented Oct 17, 2024

Also, the reasoning behind this was probably to disable robots.txt on dev-environment deploys only, so they are not indexed by accident, which can be done now by having a hugo.toml in a different environment config than production. I might remove that completely and document it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants