aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/paginator.html
blob: 55cb690a45d4a8febc98a0d192562cb0632234ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{% if site.posts.size != 0 %}
<ul class="pagination">
  {% if paginator.previous_page %}
    <li><a href="{{ site.baseurl }}{{ paginator.previous_page_path }}"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Prev</a></li>
  {% else %}
    <li class="disabled"><a href="#"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Prev</a></li>
  {% endif %}
  {% for page_number in (1..paginator.total_pages) %}
    {% if page_number == paginator.page %}
      <li class="active"><a href="#">{{ page_number }}</a></li>
    {% elsif page_number == 1 %}
      <li><a href="{{ site.baseurl }}/posts/">{{ page_number }}</a></li>
    {% else %}
      <li><a href="{{ site.baseurl }}{{ site.paginate_path | replace: ':num', page_number }}">{{ page_number }}</a></li>
    {% endif %}
  {% endfor %}
  {% if paginator.next_page %}
    <li><a href="{{ site.baseurl }}{{ paginator.next_page_path }}">Next&nbsp;<span class="glyphicon glyphicon-chevron-right"></span></a></li>
  {% else %}
    <li class="disabled"><a href="#">Next&nbsp;<span class="glyphicon glyphicon-chevron-right"></span></a></li>
  {% endif %}
</ul>
{% endif %}