Add paginator support for page groups

Fixed #1274
This commit is contained in:
Bjørn Erik Pedersen
2015-07-16 13:17:54 +02:00
parent 2c22a8b79a
commit 1a94148d06
4 changed files with 320 additions and 42 deletions

View File

@@ -35,12 +35,17 @@ There are two ways to configure and use a `.Paginator`:
For a given **Node**, it's one of the options above. The `.Paginator` is static and cannot change once created.
The global page size setting (`Paginate`) can be overridden by providing a positive integer as the last argument. The examples below will give five items per page:
* `{{ range (.Paginator 5).Pages }}`
* `{{ $paginator := .Paginate (where .Data.Pages "Type" "post") 5 }}`
It is also possible to use the `GroupBy` functions in combination with pagination:
```
{{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups }}
```
## Build the navigation
The `.Paginator` contains enough information to build a paginator interface.