Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
Created November 8, 2014 16:34
Show Gist options
  • Save carolineschnapp/5db04d9a5b6938dc596a to your computer and use it in GitHub Desktop.
Save carolineschnapp/5db04d9a5b6938dc596a to your computer and use it in GitHub Desktop.
Pagination using numbers in the Minimal theme
{% if paginate.pages > 1 %}
<div class="row">
<div class="span12">
<ul class="pagination clearfix">
{% if paginate.previous %}
<li><a href="{{ paginate.previous.url }}" class="prev">Previous</a></li>
{% else %}
<li><span></span></li>
{% endif %}
{% for part in paginate.parts %}
{% if part.is_link %}
<span style="padding: 0 5px;text-decoration:underline;">{{ part.title | link_to: part.url }}</span>
{% else %}
{% if part.title == '&hellip;' %}
<span style="padding: 0 5px; ">{{ part.title }}</span>
{% else %}
<span class="current" style="padding: 0 5px; ">{{ part.title }}</span>
{% endif %}
{% endif %}
{% endfor %}
{% if paginate.next %}
<li><a href="{{ paginate.next.url }}" class="next">Next</a></li>
{% else %}
<li><span></span></li>
{% endif %}
{% comment %}<li>Page {{ paginate.current_page }} of {{ paginate.pages }}</li>{% endcomment %}
</ul>
</div>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment