metalsmith / excerpts

A Metalsmith plugin to extract an excerpt from HTML files.
MIT License
24 stars 26 forks source link

support custom excerpt #3

Closed juliangruber closed 2 years ago

juliangruber commented 10 years ago

instead of taking the first paragraph it would be great to be able to supply a custom excerpt

ianstormtaylor commented 10 years ago

ah yeah that would be cool. basically we could just have a check for if (!data.excepert) grabFirstP() yeah?

juliangruber commented 10 years ago

sweet yeah. with data.excerpt the excerpt would need to be in the front matter, right?

ianstormtaylor commented 10 years ago

yup, it would be defined in front matter

juliangruber commented 10 years ago

lucky we use yaml, would be so awkward without multiline support

webketje commented 2 years ago

This has actually been implemented a while ago, see fixtures/no-mutation & test https://github.com/metalsmith/metalsmith-excerpts/blob/master/test/index.js#L118