Display previous and next post pagination if there is more than one post
This commit is contained in:
parent
cfd77e4af2
commit
eb212af7ce
|
@ -51,8 +51,8 @@
|
|||
{{ content | safe }}
|
||||
|
||||
{% if tags and tags.includes("posts") %}
|
||||
{%- if collections.posts.length > 1 %}
|
||||
<nav class="blog__post--pagination" aria-labelledby="nextprev-title">
|
||||
{%- if collections.posts %}
|
||||
<h2 class="visually-hidden" id="nextprev-title">Next and Previous Blog Posts</h2>
|
||||
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
|
||||
{%- set nextPost = collections.posts | getNextCollectionItem %}
|
||||
|
@ -72,8 +72,8 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
</nav>
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
</{{contentEl}}>
|
||||
|
||||
|
|
Loading…
Reference in New Issue