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”:

{% if page.pagination.prev %}<link rel="prev" href="{{ page.pagination.prev }}" />{% endif %}
{% if %}<link rel="next" href="{{ }}" />{% 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"
Dela på Facebook