docs/content/en/methods/page/Paginate.md
Pagination is the process of splitting a list page into two or more pagers, where each pager contains a subset of the page collection and navigation links to other pagers.
By default, the number of elements on each pager is determined by your project configuration. The default is 10. Override that value by providing a second argument, an integer, when calling the Paginate method.
[!note] There is also a
Paginatormethod onPageobjects, but it can neither filter nor sort the page collection.The
Paginatemethod is more flexible.
You can invoke pagination in home, section, taxonomy, and term templates.
{{ $pages := where .Site.RegularPages "Section" "articles" }}
{{ $pages = $pages.ByTitle }}
{{ range (.Paginate $pages 7).Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}
{{ partial "pagination.html" . }}
In the example above, we:
[!note] Please note that the results of pagination are cached. Once you have invoked either the
PaginatororPaginatemethod, the paginated collection is immutable. Additional invocations of these methods will have no effect.