diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-07 20:24:37 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-22 09:57:03 +0100 |
commit | ec2d502b4f214b9505dcd57713d2236c606985e8 (patch) | |
tree | b0d2943606d7169ff315687b6c226cd017701757 /hugolib/pagination.go | |
parent | 698b994f714174449fd1ea37c39058ea14f6deee (diff) |
node to page: Handle translations
Updates #2297
Diffstat (limited to 'hugolib/pagination.go')
-rw-r--r-- | hugolib/pagination.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hugolib/pagination.go b/hugolib/pagination.go index 65790d6ee..bb2142cb8 100644 --- a/hugolib/pagination.go +++ b/hugolib/pagination.go @@ -259,9 +259,9 @@ 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 *Node) Paginator(options ...interface{}) (*Pager, error) { +func (n *Page) Paginator(options ...interface{}) (*Pager, error) { if !n.NodeType.IsNode() { - return nil, errors.New("Paginators not supported for content pages.") + return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", n.NodeType, n.Title) } pagerSize, err := resolvePagerSize(options...) @@ -302,9 +302,9 @@ func (n *Node) Paginator(options ...interface{}) (*Pager, error) { // Paginate gets this Node's paginator if it's already created. // 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 *Node) Paginate(seq interface{}, options ...interface{}) (*Pager, error) { +func (n *Page) Paginate(seq interface{}, options ...interface{}) (*Pager, error) { if !n.NodeType.IsNode() { - return nil, errors.New("Paginators not supported for content pages.") + return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", n.NodeType, n.Title) } pagerSize, err := resolvePagerSize(options...) |