You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pagination.md 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. +++
  2. title = "Pagination"
  3. weight = 30
  4. +++
  5. Two things can get paginated: a section or a taxonomy term.
  6. Every paginated template gets a `paginator` variable of the `Pager` type:
  7. ```ts
  8. // How many items per page
  9. paginate_by: Number;
  10. // The base URL for the pagination: section permalink + pagination path
  11. // You can concatenate an integer with that to get a link to a given pagination page.
  12. base_url: String;
  13. // How many pagers in this paginator
  14. number_pagers: Number;
  15. // Permalink to the first page
  16. first: String;
  17. // Permalink to the last page
  18. last: String;
  19. // Permalink to the previous page, if there is one
  20. previous: String?;
  21. // Permalink to the next page, if there is one
  22. next: String?;
  23. // All pages for the current page
  24. pages: Array<Page>;
  25. // Which page are we on
  26. current_index: Number;
  27. ```
  28. ## Section
  29. A paginated section gets the same `section` variable as a normal
  30. [section page](./documentation/templates/pages-sections.md#section-variables) minus its pages.
  31. ## Taxonomy term
  32. A paginated taxonomy gets two variables:
  33. - a `taxonomy` variable of type `TaxonomyConfig`
  34. - a `term` variable of type `TaxonomyTerm`.
  35. See the [taxonomies page](./documentation/templates/taxonomies.md) for a detailed version of the types.