summaryrefslogtreecommitdiffstats
path: root/hugolib/pagination.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-11 09:19:16 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-22 09:57:03 +0100
commitc80308e6b3f3f4f6879ee6b7301575f162ac9209 (patch)
tree6647f3f6e8053bf20fcd468e1b2d4a3c233b9f02 /hugolib/pagination.go
parent063b78d2ece39b82d0eb32ac5559097c2780cef8 (diff)
node to page: Add Pages to Page
As an alias to .Data.Pages for home page etc. Also renamte NodeType to PageType and make it a string so it can be used in `where`. Updates #2297
Diffstat (limited to 'hugolib/pagination.go')
-rw-r--r--hugolib/pagination.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/hugolib/pagination.go b/hugolib/pagination.go
index bb2142cb8..47bde38dc 100644
--- a/hugolib/pagination.go
+++ b/hugolib/pagination.go
@@ -260,8 +260,8 @@ func splitPageGroups(pageGroups PagesGroup, size int) []paginatedElement {
// Paginator gets this Node's paginator if it's already created.
// If it's not, one will be created with all pages in Data["Pages"].
func (n *Page) Paginator(options ...interface{}) (*Pager, error) {
- if !n.NodeType.IsNode() {
- return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", n.NodeType, n.Title)
+ if !n.PageType.IsNode() {
+ return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", n.PageType, n.Title)
}
pagerSize, err := resolvePagerSize(options...)
@@ -303,8 +303,8 @@ func (n *Page) Paginator(options ...interface{}) (*Pager, error) {
// If it's not, one will be created with the qiven sequence.
// Note that repeated calls will return the same result, even if the sequence is different.
func (n *Page) Paginate(seq interface{}, options ...interface{}) (*Pager, error) {
- if !n.NodeType.IsNode() {
- return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", n.NodeType, n.Title)
+ if !n.PageType.IsNode() {
+ return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", n.PageType, n.Title)
}
pagerSize, err := resolvePagerSize(options...)