Last active
February 26, 2018 02:52
-
-
Save magnobiet/e17509c982151c3ce775 to your computer and use it in GitHub Desktop.
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
<ul class="post-list"> | |
{% for post in paginator.posts %} | |
<li> | |
<h2>{{ post.title }}</h2> | |
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span> | |
<p><a class="post-link" href="{{ post.url | prepend: site.baseurl }}">Read...</a></p> | |
</li> | |
{% endfor %} | |
</ul> | |
<hr> | |
{% if paginator.total_pages > 1 %} | |
<div class="pagination"> | |
{% if paginator.previous_page %} | |
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a> | |
{% else %} | |
<span>« Prev</span> | |
{% endif %} | |
{% for page in (1..paginator.total_pages) %} | |
{% if page == paginator.page %} | |
<em>{{ page }}</em> | |
{% elsif page == 1 %} | |
<a href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a> | |
{% else %} | |
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a> | |
{% endif %} | |
{% endfor %} | |
{% if paginator.next_page %} | |
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a> | |
{% else %} | |
<span>Next »</span> | |
{% endif %} | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment