Created
November 8, 2014 16:34
-
-
Save carolineschnapp/5db04d9a5b6938dc596a to your computer and use it in GitHub Desktop.
Pagination using numbers in the Minimal theme
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
{% 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 == '…' %} | |
<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