pagination in jekyll not working

2019-09-11 23:47发布

问题:

I'm trying to add pagination in my Jekyll based project.

So far, I have followed the below steps:

  • Pagination in jekyll
  • Followed Eric but no avail

I have set up _config.yml like this:

#Show 5 posts each page 
paginate: 5
paginate_path: "/index/page:num/"

回答1:

If your posts printing loop you're using :

{% for post in site.posts %}

But, you must use :

{% for post in paginator.posts %}