Skip to content

Commit

Permalink
utilize the pagination include and update markup
Browse files Browse the repository at this point in the history
  • Loading branch information
sirkitree committed Oct 1, 2024
1 parent f26e8ab commit cc59a5d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 35 deletions.
26 changes: 1 addition & 25 deletions src/_includes/page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,4 @@ layout: layout
{% endif %}
</div>

<nav class="nav-container" aria-label="E-book arrow navigation">
{% if isFirstPage %}
<a href="../../table-of-contents/" aria-label="Previous page">
<div class="nav-button">
<i class="gg-arrow-left"></i>
</div>
</a>
{% else %}
{% if previousPage %}
<a href="{{ previousPage.url }}" aria-label="Previous page">
<div class="nav-button">
<i class="gg-arrow-left"></i>
</div>
</a>
{% endif %}
{% endif %}

{% if nextPage %}
<a href="{{ nextPage.url }}" aria-label="Next page">
<div class="nav-button">
<i class="gg-arrow-right"></i>
</div>
</a>
{% endif %}
</nav>
{% include 'pagination.liquid' %}
32 changes: 22 additions & 10 deletions src/_includes/pagination.liquid
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
<div class="nav-container">
{% if pagination.href.previous %}
<div class="nav-button">
<a href="{{ pagination.href.previous }}"><i class="gg-arrow-left"></i></a>
</div>
<nav class="nav-container" aria-label="E-book arrow navigation">
{% if isFirstPage %}
<a href="../../table-of-contents/" aria-label="Previous page">
<div class="nav-button">
<i class="gg-arrow-left"></i>
</div>
</a>
{% else %}
{% if previousPage %}
<a href="{{ previousPage.url }}" aria-label="Previous page">
<div class="nav-button">
<i class="gg-arrow-left"></i>
</div>
</a>
{% endif %}
{% endif %}

{% if pagination.href.next %}
<div class="nav-button">
<a href="{{ pagination.href.next }}"><i class="gg-arrow-right"></i></a>
</div>
{% if nextPage %}
<a href="{{ nextPage.url }}" aria-label="Next page">
<div class="nav-button">
<i class="gg-arrow-right"></i>
</div>
</a>
{% endif %}
</div>
</nav>

0 comments on commit cc59a5d

Please sign in to comment.