resources/page: Deprecate cascade._target in favor of cascade.target

Closes #14341
This commit is contained in:
Joe Mooring
2026-02-12 04:50:37 -08:00
committed by GitHub
parent 4384f9b8c2
commit 828ee720cc
2 changed files with 8 additions and 4 deletions
+3 -3
View File
@@ -119,7 +119,7 @@ posts = '/posts/:year/:month/:title/'
category = 'categories'
series = 'series'
tag = 'tags'
[module]
[module.hugoVersion]
min = '0.80.0'
@@ -138,12 +138,12 @@ precision = 2
[[cascade]]
background = 'yosemite.jpg'
[cascade._target]
[cascade.target]
kind = 'page'
path = '/blog/**'
[[cascade]]
background = 'goldenbridge.jpg'
[cascade._target]
[cascade.target]
kind = 'section'
+5 -1
View File
@@ -199,8 +199,12 @@ func (d cascadeConfigDecoder) mapToPageMatcherParamsConfig(m map[string]any) (Pa
}
for k, v := range m {
switch strings.ToLower(k) {
klc := strings.ToLower(k)
switch klc {
case "_target", "target":
if klc == "_target" {
hugo.Deprecate("cascade._target", "Use cascade.target instead, see https://gohugo.io/content-management/front-matter/#target", "v0.156.0")
}
var target PageMatcher
if err := d.decodePageMatcher(v, &target); err != nil {
return pcfg, err