jekyll - 分页不起作用
jekyll - pagination not working
我正在使用 jekyll,但分页不起作用,我认为我在官方页面上一切正常。
_config.yml
分页: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 %}
帖子是.md,有问题吗?
试试这个:
在 _config.yaml
中用以下三行替换现有的单行 paginate
声明:
gems: [jekyll-paginate]
paginate: 3
paginate_path: "page:num"
我正在使用 jekyll,但分页不起作用,我认为我在官方页面上一切正常。
_config.yml
分页: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 %}
帖子是.md,有问题吗?
试试这个:
在 _config.yaml
中用以下三行替换现有的单行 paginate
声明:
gems: [jekyll-paginate]
paginate: 3
paginate_path: "page:num"