Fix cascade with overlapping sections

Fixes #12465
This commit is contained in:
Bjørn Erik Pedersen
2025-01-24 13:33:36 +01:00
parent 873a5cda1a
commit bb7b3d3cdb
2 changed files with 42 additions and 1 deletions

View File

@@ -876,3 +876,44 @@ Background: {{ .Params.background }}|
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
}