From d50778ca043d3e26fbc2b45d40fbb00d9726ad8b Mon Sep 17 00:00:00 2001 From: madrilene Date: Mon, 12 Feb 2024 11:22:33 +0100 Subject: [PATCH] add pagination doc --- src/docs/pagination.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/docs/pagination.md diff --git a/src/docs/pagination.md b/src/docs/pagination.md new file mode 100644 index 0000000..0dac6f2 --- /dev/null +++ b/src/docs/pagination.md @@ -0,0 +1,29 @@ +--- +title: Pagination +--- + +The blog posts use [Eleventy's pagination feature](https://www.11ty.dev/docs/pagination/). The logic for this can be found in the layout `src/_layouts/blog.njk`, how many entries should be on a page can be defined in `src/pages/blog.md`. + +If you do not want any pagination at all, it is easiest to specify a very high number for the pagination size, for example: + +```yaml +pagination: +data: collections.posts +size: 10000 +``` + +Now all entries are displayed under `/blog/` and there is no more pagination. + +In `src/_data_/meta.js` you can set some values for the visible content and the aria labels. + +You can also **hide the number fields** between the previous and next buttons by setting `paginationNumbers` to `false`. + +```js + blog: { + // other adjustments + pagination: 'Blog', + paginationPage: 'Page', + paginationPrevious: 'Previous', + paginationNext: 'Next', + paginationNumbers: true +```