Fix it so disableKinds etc. does not get merged in from theme

Unless the merge strategy is set up to do so.

For `disableKinds` the current workaround is to make sure the project config has an entry, even if is empty:

```
disableKinds = []
```

Note that this issue only touches root, non-map config-values that either is not set in project config or in Hugo's defaults.

Fixes #8866
This commit is contained in:
Bjørn Erik Pedersen
2021-08-22 11:57:37 +02:00
parent 7ba3f3d201
commit f4ffeea71d
4 changed files with 15 additions and 2 deletions

View File

@@ -76,6 +76,14 @@ func (p Params) Merge(pp Params) {
p.merge("", pp)
}
// MergeRoot transfers values from pp to p for new keys where p is the
// root of the tree.
// This is done recursively.
func (p Params) MergeRoot(pp Params) {
ms, _ := p.GetMergeStrategy()
p.merge(ms, pp)
}
func (p Params) merge(ps ParamsMergeStrategy, pp Params) {
ns, found := p.GetMergeStrategy()