Add pagination to blog
This commit is contained in:
parent
115a00b8fc
commit
a25850a146
|
@ -2,14 +2,18 @@
|
||||||
title: Blog
|
title: Blog
|
||||||
permalink: /blog/
|
permalink: /blog/
|
||||||
override:tags: []
|
override:tags: []
|
||||||
|
pagination:
|
||||||
|
data: collections.blog
|
||||||
|
size: 2
|
||||||
|
generatePageOnEmptyData: true
|
||||||
eleventyNavigation:
|
eleventyNavigation:
|
||||||
key: Blog
|
key: Blog
|
||||||
order: 2
|
order: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
{%- for post in collections.blog reversed -%}
|
<ul>
|
||||||
{% if forloop.first == true %}<ul>{% endif %}
|
{%- for post in pagination.items %}
|
||||||
<li><a href="{{ post.url }}">{{ post.data.title }}</a>
|
<li><a href="{{ post.url }}">{{ post.data.title }}</a>
|
||||||
— <i>updated <time datetime="{{ post.date | formatDate }}">{{ post.date | formatDate }}</time></i></li>
|
— <i>updated <time datetime="{{ post.date | formatDate }}">{{ post.date | formatDate }}</time></i></li>
|
||||||
{% if forloop.last == true %}</ul>{% endif %}
|
{% endfor -%}
|
||||||
{%- endfor -%}
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue