aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/pagination.html
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-06-25 02:13:47 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-06-25 02:13:47 +0300
commit7f02962f5502bb581f0b50d534be0bcea0a739b2 (patch)
tree43a1cd08cbb888e674e0333a054da787ce8c1599 /_includes/common/pagination.html
parentREADME update (diff)
downloadjekyll-theme-7f02962f5502bb581f0b50d534be0bcea0a739b2.tar.gz
jekyll-theme-7f02962f5502bb581f0b50d534be0bcea0a739b2.zip
move common assets to common/, more info to config
Diffstat (limited to '_includes/common/pagination.html')
-rw-r--r--_includes/common/pagination.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/_includes/common/pagination.html b/_includes/common/pagination.html
new file mode 100644
index 0000000..aa2f034
--- /dev/null
+++ b/_includes/common/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>&nbsp;Prev</a></li>
+ {% else %}
+ <li><a href="{{ site.baseurl }}/page{{ paginator.previous_page }}"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Prev</a></li>
+ {% endif %}
+ {% else %}
+ <li class="disabled"><a href="#"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;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&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 %}