Web/main/_includes/nav/blognav.html

26 lines
833 B
HTML
Raw Normal View History

{% assign tag = page.tags[0] %}
{% assign notarchived = site.tags[tag] | where: "archived", "false" %}
{% assign nilarchived = site.tags[tag] | where: "archived", nil %}
{% assign posts = notarchived | concat: nilarchived %}
{% for post in posts %}
{% if post.url != page.url %}
{% continue %}
{% endif %}
{% if forloop.last == false %}
{% assign prev = forloop.index0 | plus: 1 %}
{% endif %}
{% if forloop.first == false %}
{% assign next = forloop.index0 | minus: 1 %}
{% endif %}
{% break %}
{% endfor %}
<a class="nav-item nav-link" href="../#blog-{{ tag | slugify }}">🏠 Back to Main Page</a>
{% if prev %}
2021-12-01 18:12:11 +01:00
<a class="nav-item nav-link" href="{{ posts[prev].url }}">⏮️ Previous in {{ tag }}</a>
{% endif %}
{% if next %}
2021-12-01 18:12:11 +01:00
<a class="nav-item nav-link" href="{{ posts[next].url }}">⏭️ Next in {{ tag }}</a>
{% endif %}