jekyll - pagination not working

≡放荡痞女 提交于 2020-01-16 10:55:09

问题


I'm working with jekyll but the pagination not working, I thing that I'm doing all ok from official page.

_config.yml
paginate: 3

Gemfile gem 'jekyll-paginate'

Index.html

{% if paginator.total_pages > 1 %} FUNCIONA!!! 
            {% else %} NOT WORKING {% else %}
            {% endif %}

    {% for post in paginator.posts  %}
            hello3
            {% endfor %}

            {% for post in site.posts  %}
            hello1
            {% endfor %}

The posts are .md, is a problem?


回答1:


Try this:

In _config.yaml replace the existing single line paginate declaration with these three lines:

gems: [jekyll-paginate]
paginate: 3
paginate_path: "page:num"


来源:https://stackoverflow.com/questions/33565601/jekyll-pagination-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!