mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
parent
3a216186b2
commit
eb0c8f9d02
1 changed files with 4 additions and 3 deletions
|
@ -178,13 +178,14 @@ func (pt pageTree) Parent() page.Page {
|
|||
return b.p
|
||||
}
|
||||
|
||||
func (pt pageTree) Ancestors() (parents page.Pages) {
|
||||
func (pt pageTree) Ancestors() page.Pages {
|
||||
var ancestors page.Pages
|
||||
parent := pt.Parent()
|
||||
for parent != nil {
|
||||
parents = append(parents, parent)
|
||||
ancestors = append(ancestors, parent)
|
||||
parent = parent.Parent()
|
||||
}
|
||||
return
|
||||
return ancestors
|
||||
}
|
||||
|
||||
func (pt pageTree) Sections() page.Pages {
|
||||
|
|
Loading…
Reference in a new issue