fix paginator

This commit is contained in:
Jörg Thalheim 2015-01-20 00:40:57 +01:00
parent fe64fdb136
commit bc949eca5d
2 changed files with 7 additions and 3 deletions

View File

@ -42,7 +42,7 @@ rdiscount:
highlighter: pygments # default python pygments have been replaced by pygments.rb
paginate: 10 # Posts per page on the blog index
pagination_dir: # Directory base for pagination URLs eg. /blog/page/2/
paginate_path: "posts/:num" # Directory base for pagination URLs eg. /blog/page/2/
recent_posts: 5 # Posts in the sidebar Recent Posts section
excerpt_link: "Read on →" # "Continue reading" link text at the bottom of excerpted articles
excerpt_separator: "<!--more-->"

View File

@ -9,10 +9,14 @@ layout: default
{% endfor %}
<nav id="pagenavi">
{% if paginator.previous_page %}
<a href="{{paginator.previous_page}}" class="prev">Prev</a>
{% if paginator.previous_page == 1 %}
<a href="{{ root_url }}/" class="prev">Prev</a>
{% else %}
<a href="{{ root_url }}/posts/{{paginator.previous_page}}" class="prev">Prev</a>
{% endif %}
{% endif %}
{% if paginator.next_page %}
<a href="{{paginator.next_page}}" class="next">Next</a>
<a href="{{ root_url }}/posts/{{paginator.next_page}}" class="next">Next</a>
{% endif %}
<div class="center"><a href="{{ root_url }}/archives">Blog Archives</a></div>
</nav>