Web/main/_includes/nav/blognav.html
Ell 28e938feb6
All checks were successful
Web/pipeline/head This commit looks good
added emoji to the website because they look hella good
2021-11-10 23:18:12 +01:00

25 lines
836 B
HTML

{% 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 %}
<a class="nav-item nav-link" href="{{ posts[prev].url }}">⏮️ Previous {{ tag }} Post</a>
{% endif %}
{% if next %}
<a class="nav-item nav-link" href="{{ posts[next].url }}">⏭️ Next {{ tag }} Post</a>
{% endif %}