Files
nathanupchurch.com/_includes/permalinkButtons.njk

13 lines
496 B
Plaintext

{% set numPages = pagination.pages | length %}
{% if pagination.pageNumber > 0 %}
<a href="/{{ paginationRootDir }}/{% if pagination.pageNumber > 1%}page-{{ pagination.pageNumber }}/{% endif %}">
<button type="button">← Previous</button>
</a>
{% endif %}
{% if pagination.pageNumber < numPages - 1 %}
<a href="/{{ paginationRootDir }}/page-{{ pagination.pageNumber + 2 }}/">
<button type="button">{% if pagination.pageNumber == 0%}More{% else %}Next{% endif %} →</button>
</a>
{% endif %}