mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
@ -254,7 +254,7 @@ func (p *pageState) RegularPagesRecursive() page.Pages {
|
||||
p.regularPagesRecursiveInit.Do(func() {
|
||||
var pages page.Pages
|
||||
switch p.Kind() {
|
||||
case kinds.KindSection:
|
||||
case kinds.KindSection, kinds.KindHome:
|
||||
pages = p.getPagesRecursive()
|
||||
default:
|
||||
pages = p.RegularPages()
|
||||
|
@ -432,3 +432,22 @@ Sect1 RegularPagesRecursive: page:/docs/sect1/ps1/|page:/docs/sect1/ps2/|page:/d
|
||||
|
||||
`)
|
||||
}
|
||||
|
||||
func TestRegularPagesRecursiveHome(t *testing.T) {
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
-- content/p1.md --
|
||||
-- content/post/p2.md --
|
||||
-- layouts/index.html --
|
||||
RegularPagesRecursive: {{ range .RegularPagesRecursive }}{{ .Kind }}:{{ .RelPermalink}}|{{ end }}|End.
|
||||
`
|
||||
|
||||
b := NewIntegrationTestBuilder(
|
||||
IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
}).Build()
|
||||
|
||||
b.AssertFileContent("public/index.html", `RegularPagesRecursive: page:/p1/|page:/post/p2/||End.`)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user