diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-06 06:17:59 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-06 06:17:59 +0300 |
commit | 4e11e6d5364a12650b9a139495bd5a73943ae56a (patch) | |
tree | 061edcaa62c6b7f65f80109c42b2181840a89250 /_includes/pagination.html | |
download | sorting-algorithms-4e11e6d5364a12650b9a139495bd5a73943ae56a.tar.gz sorting-algorithms-4e11e6d5364a12650b9a139495bd5a73943ae56a.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | _includes/pagination.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/_includes/pagination.html b/_includes/pagination.html new file mode 100644 index 0000000..aa2f034 --- /dev/null +++ b/_includes/pagination.html @@ -0,0 +1,30 @@ +{% if site.posts.size != 0 %} +<ul class="pagination"> + {% if paginator.previous_page %} + {% if paginator.previous_page == 1 %} + <li><a href="{{ site.baseurl }}/"><span class="glyphicon glyphicon-chevron-left"></span> Prev</a></li> + {% else %} + <li><a href="{{ site.baseurl }}/page{{ paginator.previous_page }}"><span class="glyphicon glyphicon-chevron-left"></span> Prev</a></li> + {% endif %} + {% else %} + <li class="disabled"><a href="#"><span class="glyphicon glyphicon-chevron-left"></span> Prev</a></li> + {% endif %} + {% if paginator.page == 1 %} + <li class="active"><a href="{{ site.baseurl }}/">1</a></li> + {% else %} + <li><a href="{{ site.baseurl }}/">1</a></li> + {% endif %} + {% for count in (2..paginator.total_pages) %} + {% if count == paginator.page %} + <li class="active"><a href="{{ site.baseurl }}/page{{ count }}">{{ count }}</a></li> + {% else %} + <li><a href="{{ site.baseurl }}/page{{ count }}">{{ count }}</a></li> + {% endif %} + {% endfor %} + {% if paginator.next_page %} + <li><a href="{{ site.baseurl }}/page{{ paginator.next_page }}">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li> + {% else %} + <li class="disabled"><a href="#">Next <span class="glyphicon glyphicon-chevron-right"></span></a></li> + {% endif %} +</ul> +{% endif %} |