Related documentation
Collections & Pagination
Add pagination to a Collection by adding:
-
limit: 5(this number should be less than the total number of items in that Collection) show_more: true
Like so ↓
```collection
post_type: article
template: compact
tags: music
limit: 5
show_more: true
```
Settings for Pagination
You can edit the settings for pagination at Settings → Defaults → collections.yml. There are 2 settings for pagination:
-
Items per page- sets the number of items for pagination (default =20) -
Pagination template- sets the Collection template specifically for pagination (default =list)
How pagination works?
Roe automatically creates the extra pages for you based on the Collection settings.
Page Heading
The pagination page heading is built from the Collection settings in this order:
-
headinga heading in the Collection settings will be the heading for pagination -
sourcea source specified in the Collection settings:posts,pages, etc. -
tagsa tag in the Collection settings (first tag is used) -
post_typea post_type other thanallwill be used:article→ “Articles”-
post_type: podcastpodcast’s title is used - if the Collection contains episodes from multiple podcasts, “Podcast” is used
-
- If there are no filter options in the Collection, the heading becomes “Archive”
Static Site Generation
Roe does the same for a static site. All necessary pagination pages are generated automatically.