mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -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() {
|
p.regularPagesRecursiveInit.Do(func() {
|
||||||
var pages page.Pages
|
var pages page.Pages
|
||||||
switch p.Kind() {
|
switch p.Kind() {
|
||||||
case kinds.KindSection:
|
case kinds.KindSection, kinds.KindHome:
|
||||||
pages = p.getPagesRecursive()
|
pages = p.getPagesRecursive()
|
||||||
default:
|
default:
|
||||||
pages = p.RegularPages()
|
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