mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Emit a warning that can be turned off when overwriting built-in .Params values
Fixes #11941
This commit is contained in:
@@ -31,6 +31,7 @@ import (
|
||||
|
||||
"github.com/gohugoio/hugo/source"
|
||||
|
||||
"github.com/gohugoio/hugo/common/constants"
|
||||
"github.com/gohugoio/hugo/common/hugo"
|
||||
"github.com/gohugoio/hugo/common/maps"
|
||||
"github.com/gohugoio/hugo/common/paths"
|
||||
@@ -621,6 +622,9 @@ func (p *pageState) setMetaPostParams() error {
|
||||
}
|
||||
|
||||
for k, v := range userParams {
|
||||
if _, found := params[k]; found {
|
||||
p.s.Log.Warnidf(constants.WarnFrontMatterParamsOverrides, "Hugo front matter key %q is overridden in params section.", k)
|
||||
}
|
||||
params[strings.ToLower(k)] = v
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user