}
+func (pt pageTree) Page() page.Page {
+ return pt.p
+}
+
func (pt pageTree) Parent() page.Page {
return pt.p.parent
}
// Sections returns this section's subsections, if any.
// Note that for non-sections, this method will always return an empty list.
Sections() Pages
+
+ // Page returns a reference to the Page itself, kept here mostly
+ // for legacy reasons.
+ Page() Page
}
// DeprecatedWarningPageMethods lists deprecated Page methods that will trigger
return errors.New("no methods found")
}
- marshalJSON, pkgImports := methods.ToMarshalJSON("Page", "github.com/gohugoio/hugo/resources/page")
+ marshalJSON, pkgImports := methods.ToMarshalJSON(
+ "Page",
+ "github.com/gohugoio/hugo/resources/page",
+ // Exclusion regexps. Matches method names.
+ `\bPage\b`,
+ )
fmt.Fprintf(f, `%s
return nil
}
+func (p *nopPage) Page() Page {
+ return p
+}
+
func (p *nopPage) Parent() Page {
return nil
}
return p.params
}
+func (p *testPage) Page() Page {
+ return p
+}
+
func (p *testPage) Parent() Page {
panic("not implemented")
}