Web/main/_includes/nav/blognav.html
Ell 6bde3c4ff8
Some checks failed
Web/pipeline/head There was a failure building this commit
silently convert the entire website to jekyll
2021-07-09 01:59:28 +02:00

23 lines
No EOL
660 B
HTML

{% assign tag = page.tags[0] %}
{% assign posts = site.tags[tag] %}
{% 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 %}