Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

post.summarize for a user-defined excerpt #105

timbertson opened this Issue Dec 5, 2009 · 14 comments


None yet
10 participants

timbertson commented Dec 5, 2009

To allow for an excerpt, I used to use a chyrp plugin which chopped a post wherever you put a "" html comment marker to get just an excerpt (i.e the first section) of the post. It should be easy to parameterise the marker text if you like, but I've provided the above implementation here:



mojombo commented Jan 14, 2010

This seems useful enough to be included as a core feature. I will merge this in after 1.0 is released.

rfelix commented Jan 19, 2010

I also have implemented this feature, but I added a new field to the Post class called "preview". The marker to delimit the post content can also be specified in the config file.

Here's the code: http://github.com/rfelix/my_jekyll_extensions/blob/master/post_preview/post_preview.rb

That is to be used with jekyll_ext which allows me to extend Jekyll without touching its codebase, plus the extensions are local to the blog directory (they reside in _extensions/) and can be reutilized in other blogs. (jekyll_ext: http://github.com/rfelix/jekyll_ext)

mat813 commented Dec 7, 2010

Is there any way to make that a plugin ?


timbertson commented Dec 7, 2010

Ooh, probably - I didn't know plugins existed. I'll look into it when I have some time.

mat813 commented Dec 7, 2010

Oh, and it would be very nice if the delimiter could be configurable :-)

mat813 commented Dec 7, 2010

Ok, was quite easy to do, just plug it in https://gist.github.com/731597


timbertson commented Dec 30, 2010

I finally got around to looking at this. Turns out it's already implemented as a jekyll_ext https://github.com/rfelix/my_jekyll_extensions/blob/master/post_preview/post_preview.rb

I'm using the following config.yml setting to allow for flexible space usage:

content_delimeter: !ruby/regexp '//'

It'd be cool to see this in the mainline, but if not I'm happy to close this issue.

k7d commented Apr 29, 2011

While this is still pending, here's a description of a simple workaround without plugins:


Essentially it uses HTML comment tags to hide full content on the index pages.

@mojombo, still planning on pulling this into the mainline?

@mojombo Can we have this?


parkr commented Jan 1, 2013

Please re-submit this as a PR if you'd like to see this feature added and we'll discuss there.

@parkr parkr closed this Jan 1, 2013


ixti commented Jan 2, 2013

I have this feature on my blog as a plugin: https://github.com/ixti/ixti.github.com/blob/source/_plugins/excerpt.rb
Let me know if it is still considered as part of the core, and I'll provide a pull request with tests and support of config customization.

/cc @mojombo @qrush @parkr


parkr commented Jan 2, 2013

@ixti Please submit a patch with tests, etc, as @mojombo expressed interest above. Thanks :)


ixti commented Jan 2, 2013

OK. Will try to provide a pull request shortly.

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.