Skip to content

Instantly share code, notes, and snippets.

@kylehotchkiss
Created August 30, 2013 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylehotchkiss/6386426 to your computer and use it in GitHub Desktop.
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:
<div class="pagination-centered">
<ul class="pagination">
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<li class="arrow"><a href="/" class="arrow">&laquo;</a></a>
{% else %}
<li class="arrow"><a href="/blog/page/{{ paginator.previous_page }}" class="arrow">&laquo;</a></li>
{% endif %}
{% else %}
<li class="arrow unavailable"><a href="#">&laquo;</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">&raquo;</a></li>
{% else %}
<li class="arrow unavailable"><a href="#">&raquo;</a></li>
{% endif %}
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment