mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
resources/page: Deprecate cascade._target in favor of cascade.target
Closes #14341
This commit is contained in:
+3
-3
@@ -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'
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user