Skip to content

Instantly share code, notes, and snippets.

@justinallen
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinallen/0eb12a9b4d7b8e69564d to your computer and use it in GitHub Desktop.
Save justinallen/0eb12a9b4d7b8e69564d to your computer and use it in GitHub Desktop.
jekyll - basic pagination for posts
<div class="pagination">
{% if page.previous %}
<a class="pagination-item older" href="{{page.previous.url}}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
{% if page.next %}
<a class="pagination-item newer" href="{{page.next.url}}">Newer</a>
{% else %}
<span class="pagination-item newer">Newer</span>
{% endif %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment