aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-07-16 10:42:13 +0200
committerBjørn Erik Pedersen <[email protected]>2023-07-16 18:08:23 +0200
commitc406fd3a0e0efa17f69095ca6317ba1036fc8964 (patch)
tree1041f90b035a4918dec3d458eb551dcb93990694 /parser
parent286821e360e13b3a174854914c9cedd437bdd25e (diff)
downloadhugo-c406fd3a0e0efa17f69095ca6317ba1036fc8964.tar.gz
hugo-c406fd3a0e0efa17f69095ca6317ba1036fc8964.zip
Fix setting config from env with complex (e.g. YAML) strings
So you can do ``` HUGO_OUTPUTS="home: [rss]" hugo ``` And similar. Fixes #11249
Diffstat (limited to 'parser')
-rw-r--r--parser/metadecoders/decoder.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/parser/metadecoders/decoder.go b/parser/metadecoders/decoder.go
index 93eb32e47..40b3a336c 100644
--- a/parser/metadecoders/decoder.go
+++ b/parser/metadecoders/decoder.go
@@ -23,6 +23,7 @@ import (
"strings"
"github.com/gohugoio/hugo/common/herrors"
+ "github.com/gohugoio/hugo/common/maps"
"github.com/niklasfasching/go-org/org"
xml "github.com/clbanning/mxj/v2"
@@ -90,7 +91,7 @@ func (d Decoder) UnmarshalStringTo(data string, typ any) (any, error) {
switch typ.(type) {
case string:
return data, nil
- case map[string]any:
+ case map[string]any, maps.Params:
format := d.FormatFromContentString(data)
return d.UnmarshalToMap([]byte(data), format)
case []any: