Jekyll Pagination Stops After Page 5: Why Are Later Pages Missing?
0 reputation · 08 Dec 2021, 16:17 UTC
0 reputation · 08 Dec 2021, 16:17 UTC
When building a Jekyll site, only pages 1‑5 appear even though paginate is set to 10 and there are 100 posts. The built‑in jekyll‑paginate gem caps output at five pages.
The configuration contains paginate: 10 and paginate_path: "/page/:num". The max_pages key is present but seems ignored. The site uses Jekyll 4.2.2. The expectation is to see /page/6 through /page/10.
It is unclear whether the current plugin honors max_pages, if the placeholder is missing, or if a newer plugin is required.
max_pages setting?jekyll‑paginate gem?Pages 6 and later are not being generated because the pagination you are using does not honor max_pages and is likely limited by plugin and host constraints. With paginate: 10 and 100 posts you expect 10 pages, but jekyll-paginate v1 does not support max_pages and GitHub Pages will only run the whitelisted v1 plugin.
jekyll-paginate v1, the plugin allowed on GitHub Pages, paginates only the posts index with paginate and paginate_path in _config.yml. It does not support collection pagination, custom pagination paths, or max_pages.max_pages is a configuration key of jekyll-paginate-v2. It is ignored by jekyll-paginate v1.The stop at page 5 is most plausibly a plugin-host mismatch or a theme navigation limit, not a content volume limit.
jekyll-paginate v1 runs. The max_pages key is present in _config.yml but is silently ignored, and pages beyond what the theme links to appear missing.jekyll-paginate v1, max_pages will be ignored and the paginator object will still expose total_pages based on paginate alone._site.grep -E "jekyll-paginate" Gemfile
cat _config.yml | grep -E "paginate|plugins"
bundle exec jekyll build
ls -1 _site/page
If 6, 7 etc. are missing, the plugin did not generate them.{{ paginator.total_pages }} {{ paginator.page }}
Render locally to see the reported total.To generate all ten pages you need a plugin-host combination that supports it. On GitHub Pages you are limited to jekyll-paginate v1 with posts-only pagination and no max_pages. Self-hosted sites can use jekyll-paginate-v2 with a different config schema for collections and max_pages. Changing paginate_path after pages exist can orphan URLs.
One diagnostic detail changes the recommendation: are you building on GitHub Pages or self-hosted, and which gem is listed in Gemfile, jekyll-paginate or jekyll-paginate-v2?
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 08 Dec 2021, 23:56 UTC
The original jekyll‑paginate gem, which is the only paginator allowed on GitHub Pages, has a hard‑coded cap of five pages for the root index.html. If you set paginate: 10 and have 100 posts, the gem will generate /page/1 through /page/5 and then silently stop, even though total_pages would be 10.
When the paginator is applied to a sub‑directory (e.g., blog/index.html) or to a collection, the same five‑page limit applies. The plugin was never designed for multi‑level pagination, so any pages beyond the fifth are omitted from the build output.
bundle show jekyll-paginate
jekyll config | grep paginate
Running jekyll -v confirms you’re on Jekyll 4.2.2, while the gem list tells you whether jekyll-paginate v1 or jekyll-paginate-v2 is installed.
jekyll-paginate-v2 to your Gemfile and enable max_pages in _config.yml.paginate_path is a top‑level pattern (e.g., /page/:num); nested paths trigger the five‑page cap in v1.After rebuilding, list the generated files:
ls _site/page/* | wc -l
If the count is five, the cap is in effect; if it’s ten or more, the paginator is functioning correctly.