mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 00:22:09 -05:00
parent
3f497d496f
commit
a7d6b1413f
2 changed files with 25 additions and 2 deletions
|
@ -729,8 +729,8 @@ func fromLoadConfigResult(fs afero.Fs, logger loggers.Logger, res config.LoadCon
|
||||||
isMultiHost = true
|
isMultiHost = true
|
||||||
}
|
}
|
||||||
mergedConfig.Set(kk, vv)
|
mergedConfig.Set(kk, vv)
|
||||||
if cfg.IsSet(kk) {
|
|
||||||
rootv := cfg.Get(kk)
|
rootv := cfg.Get(kk)
|
||||||
|
if rootv != nil && cfg.IsSet(kk) {
|
||||||
// This overrides a root key and potentially needs a merge.
|
// This overrides a root key and potentially needs a merge.
|
||||||
if !reflect.DeepEqual(rootv, vv) {
|
if !reflect.DeepEqual(rootv, vv) {
|
||||||
switch vvv := vv.(type) {
|
switch vvv := vv.(type) {
|
||||||
|
|
|
@ -1066,3 +1066,26 @@ LanguageCode: {{ .Site.LanguageCode }}|{{ site.Language.LanguageCode }}|
|
||||||
b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|")
|
b.AssertFileContent("public/index.html", "LanguageCode: en-US|en-US|")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue 11047
|
||||||
|
func TestConfigYamlNil(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
files := `
|
||||||
|
-- hugo.yaml --
|
||||||
|
params:
|
||||||
|
-- layouts/index.html --
|
||||||
|
Foo: {{ site.Params.foo }}|
|
||||||
|
|
||||||
|
|
||||||
|
`
|
||||||
|
b := NewIntegrationTestBuilder(
|
||||||
|
IntegrationTestConfig{
|
||||||
|
T: t,
|
||||||
|
TxtarString: files,
|
||||||
|
},
|
||||||
|
).Build()
|
||||||
|
|
||||||
|
b.AssertFileContent("public/index.html", "Foo: |")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue