How to add a “Read more” link to a Jekyll blog

We want to add a “read more” link, when the post excerpt
differs from the content. Then we link to the post using the handy post.url.

Easily done by adding this within your post loop (mine was part of home.html):

{% if post.excerpt != post.content %}
<a href="{{site_url}}{{post.url}}">Read more...</a>
{% endif %}

Published by pgk


%d bloggers like this: