Add .RegularPagesRecursive

Fixes #6411
This commit is contained in:
Bjørn Erik Pedersen
2020-03-16 11:37:57 +01:00
parent 94fb4dc3dd
commit 03b93bb988
8 changed files with 100 additions and 2 deletions

View File

@@ -941,6 +941,19 @@ func (c *contentTreeRef) collectPages() page.Pages {
return pas
}
func (c *contentTreeRef) collectPagesRecursive() page.Pages {
var pas page.Pages
c.m.collectPages(c.key+cmBranchSeparator, func(c *contentNode) {
pas = append(pas, c.p)
})
c.m.collectPages(c.key+"/", func(c *contentNode) {
pas = append(pas, c.p)
})
page.SortByDefault(pas)
return pas
}
func (c *contentTreeRef) collectPagesAndSections() page.Pages {
var pas page.Pages
c.m.collectPagesAndSections(c.key, func(c *contentNode) {