Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a smart excerpt/summary generator. #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atao60
Copy link

@atao60 atao60 commented Nov 13, 2015

Add a smart generator of excerpts for index and feed pages.

If no summary is provided by a post header, jbake will create excerpts from the post body.

The excerpts are ready to be used in index and feed pages.
No more hard coded adaptations are required in templates.

The generator is quite versatile:

  • length and counter type (word, character or Unicode code point),
  • ellipsis,
  • readmore pattern.

Warning. Some refactoring was made in the process, mainly the creation
of:

  • a Content class to wrap the Map<String, Object> used by the Parser,
  • a PostParsingProcessor class to use the post uri inside the summary/excerpt,
  • a ContentStatus enumeration to gather the post/page status together,
  • a ContentTag enumeration to gather the labels used with Content.

It will interfere with Preliminary refactoring #135.

@jonbullock
Copy link
Member

Wow that is quite a pull request!

I haven't had chance yet to review all of the code but the first question that came to mind was how can you configure the generator to use one of the various strategies you list?

Also, seeing PostParsingProcessor in your description, this is one of the hook points I want to provide for the plugin/extension system.

I'll need to think a bit more about when and how this is integrated.

@atao60
Copy link
Author

atao60 commented May 3, 2016

Through jbake.properties. See e.g. here, at the end of the file.

@jonbullock jonbullock added this to the future milestone Apr 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants