1
我遵循这种方法来安装paginate v2并为一个集合分页,但是我为paginator创建的每个页面都获得了一个额外的“示例集合”顶级页面链接。如何使用jekyll paginate v2避免使用集合的重复页面?
下面是example.md
---
layout: page
title: Example Collection
permalink: /example/
pagination:
enabled: true
---
{% for post in paginator.posts %}
<h1>{{ post.title }}</h1>
{% endfor %}
{% if paginator.total_pages > 1 %}
<ul>
{% if paginator.previous_page %}
<li>
<a href="{{ paginator.previous_page_path | prepend: site.baseurl }}">Newer</a>
</li>
{% endif %}
{% if paginator.next_page %}
<li>
<a href="{{ paginator.next_page_path | prepend: site.baseurl }}">Older</a>
</li>
{% endif %}
</ul>
{% endif %}
这是我加入到我的config.yml现在
# Collections
collections:
examplecol:
output: true
permalink: /:collection/:path/
# Plugin: Pagination (jekyll-paginate-v2)
pagination:
collection : 'examplecol'
enabled : true
debug : false
per_page : 3
#permalink : "/page/:num/"
title : ":title - Page :num of :max"
limit : 0
sort_field : "date"
sort_reverse : true
,如果有在_examplecol
文件夹超过3个文件,我得到example.md的超过1个实例作为我页眉中的页面。
如何在包含所有分页页面的页眉中只有一个示例集合实例?我想我错过了一些愚蠢的东西。
我尝试删除example.md YAML中的永久链接条目,但这样做使得jekyll处理器无法找到examplecol/index.html。