mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 03:22:09 -05:00
config: Remove unexpected _merge keys introduced in author and social maps
Fixes #11083
This commit is contained in:
parent
f210188da3
commit
b7dc93ca11
2 changed files with 10 additions and 2 deletions
|
@ -336,14 +336,14 @@ var allDecoderSetups = map[string]decodeWeight{
|
||||||
"author": {
|
"author": {
|
||||||
key: "author",
|
key: "author",
|
||||||
decode: func(d decodeWeight, p decodeConfig) error {
|
decode: func(d decodeWeight, p decodeConfig) error {
|
||||||
p.c.Author = p.p.GetStringMap(d.key)
|
p.c.Author = maps.CleanConfigStringMap(p.p.GetStringMap(d.key))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"social": {
|
"social": {
|
||||||
key: "social",
|
key: "social",
|
||||||
decode: func(d decodeWeight, p decodeConfig) error {
|
decode: func(d decodeWeight, p decodeConfig) error {
|
||||||
p.c.Social = p.p.GetStringMapString(d.key)
|
p.c.Social = maps.CleanConfigStringMapString(p.p.GetStringMapString(d.key))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -695,6 +695,10 @@ func TestHugoConfig(t *testing.T) {
|
||||||
filesTemplate := `
|
filesTemplate := `
|
||||||
-- hugo.toml --
|
-- hugo.toml --
|
||||||
theme = "mytheme"
|
theme = "mytheme"
|
||||||
|
[social]
|
||||||
|
twitter = "bepsays"
|
||||||
|
[author]
|
||||||
|
name = "bep"
|
||||||
[params]
|
[params]
|
||||||
rootparam = "rootvalue"
|
rootparam = "rootvalue"
|
||||||
-- config/_default/hugo.toml --
|
-- config/_default/hugo.toml --
|
||||||
|
@ -711,6 +715,8 @@ rootparam: {{ site.Params.rootparam }}
|
||||||
rootconfigparam: {{ site.Params.rootconfigparam }}
|
rootconfigparam: {{ site.Params.rootconfigparam }}
|
||||||
themeparam: {{ site.Params.themeparam }}
|
themeparam: {{ site.Params.themeparam }}
|
||||||
themeconfigdirparam: {{ site.Params.themeconfigdirparam }}
|
themeconfigdirparam: {{ site.Params.themeconfigdirparam }}
|
||||||
|
social: {{ site.Social }}
|
||||||
|
author: {{ site.Author }}
|
||||||
|
|
||||||
|
|
||||||
`
|
`
|
||||||
|
@ -735,6 +741,8 @@ themeconfigdirparam: {{ site.Params.themeconfigdirparam }}
|
||||||
"rootconfigparam: rootconfigvalue",
|
"rootconfigparam: rootconfigvalue",
|
||||||
"themeparam: themevalue",
|
"themeparam: themevalue",
|
||||||
"themeconfigdirparam: themeconfigdirvalue",
|
"themeconfigdirparam: themeconfigdirvalue",
|
||||||
|
"social: map[twitter:bepsays]",
|
||||||
|
"author: map[name:bep]",
|
||||||
)
|
)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue