1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-25 11:18:35 +01:00
blog/_src/_includes/paginator.html

44 lines
1.4 KiB
HTML
Raw Normal View History

2016-04-29 00:42:43 +02:00
{% if paginator.total_pages > 1 %}
2015-05-31 21:56:40 +02:00
2016-04-29 00:42:43 +02:00
<nav class="paginator">
{% if paginator.previous_page %}
<a class="paginator__link"
{% if paginator.previous_page == 1 %}
href="/">
{% else %}
2016-04-29 00:42:43 +02:00
href="/page/{{paginator.previous_page}}">
{% endif %}
2017-05-28 04:06:20 +02:00
<svg class="icon icon-chevron-left">
<use xlink:href="/assets/img/sprite.svg#chevron-left"></use>
2015-06-08 21:22:09 +02:00
</svg>
2015-05-31 21:56:40 +02:00
</a>
2016-04-29 00:42:43 +02:00
{% endif %}
<a
{% if paginator.page == 1 %}
href="#" class="paginator__link active"
{% else %}
href="/" class="paginator__link"
2015-05-31 21:56:40 +02:00
{% endif %}
2016-04-29 00:42:43 +02:00
>1</a>
2015-05-31 21:56:40 +02:00
2016-04-29 00:42:43 +02:00
{% for count in (2..paginator.total_pages) %}
{% if count == paginator.page %}
<a href="#" class="paginator__link active">{{count}}</a>
{% else %}
<a class="paginator__link" href="/page/{{count}}">{{count}}</a>
{% endif %}
{% endfor %}
2015-05-31 21:56:40 +02:00
2016-04-29 00:42:43 +02:00
{% if paginator.next_page %}
<a class="paginator__link" href="/page/{{paginator.next_page}}">
2017-05-28 04:06:20 +02:00
<svg class="icon icon-chevron-right">
<use xlink:href="/assets/img/sprite.svg#chevron-right"></use>
2015-06-08 21:22:09 +02:00
</svg>
2015-05-31 21:56:40 +02:00
</a>
2016-04-29 00:42:43 +02:00
{% endif %}
</nav>
2015-05-31 21:56:40 +02:00
{% endif %}