Created
August 30, 2013 04:51
-
-
Save kylehotchkiss/6386426 to your computer and use it in GitHub Desktop.
What's that? You're using Jekyll and Foundation together? Cool, here's how to make pagination work:
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
<div class="pagination-centered"> | |
<ul class="pagination"> | |
{% if paginator.previous_page %} | |
{% if paginator.previous_page == 1 %} | |
<li class="arrow"><a href="/" class="arrow">«</a></a> | |
{% else %} | |
<li class="arrow"><a href="/blog/page/{{ paginator.previous_page }}" class="arrow">«</a></li> | |
{% endif %} | |
{% else %} | |
<li class="arrow unavailable"><a href="#">«</a></li> | |
{% endif %} | |
{% for i in (1..paginator.total_pages) %} | |
{% if i == 1 %} | |
{% if paginator.page == i %} | |
<li class="current"><a href="#">{{ i }}</a></li> | |
{% else %} | |
<li><a href="/">{{ i }}</a></li> | |
{% endif %} | |
{% else %} | |
{% if paginator.page == i %} | |
<li class="current"><a href="#">{{ i }}</a></li> | |
{% else %} | |
<li><a href="/blog/page/{{ i }}">{{ i }}</a></li> | |
{% endif %} | |
{% endif %} | |
{% endfor %} | |
{% if paginator.next_page %} | |
<li class="arrow"><a href="/blog/page/{{ paginator.next_page }}" class="arrow">»</a></li> | |
{% else %} | |
<li class="arrow unavailable"><a href="#">»</a></li> | |
{% endif %} | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment