Fix setting config from env with complex (e.g. YAML) strings

So you can do

```
HUGO_OUTPUTS="home: [rss]"  hugo
```

And similar.

Fixes #11249
This commit is contained in:
Bjørn Erik Pedersen
2023-07-16 10:42:13 +02:00
parent 286821e360
commit c406fd3a0e
4 changed files with 130 additions and 6 deletions

View File

@@ -150,7 +150,7 @@ var allDecoderSetups = map[string]decodeWeight{
key: "outputs",
decode: func(d decodeWeight, p decodeConfig) error {
defaults := createDefaultOutputFormats(p.c.OutputFormats.Config)
m := p.p.GetStringMap("outputs")
m := maps.CleanConfigStringMap(p.p.GetStringMap("outputs"))
p.c.Outputs = make(map[string][]string)
for k, v := range m {
s := types.ToStringSlicePreserveString(v)