Add next / previous cards to posts

This commit is contained in:
2024-01-02 16:43:56 -06:00
parent bd2b505a5e
commit 3140ef0b72
16 changed files with 233 additions and 28 deletions

View File

@ -17,14 +17,4 @@ layout: layouts/base.njk
{{ content | safe }}
{%- if collections.posts %}
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
{%- set nextPost = collections.posts | getNextCollectionItem %}
{%- if nextPost or previousPost %}
<ul class="links-nextprev">
{%- if previousPost %}<li>Previous: <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a></li>{% endif %}
{%- if nextPost %}<li>Next: <a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a></li>{% endif %}
</ul>
<p>Questions? Comments? <a href="../../me">contact me</a>.</p>
{%- endif %}
{%- endif %}
{% include "nextLast.njk" %}