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
738 B

<nav class="pagination">
{% capture collection_name %}{{ include.collection }}{% endcapture %}
{% for post in site.[collection_name] %}
{% if post.url == page.url %}
{% assign post_index0 = forloop.index0 %}
{% assign post_index1 = forloop.index %}
{% endif %}
{% endfor %}
{% for post in site.[collection_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>