aboutsummaryrefslogtreecommitdiffhomepage
path: root/config
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-05-20 11:17:43 +0200
committerBjørn Erik Pedersen <[email protected]>2023-05-20 12:40:32 +0200
commit4f085e80da9a415725db3def70e5ce847cf06741 (patch)
tree56e3c5c2e5686a903b920be211bc7870934bb8e6 /config
parent150d190ff041f7da905afea7f3b9ca6bd4a31a48 (diff)
downloadhugo-4f085e80da9a415725db3def70e5ce847cf06741.tar.gz
hugo-4f085e80da9a415725db3def70e5ce847cf06741.zip
Make language merging of markup etc. config without values in the root
Updates #10953
Diffstat (limited to 'config')
-rw-r--r--config/allconfig/allconfig.go9
-rw-r--r--config/allconfig/load.go16
2 files changed, 7 insertions, 18 deletions
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go
index 22e9f1deb..4886aa561 100644
--- a/config/allconfig/allconfig.go
+++ b/config/allconfig/allconfig.go
@@ -748,8 +748,13 @@ func FromLoadConfigResult(fs afero.Fs, res config.LoadConfigResult) (*Configs, e
}
}
} else {
- // Apply new values to the root.
- differentRootKeys = append(differentRootKeys, "")
+ switch vv.(type) {
+ case maps.Params:
+ differentRootKeys = append(differentRootKeys, kk)
+ default:
+ // Apply new values to the root.
+ differentRootKeys = append(differentRootKeys, "")
+ }
}
}
differentRootKeys = helpers.UniqueStringsSorted(differentRootKeys)
diff --git a/config/allconfig/load.go b/config/allconfig/load.go
index 51c1bf279..6ae26d28e 100644
--- a/config/allconfig/load.go
+++ b/config/allconfig/load.go
@@ -214,22 +214,6 @@ func (l configLoader) normalizeCfg(cfg config.Provider) error {
cfg.Set("minify", maps.Params{"minifyOutput": true})
}
- // Simplify later merge.
- languages := cfg.GetStringMap("languages")
- for _, v := range languages {
- switch m := v.(type) {
- case maps.Params:
- // params have merge strategy deep by default.
- // The languages config key has strategy none by default.
- // This means that if these two sections does not exist on the left side,
- // they will not get merged in, so just create some empty maps.
- if _, ok := m["params"]; !ok {
- m["params"] = maps.Params{}
- }
- }
-
- }
-
return nil
}