From 8bffa6fce7b5189e34be123eed9e932e6e019ada Mon Sep 17 00:00:00 2001 From: Zach Leatherman <zachleatherman@gmail.com> Date: Wed, 28 Jul 2021 08:57:46 -0500 Subject: [PATCH] Only for non-empty collections. --- _includes/layouts/post.njk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 27d6e20..4d7327c 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -12,6 +12,7 @@ templateClass: tmpl-post {{ content | safe }} +{%- if collections.posts %} {%- set nextPost = collections.posts | getNextCollectionItem(page) %} {%- set previousPost = collections.posts | getPreviousCollectionItem(page) %} {%- 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 %} </ul> {%- endif %} +{%- endif %}