Custom excerpt length for Ghost

As of version 0.6.4, Ghost doesn't support per-article excerpt length. Instead, you have to define it in theme's loop.hbs file, which makes it a constant for all articles.

I think we can agree that having the ability to set the length of a preview for each article is a very useful feature.

You can find the code in my Gist. To see exactly which parts of the original code were changed, check out the Gist's revisions.

Once implemented, you can put <!--preview--> tag anywhere in your article to control the length of a preview.

Share this post: Twitter Facebook Reddit iMessage