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

Evaluate .Hugo.Environment variable for defining production build #457

Closed
wants to merge 1 commit into from

Conversation

tlindsay42
Copy link
Contributor

Closes #453

@tlindsay42
Copy link
Contributor Author

tlindsay42 commented Dec 12, 2021

Everything looks good with implementing these changes on my end via overrides, but still new to all this and wasn't sure of what exactly this with call did: /layouts/_default/baseof.html#42, nor the proper way to update it if necessary to evaluate the other options for specifying a production environment build. If this statement doesn't need to be updated, then this is ready for review.

?

@tlindsay42 tlindsay42 changed the title DRAFT: Evaluate .Hugo.Environment variable for defining production build Evaluate .Hugo.Environment variable for defining production build Dec 23, 2021
@regisphilibert
Copy link
Member

Hey and thank you, this PR does make sense but this is a dangerous breaking change as this would make every project without a HUGO_ENV variable set to be considered production. Everybody would have to update their non-production deployed branches, PRs, staging to explicitly set a HUGO_ENV=development

This is a default of Hugo that I never quite aligned with. Making every project's environment default to production is problematic.

I've thought about creating an IsProduction returning partial that would preserve the former behaviour while introducing hugo.Environment but cannot think of one. Can you?

@tlindsay42
Copy link
Contributor Author

I can't either, and not accepting this makes sense in retrospect due to the risks. Oh well.

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

Successfully merging this pull request may close these issues.

Support for .Hugo.Environment variable
2 participants