TechShotgun/index.html

57 lines
2.1 KiB
HTML
Raw Permalink Normal View History

---
layout: index
description: the good site of life
---
{% for post in paginator.posts %}
{% include article_index.html %}
{% endfor %}
{% if paginator.total_pages > 1 %}
<div class="pagination">
<!-- link to first page -->
{% if paginator.total_pages > 3 %}
{% if paginator.page == 1 %}
<span class="disabled"><i class="fa fa-angle-double-left"></i></span>
{% else %}
<a href="{{ '/' | prepend: site.baseurl | replace: '//', '/' }}"><i class="fa fa-angle-double-left"></i></a>
{% endif %}
{% endif %}
<!-- previous link -->
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}"><i class="fa fa-angle-left"></i></a>
{% else %}
<span class="disabled"><i class="fa fa-angle-left"></i></span>
{% endif %}
<!-- number links -->
{% capture start %}
{{ paginator.page | minus: 3 }}
{% endcapture %}
{% for i in (1..paginator.total_pages) limit: 5 offset: start %}
{% if i == paginator.page %}
<span class="disabled">{{ i }}</span>
{% else %}
<a href="/page/{{ i }}">{{ i }}</a>
{% endif %}
{% endfor %}
<!-- next link -->
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}"><i class="fa fa-angle-right"></i></a>
{% else %}
<span class="disabled"><i class="fa fa-angle-right"></i></span>
{% endif %}
<!-- last page link -->
{% if paginator.total_pages > 3 %}
{% if paginator.page == paginator.total_pages %}
<span class="disabled"><i class="fa fa-angle-double-right"></i></span>
{% else %}
<a href="{{ site.baseurl | replace: '//', '/' }}/page/{{paginator.total_pages}}"><i class="fa fa-angle-double-right"></i></a>
{% endif %}
{% endif %}
</div>
{% endif %}