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.1KB

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