Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 422
Nizamil Putra Avatar asked Jan 21 '14 03:01

Nizamil Putra


1 Answers

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.

like image 167
nicksuch Avatar answered Sep 28 '22 19:09

nicksuch