-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% comment %} | ||
Shows `<span>` elements for non-linked pages and `<a>`s for active links. Automatically accounts for Jekyll's pagination problem where there is no `page1` with a special `if` statement (for when `page == 2`). | ||
{% endcomment %} | ||
|
||
<div class="pagination"> | ||
{% if paginator.next_page %} | ||
<a class="pagination-item older" href="{{ site.baseurl }}page{{paginator.next_page}}">Older</a> | ||
{% else %} | ||
<span class="pagination-item older">Older</span> | ||
{% endif %} | ||
{% if paginator.previous_page %} | ||
{% if paginator.page == 2 %} | ||
<a class="pagination-item newer" href="{{ site.baseurl }}">Newer</a> | ||
{% else %} | ||
<a class="pagination-item newer" href="{{ site.baseurl }}page{{paginator.previous_page}}">Newer</a> | ||
{% endif %} | ||
{% else %} | ||
<span class="pagination-item newer">Newer</span> | ||
{% endif %} | ||
</div> |