Nizamil Putra
Nizamil Putra

Reputation: 582

Jekyll Pagination on every page

As we know Jekyll default pagination just support for index.html, and I want to create blog.html include pagination there.

Any solution for this?

Upvotes: 5

Views: 1329

Answers (1)

nicksuch
nicksuch

Reputation: 1564

If you create a directory called /blog and place an index.html file inside there, then you can add a setting to the _config.yml that says paginate_path: "blog/page:num". Instead of using the default index.html in your root folder as the paginator template, this will use /blog/index.html. The paginator will generate pages like /blog/page2/ and /blog/page3/ as needed.

This will get you to yourwebsite.com/blog, but if you want to get to yourwebsite.com/blog.html you'll probably have to use a redirect.

Upvotes: 11

Related Questions