related: Handly []any

See #10624
This commit is contained in:
Bjørn Erik Pedersen
2023-01-17 12:36:34 +01:00
parent 671f64b2eb
commit d595419031
2 changed files with 16 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import (
"time"
"github.com/gohugoio/hugo/common/maps"
"github.com/spf13/cast"
"github.com/gohugoio/hugo/common/types"
"github.com/mitchellh/mapstructure"
@@ -283,6 +284,8 @@ func (cfg IndexConfig) ToKeywords(v any) ([]Keyword, error) {
vv = vc
}
keywords = append(keywords, StringsToKeywords(vv...)...)
case []any:
return cfg.ToKeywords(cast.ToStringSlice(vv))
case time.Time:
layout := "2006"
if cfg.Pattern != "" {