Pagination on posts in Jekyll

A very basic way on how to setup custom pagination on posts in Jekyll.

Articles which is divided into separate URL’s should have rel="prev" and rel="next" link tags to indicate paginated content.

Under “_includes”, add the following into “head.html”:

<head>
...
{% if page.pagination.prev %}<link rel="prev" href="{{ page.pagination.prev }}" />{% endif %}
{% if page.pagination.next %}<link rel="next" href="{{ page.pagination.next }}" />{% endif %}
...

Then just use this Front Matter markup in posts. If left empty, the link-tags will not be inserted into the post.

---
layout: post
title:  "Hello world"
pagination:
  prev:
  next:
---
Dela på Facebook