From cd92ca5a0101db1fb661a9395fa194bcebb4ab3b Mon Sep 17 00:00:00 2001 From: Vincent Danjean Date: Thu, 21 Jun 2018 23:27:15 +0200 Subject: [PATCH] Allows one to give slice of (Page)s to Paginate We can now call Paginate after using the 'sort' function: {{ $paginator := .Page.Paginate (sort .Pages "Params.rating") }} --- hugolib/pagination.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hugolib/pagination.go b/hugolib/pagination.go index 58cec576b9b..b3cd7dac805 100644 --- a/hugolib/pagination.go +++ b/hugolib/pagination.go @@ -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: