Eleventy Pagination for Archive Pages: One Template, Many Pages
Leverage Eleventy's collection-driven pagination to generate archive pages from a single template, with a concrete configuration and build-trade-off analysis.
10 Sept 2026, 16:05 UTC

Pagination is collection-driven, not query-driven
Eleventy pagination works by slicing a collection you define in .eleventy.js or by the default collections. The template declares size, data source and alias in front matter. Eleventy then renders the template once per slice and passes the current slice into the alias for iteration.
What the pagination object gives you
Inside the template Eleventy exposes a pagination object with metadata you can use for navigation without plugins. Typical properties are page number, page size, total pages and URLs for previous and next pages. You can render prev/next links by checking those values.
Worked example: posts archive, 10 per page
Define a collection in .eleventy.js. Run this in the project root where Node is available. No elevated permissions are required, only write access to the project folder.
eleventyConfig.addCollection('postsByDate', collectionApi => collectionApi.getFilteredByGlob('content/posts/*.md').sort((a,b) => b.date - a.date));Create a pagination template with front matter data size alias permalink.
pagination: data collections.postsByDate size 10 alias posts permalink archive/page-{{ pagination.pageNumber + 1 }}/ layout base.njkRun npx @11ty/eleventy --serve to build. Expected output: _site/archive/index.html and _site/archive/page-2/, page-3/ etc. Confirm pagination.pageNumber pages.length and href.previous/next metadata by rendering debug output.
Trade-off: build performance with incremental builds
Pagination couples pages together. Changing a single item can invalidate the whole paginated series depending on version and configuration. With large page counts incremental builds become less effective and local development slows. Enable incremental mode modify one source Markdown file and rebuild observe which pages regenerate compare build logs and timestamps. If regeneration is broad consider smaller page sizes or splitting archives by year.
Limitations pagination syntax and defaults are version-sensitive verify aliasing and URL generation against the version in use. Very high page counts increase build output and memory use.
Actionable closing
Use pagination for archives and tag pages where the data set is stable and defined by a collection. Keep the template in one place define the collection explicitly and test URL patterns before publishing. Document the page size and permalink scheme so future changes are intentional.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.