Post excerpts in Jekyll

There’s a fairly simple method for creating WordPress-like post excerpts in Jekyll using a <!-- more --> tag, but unfortunately it requires the installation of a Jekyll plugin, a feature unavailable on a GitHub-hosted Jekyll instance.

What’s a bored geek like me to do? Find another way! The exact same excerpt functionality linked to earlier can be replicated by composing a few Liquid filters in the site layout code, like so:

{{ post.content | split: '<!-- more -->' | first }}

This little bit of code will output the content of a post until it sees a <!-- more --> tag inside the post content. Just insert the <!-- more --> tag into your posts wherever you’d like them to be cut off.

You can see this snippet in action in my site index template.