post-to-post pagination and a few spacing tweaks
This commit is contained in:
@ -34,4 +34,13 @@ layout: base.njk
|
||||
|
||||
{{ content | safe }}
|
||||
</article>
|
||||
|
||||
{% set olderPost = collections.posts | getPreviousCollectionItem %}
|
||||
{% set newerPost = collections.posts | getNextCollectionItem %}
|
||||
{% set olderHref = olderPost.url %}
|
||||
{% set newerHref = newerPost.url %}
|
||||
{% set olderTitle = olderPost.data.title %}
|
||||
{% set newerTitle = newerPost.data.title %}
|
||||
{% set inPost = true %}
|
||||
{% include "pagination.njk" %}
|
||||
</heading-anchors>
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
{% if olderHref or newerHref %}
|
||||
<nav aria-label="pagination">
|
||||
<ol class="pagination">
|
||||
<ol class="pagination {% if inPost %}post-pagination{% endif %}">
|
||||
{% if olderHref %}
|
||||
<li class="older">
|
||||
<a href="{{ olderHref }}">
|
||||
<i class="fa-solid fa-hand-point-left" aria-hidden="true"></i> older
|
||||
<i class="fa-solid fa-hand-point-left" aria-hidden="true"></i> {{ olderTitle or "older" }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if newerHref %}
|
||||
<li class="newer">
|
||||
<a href="{{ newerHref }}">
|
||||
newer <i class="fa-solid fa-hand-point-right" aria-hidden="true"></i>
|
||||
{{ newerTitle or "newer" }} <i class="fa-solid fa-hand-point-right" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user