jekyll-paginate
is a Jekyll plugin that adds pagination functionality to your site, allowing posts to be split across multiple pages instead of displaying all posts on a single page.
Add the following to your Gemfile
:
group :jekyll_plugins do
gem "jekyll-paginate"
end
Then, install the plugin:
bundle install
Add the following settings to your _config.yml
file:
# jekyll-paginate settings
paginate: 5 # Number of posts per page
paginate_path: "/blog/page:num" # URL structure for paginated pages
(optional) Add a index page blog/index.html
---
title: My Blog
layout: paginate
---