You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
778 B

<nav class="pagination">
{% capture category_name %}{{ page.categories | first }}{% endcapture %}
{% for post in site.categories.[category_name] %}
{% if post.url == page.url %}
{% assign post_index0 = forloop.index0 %}
{% assign post_index1 = forloop.index %}
{% endif %}
{% endfor %}
{% for post in site.categories.[category_name] %}
{% if post_index0 == forloop.index %}{% assign next_post = post %}{% endif %}
{% if post_index1 == forloop.index0 %}{% assign prev_post = post %}{% endif %}
{% endfor %}
{% if prev_post %}<a class="prev" href="{{ site.url }}{{ prev_post.url }}">{{ prev_post.title }}</a>{% endif %}
{% if next_post %}<a class="next" href="{{ site.url }}{{ next_post.url }}">{{ next_post.title }}</a>{% endif %}
</nav>