Add post pager

This commit is contained in:
Oliver Davies 2018-06-03 12:05:03 +01:00
parent 56127cccb1
commit b0fe5af776
2 changed files with 42 additions and 15 deletions

View file

@ -36,19 +36,5 @@ use: [posts]
{% endfor %}
</ul>
{% if page.pagination.previous_page or page.pagination.next_page %}
<ul class="list-reset flex">
{% if page.pagination.next_page %}
<li class="w-1/2">
<a href="{{ site.url }}{{ page.pagination.next_page.url }}">← Older posts</a>
</li>
{% endif %}
{% if page.pagination.previous_page %}
<li class="text-right {{ page.pagination.next_page and page.pagination.previous_page ? 'w-1/2' : 'w-full' }}">
<a href="{{ site.url }}{{ page.pagination.previous_page.url }}">Newer posts →</a>
</li>
{% endif %}
</ul>
{% endif %}
{% include 'post-pager.html.twig' %}
{% endblock %}