Only for non-empty collections.

This commit is contained in:
Zach Leatherman 2021-07-28 08:57:46 -05:00
parent b63f9077ae
commit 8bffa6fce7

View File

@ -12,6 +12,7 @@ templateClass: tmpl-post
{{ content | safe }} {{ content | safe }}
{%- if collections.posts %}
{%- set nextPost = collections.posts | getNextCollectionItem(page) %} {%- set nextPost = collections.posts | getNextCollectionItem(page) %}
{%- set previousPost = collections.posts | getPreviousCollectionItem(page) %} {%- set previousPost = collections.posts | getPreviousCollectionItem(page) %}
{%- if nextPost or previousPost %} {%- if nextPost or previousPost %}
@ -21,3 +22,4 @@ templateClass: tmpl-post
{%- if previousPost %}<li>Previous: <a href="{{ previousPost.url | url }}">{{ previousPost.data.title }}</a></li>{% endif %} {%- if previousPost %}<li>Previous: <a href="{{ previousPost.url | url }}">{{ previousPost.data.title }}</a></li>{% endif %}
</ul> </ul>
{%- endif %} {%- endif %}
{%- endif %}