summaryrefslogtreecommitdiff
path: root/_includes/paginate.html
blob: df2d75a87c22034c64684a56e026bfd939bed43c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{% comment %}
For the pagination styles see http://getbootstrap.com/components/#pagination
{% endcomment %}
<nav>
    <ul class="pagination">
        <li>
            {% if paginator.previous_page %}
                <a href="{{ paginator.previous_page_path }}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            {% else %}
                <span aria-hidden="true">&laquo;</span>
            {% endif %}
        </li>
        {% comment %}
            The first page is a special flower, see
            http://jekyllrb.com/docs/pagination/
        {% endcomment %}
        <li{% if paginator.page == 1 %} class="active"{% endif %}>
            <a href="/">1</a>
        </li>
        {% for i in (2..paginator.total_pages) %}
            <li{% if paginator.page == i %} class="active"{% endif %}>
                <a href="/{{ site.paginate_path | replace: ':num', i }}">{{ i }}</a>
            </li>
        {% endfor %}
        <li>
            {% if paginator.next_page %}
                <a href="{{ paginator.next_page_path }}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            {% else %}
                <span aria-hidden="true">&raquo;</span>
            {% endif %}
        </li>
    </ul>
</nav>