mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
committed by
Bjørn Erik Pedersen
parent
87f8de8c7a
commit
9b5f1d491d
@@ -481,3 +481,65 @@ title: p1 de
|
||||
b.AssertFileExists("public/de/s1/p1/index.html", true)
|
||||
b.AssertFileExists("public/en/s1/p1/index.html", false)
|
||||
}
|
||||
|
||||
// Issue 14627
|
||||
func TestRegularPageCascadeToSelf(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
disableKinds = ['home','rss','sitemap','taxonomy','term']
|
||||
environment = 'pubweb'
|
||||
-- content/s1/_index.md --
|
||||
---
|
||||
title: s1
|
||||
cascade:
|
||||
target:
|
||||
environment: pubweb
|
||||
build:
|
||||
list: never
|
||||
render: never
|
||||
publishResources: false
|
||||
---
|
||||
-- content/s1/p1.md --
|
||||
---
|
||||
title: p1
|
||||
---
|
||||
-- content/s2/_index.md --
|
||||
---
|
||||
title: s2
|
||||
---
|
||||
-- content/s2/p2.md --
|
||||
---
|
||||
title: p2
|
||||
cascade:
|
||||
target:
|
||||
environment: pubweb
|
||||
build:
|
||||
list: never
|
||||
render: never
|
||||
publishResources: false
|
||||
---
|
||||
-- content/s2/p3/index.md --
|
||||
---
|
||||
title: p3
|
||||
cascade:
|
||||
target:
|
||||
environment: pubweb
|
||||
build:
|
||||
list: never
|
||||
render: never
|
||||
publishResources: false
|
||||
---
|
||||
-- layouts/all.html --
|
||||
{{ .Title }}|
|
||||
`
|
||||
|
||||
b := Test(t, files)
|
||||
|
||||
b.AssertFileExists("public/s1/index.html", false)
|
||||
b.AssertFileExists("public/s1/p1/index.html", false)
|
||||
b.AssertFileExists("public/s2/index.html", true)
|
||||
b.AssertFileExists("public/s2/p2/index.html", false)
|
||||
b.AssertFileExists("public/s2/p3/index.html", false)
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ func (m *pageMetaSource) doInitEarly(h *HugoSites, cascades *page.PageMatcherPar
|
||||
return err
|
||||
}
|
||||
|
||||
if cnh.isBranchNode(m) && m.pageConfigSource.Frontmatter != nil {
|
||||
if m.pageConfigSource.Frontmatter != nil {
|
||||
if err := m.setCascadeFromMap(m.pageConfigSource.Frontmatter, m.pageConfigSource.SitesMatrix, h.Conf.ConfiguredDimensions(), h.Log); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user