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。