Skip to content

Commit

Permalink
Allows one to give slice of (Page)s to Paginate
Browse files Browse the repository at this point in the history
We can now call Paginate after using the 'sort' function:

{{ $paginator := .Page.Paginate (sort .Pages "Params.rating") }}
  • Loading branch information
Vincent Danjean authored and vdanjean committed Aug 28, 2018
1 parent d754f4e commit cd92ca5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hugolib/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ func toPages(seq interface{}) (Pages, error) {
return seq.(Pages), nil
case *Pages:
return *(seq.(*Pages)), nil
case []*Page:
return Pages(seq.([]*Page)), nil
case WeightedPages:
return (seq.(WeightedPages)).Pages(), nil
case PageGroup:
Expand Down

0 comments on commit cd92ca5

Please sign in to comment.