Commit 759fa037 authored by Laura Kalbag's avatar Laura Kalbag
Browse files

Write documentation on pagination/the paginate parameter

Towards starter-theme#130
parent 76c34f71
---
title: "Pagination"
date: 2021-03-17T11:34:51Z
tags: ["pagination", "lists", "posts", "pages"]
menu:
content
---
The starter-theme will paginate every list that is longer than 10 items by default, showing a pagination menu at the bottom of the page, below the list of posts.
## Change the number of posts per list page
**The starter-theme ignores [Hugo’s Paginate option if set in option in `.hugo/config/_default/config.toml`](https://gohugo.io/templates/pagination/#configure-pagination)**. This is because the starter-theme allows you to change the number of posts per list page on a per-section basis.
To change the number of posts per list in a section, you can use the `paginate` parameter in the frontmatter of the section’s index page, `_index.md`:
```
/section
- /post-one
- /post-two
- _index.md
```
In `_index.md`, add `paginate` followed by `12` (or whatever number you choose) to the frontmatter:
```
paginate: 12
```
*You should not add quote marks (`''` or `""`) around the paginate number.*
An example of a section index’s frontmatter when the `paginate` number is being set to `12`:
```yaml
---
title: "How to…"
date: 2020-09-16T16:03:27+01:00
menu:
navigation:
name: "How to…"
paginate: 12
---
```
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment