Adds next and previous post links.

master
Zach Leatherman 2020-07-27 15:19:01 -05:00
parent 75e71adb29
commit 61885752b6
1 changed files with 7 additions and 1 deletions

View File

@ -6,4 +6,10 @@ templateClass: tmpl-post
{{ content | safe }}
<p><a href="{{ '/' | url }}">← Home</a></p>
<hr>
<ul>
{%- set nextPost = collections.posts | getNextCollectionItem(page) %}
{%- if nextPost %}<li>Next: <a href="{{ nextPost.url | url }}">{{ nextPost.data.title }}</a></li>{% endif %}
{%- set previousPost = collections.posts | getPreviousCollectionItem(page) %}
{%- if previousPost %}<li>Previous: <a href="{{ previousPost.url | url }}">{{ previousPost.data.title }}</a></li>{% endif %}
</ul>