Skip to content

Commit

Permalink
config: Remove unexpected _merge keys introduced in author and social…
Browse files Browse the repository at this point in the history
… maps

Fixes #11083
  • Loading branch information
bep committed Jun 12, 2023
1 parent f210188 commit b7dc93c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/allconfig/alldecoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ var allDecoderSetups = map[string]decodeWeight{
"author": {
key: "author",
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
},
},
"social": {
key: "social",
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
},
},
Expand Down
8 changes: 8 additions & 0 deletions hugolib/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ func TestHugoConfig(t *testing.T) {
filesTemplate := `
-- hugo.toml --
theme = "mytheme"
[social]
twitter = "bepsays"
[author]
name = "bep"
[params]
rootparam = "rootvalue"
-- config/_default/hugo.toml --
Expand All @@ -711,6 +715,8 @@ rootparam: {{ site.Params.rootparam }}
rootconfigparam: {{ site.Params.rootconfigparam }}
themeparam: {{ site.Params.themeparam }}
themeconfigdirparam: {{ site.Params.themeconfigdirparam }}
social: {{ site.Social }}
author: {{ site.Author }}
`
Expand All @@ -735,6 +741,8 @@ themeconfigdirparam: {{ site.Params.themeconfigdirparam }}
"rootconfigparam: rootconfigvalue",
"themeparam: themevalue",
"themeconfigdirparam: themeconfigdirvalue",
"social: map[twitter:bepsays]",
"author: map[name:bep]",
)

})
Expand Down

0 comments on commit b7dc93c

Please sign in to comment.