Created
July 19, 2022 13:19
-
-
Save robertbiswas/be731710007363a9205042eccc3791e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if paginator.total_pages != 1 %} | |
<div class="row text-center text-caps"> | |
<div class="col-md-8 col-md-offset-2"> | |
<nav class="pagination" role="pagination"> | |
<span class="page-number">Page {{ paginator.page }} of {{ paginator.total_pages }}</span> | |
{% if site.paginate_path != 'page:num'%} | |
{% assign paginate_url = site.paginate_path | remove:'/page:num' %} | |
{% if paginator.previous_page %} | |
{% if paginator.previous_page == 1 %} | |
<a class="newer-posts" href="{{ site.url }}/{{ paginate_url }}/" class="btn" title="Newer Posts">← Newer Posts</a> | |
{% else %} | |
<a class="newer-posts" href="{{ site.url }}/{{ paginate_url }}/page{{ paginator.previous_page }}/" class="btn" title="Newer Posts">← Newer Posts</a> | |
{% endif %} | |
{% endif %} | |
{% if paginator.next_page %} | |
<a class="older-posts" href="{{ site.url }}/{{ paginate_url }}/page{{ paginator.next_page }}/" class="btn" title="Older Posts">Older Posts →</a> | |
{% endif %} | |
{% else %} | |
{% if paginator.previous_page %} | |
{% if paginator.previous_page == 1 %} | |
<a class="newer-posts" href="{{ site.url }}/" class="btn" title="Newer Posts">← Newer Posts</a> | |
{% else %} | |
<a class="newer-posts" href="{{ site.url }}/page{{ paginator.previous_page }}/" class="btn" title="Newer Posts">← Newer Posts</a> | |
{% endif %} | |
{% endif %} | |
{% if paginator.next_page %} | |
<a class="older-posts" href="{{ site.url }}/page{{ paginator.next_page }}/" class="btn" title="Older Posts">Older Posts →</a> | |
</nav> | |
</div> | |
</div> | |
{% endif %} | |
{% endif %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment