carolineschnapp
11/8/2014 - 4:34 PM

Pagination using numbers in the Minimal theme

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 %}