mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
parent
873a5cda1a
commit
bb7b3d3cdb
2 changed files with 42 additions and 1 deletions
|
@ -876,3 +876,44 @@ Background: {{ .Params.background }}|
|
||||||
b.AssertFileContent("public/p1/index.html", "Background: yosemite.jpg")
|
b.AssertFileContent("public/p1/index.html", "Background: yosemite.jpg")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Issue #12465.
|
||||||
|
func TestCascadeOverlap(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
files := `
|
||||||
|
-- hugo.toml --
|
||||||
|
disableKinds = ['home','rss','sitemap','taxonomy','term']
|
||||||
|
-- layouts/_default/list.html --
|
||||||
|
{{ .Title }}
|
||||||
|
-- layouts/_default/single.html --
|
||||||
|
{{ .Title }}
|
||||||
|
-- content/s/_index.md --
|
||||||
|
---
|
||||||
|
title: s
|
||||||
|
cascade:
|
||||||
|
_build:
|
||||||
|
render: never
|
||||||
|
---
|
||||||
|
-- content/s/p1.md --
|
||||||
|
---
|
||||||
|
title: p1
|
||||||
|
---
|
||||||
|
-- content/sx/_index.md --
|
||||||
|
---
|
||||||
|
title: sx
|
||||||
|
---
|
||||||
|
-- content/sx/p2.md --
|
||||||
|
---
|
||||||
|
title: p2
|
||||||
|
---
|
||||||
|
`
|
||||||
|
|
||||||
|
b := Test(t, files)
|
||||||
|
|
||||||
|
b.AssertFileExists("public/s/index.html", false)
|
||||||
|
b.AssertFileExists("public/s/p1/index.html", false)
|
||||||
|
|
||||||
|
b.AssertFileExists("public/sx/index.html", true) // failing
|
||||||
|
b.AssertFileExists("public/sx/p2/index.html", true) // failing
|
||||||
|
}
|
||||||
|
|
|
@ -1397,7 +1397,7 @@ func (sa *sitePagesAssembler) applyAggregates() error {
|
||||||
pw.WalkContext.Data().Insert(keyPage, cascade)
|
pw.WalkContext.Data().Insert(keyPage, cascade)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_, data := pw.WalkContext.Data().LongestPrefix(keyPage)
|
_, data := pw.WalkContext.Data().LongestPrefix(paths.Dir(keyPage))
|
||||||
if data != nil {
|
if data != nil {
|
||||||
cascade = data.(*maps.Ordered[page.PageMatcher, maps.Params])
|
cascade = data.(*maps.Ordered[page.PageMatcher, maps.Params])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue