mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Fix recent regression with cascading of params to content adapters
Fixes #13743
This commit is contained in:
@@ -1412,7 +1412,7 @@ func (sa *sitePagesAssembler) applyAggregates() error {
|
||||
}
|
||||
|
||||
// Handle cascades first to get any default dates set.
|
||||
var cascade *maps.Ordered[page.PageMatcher, maps.Params]
|
||||
var cascade *maps.Ordered[page.PageMatcher, page.PageMatcherParamsConfig]
|
||||
if keyPage == "" {
|
||||
// Home page gets it's cascade from the site config.
|
||||
cascade = sa.conf.Cascade.Config
|
||||
@@ -1424,7 +1424,7 @@ func (sa *sitePagesAssembler) applyAggregates() error {
|
||||
} else {
|
||||
_, data := pw.WalkContext.Data().LongestPrefix(paths.Dir(keyPage))
|
||||
if data != nil {
|
||||
cascade = data.(*maps.Ordered[page.PageMatcher, maps.Params])
|
||||
cascade = data.(*maps.Ordered[page.PageMatcher, page.PageMatcherParamsConfig])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1506,11 +1506,11 @@ func (sa *sitePagesAssembler) applyAggregates() error {
|
||||
pageResource := rs.r.(*pageState)
|
||||
relPath := pageResource.m.pathInfo.BaseRel(pageBundle.m.pathInfo)
|
||||
pageResource.m.resourcePath = relPath
|
||||
var cascade *maps.Ordered[page.PageMatcher, maps.Params]
|
||||
var cascade *maps.Ordered[page.PageMatcher, page.PageMatcherParamsConfig]
|
||||
// Apply cascade (if set) to the page.
|
||||
_, data := pw.WalkContext.Data().LongestPrefix(resourceKey)
|
||||
if data != nil {
|
||||
cascade = data.(*maps.Ordered[page.PageMatcher, maps.Params])
|
||||
cascade = data.(*maps.Ordered[page.PageMatcher, page.PageMatcherParamsConfig])
|
||||
}
|
||||
if err := pageResource.setMetaPost(cascade); err != nil {
|
||||
return false, err
|
||||
@@ -1574,10 +1574,10 @@ func (sa *sitePagesAssembler) applyAggregatesToTaxonomiesAndTerms() error {
|
||||
const eventName = "dates"
|
||||
|
||||
if p.Kind() == kinds.KindTerm {
|
||||
var cascade *maps.Ordered[page.PageMatcher, maps.Params]
|
||||
var cascade *maps.Ordered[page.PageMatcher, page.PageMatcherParamsConfig]
|
||||
_, data := pw.WalkContext.Data().LongestPrefix(s)
|
||||
if data != nil {
|
||||
cascade = data.(*maps.Ordered[page.PageMatcher, maps.Params])
|
||||
cascade = data.(*maps.Ordered[page.PageMatcher, page.PageMatcherParamsConfig])
|
||||
}
|
||||
if err := p.setMetaPost(cascade); err != nil {
|
||||
return false, err
|
||||
|
Reference in New Issue
Block a user