We enable pagination and then give it a dataset with the data key. We control the number of items in each chunk with size. The pagination data variable will be populated with what you need to create each template. Here’s what’s in pagination:

All of the examples thus far have paged Array data. Eleventy does allow paging objects too. Objects are resolved to pagination arrays using either the Object.keys or Object.values JavaScript functions. Consider the following Nunjucks template:

Read more about Template Data Files. The only change here is that you point your data pagination key to the global or local data instead of data in the front matter. For example, consider the following globalDataSet.json file in your global data directory.

This means that collections.myCollection will have only the first page added to the collection array (_site/my-page/index.html). However, if you’d like all the pagination pages to the collections, use addAllPagesToCollections: true to the pagination front matter options like so: