summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hugolib/page__tree.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/page__tree.go b/hugolib/page__tree.go
index 6acd649fd..2f9fd2e46 100644
--- a/hugolib/page__tree.go
+++ b/hugolib/page__tree.go
@@ -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 {