add nav buttons to the bottom of posts

This commit is contained in:
2023-03-04 02:08:53 +10:30
parent 9e382aee48
commit a56f058142

View File

@ -1,9 +1,11 @@
--- ---
layout: layout/base.njk layout: layout/base.njk
--- ---
{# {% set previousPost = collections.post | getPreviousCollectionItem(page) %} {% set previousPost = collections.post | getPreviousCollectionItem(page) %}
{% set nextPost = collections.post | getNextCollectionItem(page) %} {% set nextPost = collections.post | getNextCollectionItem(page) %}
{% if previousPost %}Previous Blog Post: <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a>{% endif %} <article class="blog-post">{{ content | safe}}</article>
{% if nextPost %}Next Blog Post: <a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a>{% endif %} #} <div class="nav-buttons">
<article class="blog-post">{{ content | safe}}</article> {% if nextPost %}<a href="{{ nextPost.url }}">&lt;== next</a>{% else %}x=={% endif %}
{% if previousPost %}<a href="{{ previousPost.url }}">prev ==&gt;</a>{% else %}==x{% endif %}
</div>