mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Fix Params case handling in the index, sort and where func
This means that you can now do: ``` {{ range where .Site.Pages "Params.MYPARAM" "foo" }} ```
This commit is contained in:
@@ -19,11 +19,10 @@ import (
|
||||
texttemplate "text/template"
|
||||
"text/template/parse"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/gohugoio/hugo/common/maps"
|
||||
"github.com/gohugoio/hugo/tpl"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// decl keeps track of the variable mappings, i.e. $mysite => .Site etc.
|
||||
@@ -315,7 +314,7 @@ func (c *templateContext) collectConfig(n *parse.PipeNode) {
|
||||
|
||||
if s, ok := cmd.Args[0].(*parse.StringNode); ok {
|
||||
errMsg := "failed to decode $_hugo_config in template"
|
||||
m, err := cast.ToStringMapE(s.Text)
|
||||
m, err := maps.ToStringMapE(s.Text)
|
||||
if err != nil {
|
||||
c.err = errors.Wrap(err, errMsg)
|
||||
return
|
||||
|
Reference in New Issue
Block a user