mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 10:24:38 -04:00
parent
29b4440505
commit
33ffda7225
@ -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.
|
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:
|
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 }}`
|
* `{{ range (.Paginator 5).Pages }}`
|
||||||
* `{{ $paginator := .Paginate (where .Data.Pages "Type" "post") 5 }}`
|
* `{{ $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
|
## Build the navigation
|
||||||
|
|
||||||
The `.Paginator` contains enough information to build a paginator interface.
|
The `.Paginator` contains enough information to build a paginator interface.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user