Fix recent regression with cascading of params to content adapters

Fixes #13743
This commit is contained in:
Bjørn Erik Pedersen
2025-05-26 18:12:32 +02:00
parent 9ad26b69ad
commit eaf5ace30d
7 changed files with 82 additions and 72 deletions

View File

@@ -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