From 63e175971395942d7af931ef62cc3ec33dd7f9fb Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sat, 9 Jan 2021 10:26:32 +0100 Subject: [PATCH] Add pagination example to docs Closes #1237 --- .../documentation/templates/pagination.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/content/documentation/templates/pagination.md b/docs/content/documentation/templates/pagination.md index 3308b452..ff00a71c 100644 --- a/docs/content/documentation/templates/pagination.md +++ b/docs/content/documentation/templates/pagination.md @@ -49,3 +49,31 @@ A paginated taxonomy gets two variables aside from the `paginator` variable: - a `term` variable of type `TaxonomyTerm`. See the [taxonomies page](@/documentation/templates/taxonomies.md) for a detailed version of the types. + +## Example + +Here is an example from a theme on how to use pagination on a page (`index.html` in this case): + +```jinja2 +
+ {% for page in paginator.pages %} +
+ {{ post_macros::title(page=page) }} +
+ {{ page.summary | safe }} +
+ +
+ {% endfor %} +
+ +``` \ No newline at end of file