From dfad3e0326e10eaa5826781da09110a2578407b5 Mon Sep 17 00:00:00 2001 From: agusmakmun <summon.agus@gmail.com> Date: Tue, 19 Apr 2016 01:46:16 +0700 Subject: [PATCH] Update Paginations --- index.html | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 129c2c0..66d492b 100644 --- a/index.html +++ b/index.html @@ -11,17 +11,29 @@ layout: default </ol> <!-- Pagination links --> + {% if paginator.total_pages > 1 %} <div class="pagination"> {% if paginator.previous_page %} - <a href="{{ paginator.previous_page_path }}" class="previous">Previous</a> + <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a> {% else %} - <span class="previous">Previous</span> + <span>« Prev</span> {% endif %} - <span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span> + + {% for page in (1..paginator.total_pages) %} + {% if page == paginator.page %} + <em>{{ page }}</em> + {% elsif page == 1 %} + <a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a> + {% else %} + <a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a> + {% endif %} + {% endfor %} + {% if paginator.next_page %} - <a href="{{ paginator.next_page_path }}" class="next">Next</a> + <a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a> {% else %} - <span class="next">Next</span> + <span>Next »</span> {% endif %} </div> + {% endif %} </div><!-- end #home --> -- GitLab