commands: Fix environment isolation for configuration settings

Closes #14763

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Joe Mooring
2026-04-16 19:38:24 -07:00
committed by Bjørn Erik Pedersen
parent 9a5c7e0d24
commit 1eea9fba0b
3 changed files with 43 additions and 16 deletions
@@ -0,0 +1,23 @@
# Issue 14763
# The staging config should not apply.
hugo config
! stdout 'myparam'
mkdir content
hugo new content foo.md
hugo -DF
! grep 'foo' public/foo/index.html
# The staging config should apply.
hugo config -e staging
stdout 'myparam'
hugo new content bar.md -e staging
hugo -DF -e staging
grep 'myparam: foo|' public/bar/index.html
-- config/_default/hugo.toml --
baseURL = "https://example.com"
-- config/staging/params.toml --
myparam = "foo"
-- layouts/single.html --
myparam: {{ site.Params.myparam }}|