mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
committed by
Bjørn Erik Pedersen
parent
7874b96815
commit
3a216186b2
@@ -178,6 +178,15 @@ func (pt pageTree) Parent() page.Page {
|
||||
return b.p
|
||||
}
|
||||
|
||||
func (pt pageTree) Ancestors() (parents page.Pages) {
|
||||
parent := pt.Parent()
|
||||
for parent != nil {
|
||||
parents = append(parents, parent)
|
||||
parent = parent.Parent()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (pt pageTree) Sections() page.Pages {
|
||||
if pt.p.bucket == nil {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user