Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Kwpolska edited this page · 13 revisions

Note: pagination does not work with markdown files, it only works with html file extensions.

just follow this steps to add pagination to your blog:


add the pagination setting:

markdown: rdiscount
pygments: true
lsi: true
exclude: ['README.markdown', 'README_FOR_COLLABORATORS.markdown', 'Gemfile.lock', 'Gemfile']
production: false
//add this line to add pagination
paginate: 3 //the number of post per page


just add the posts and the pagination links:

layout: default
title: Blog

{% for post in paginator.posts %}

   <!-- here add you post markup -->
   <h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
   <p class="author">
    <span class="date">{{}}</span>
  <div class="content">
    {{ post.content }}
{% endfor %}

<!-- Pagination links -->
<div class="pagination">
  {% if paginator.previous_page %}
    <a href="/page{{paginator.previous_page}}" class="previous">Previous</a>
  {% else %}
    <span class="previous">Previous</span>
  {% endif %}
  <span class="page_number ">Page: {{}} of {{paginator.total_pages}}</span>
  {% if paginator.next_page %}
    <a href="/page{{paginator.next_page}}" class="next ">Next</a>
  {% else %}
    <span class="next ">Next</span>
  {% endif %}
Something went wrong with that request. Please try again.