mirror of
https://github.com/helenclx/leilukin-site.git
synced 2025-04-02 21:10:52 +00:00
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 }}
|
{{ content | safe }}
|
||||||
|
|
||||||
{% if tags and tags.includes("posts") %}
|
{% if tags and tags.includes("posts") %}
|
||||||
|
{%- if collections.posts.length > 1 %}
|
||||||
<nav class="blog__post--pagination" aria-labelledby="nextprev-title">
|
<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>
|
<h2 class="visually-hidden" id="nextprev-title">Next and Previous Blog Posts</h2>
|
||||||
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
|
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
|
||||||
{%- set nextPost = collections.posts | getNextCollectionItem %}
|
{%- set nextPost = collections.posts | getNextCollectionItem %}
|
||||||
@ -72,8 +72,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
|
||||||
</nav>
|
</nav>
|
||||||
|
{%- endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</{{contentEl}}>
|
</{{contentEl}}>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user