mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
b2a02c3c5a
commit
15d3e48cec
2 changed files with 20 additions and 1 deletions
|
@ -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.`)
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue