mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
commands: Fix environment isolation for configuration settings
Closes #14763 Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
9a5c7e0d24
commit
1eea9fba0b
@@ -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 }}|
|
||||
Reference in New Issue
Block a user