A Metalsmith plugin to add an excerpt to files.
JavaScript Makefile
Latest commit 9173120 Dec 15, 2015 @lambtron lambtron Merge pull request #14 from davidosomething/exclude-if-exists
Use original value if already in frontmatter
Permalink
Failed to load latest commit information.
lib
test excerpt on HTML files instead of Markdown files May 5, 2014
.gitignore
History.md
Makefile first commit Feb 5, 2014
Readme.md
package.json

Readme.md

metalsmith-excerpts

A Metalsmith plugin to extract an excerpt from Markdown files.

The excerpt is scraped from first paragraph (<p> tag) of the rendered HTML.

If a file already has an excerpt value, that value will be returned.

Installation

$ npm install metalsmith-excerpts

CLI Usage

Install via npm and then add the metalsmith-excerpts key to your metalsmith.json plugin, like so:

{
  "plugins": {
    "metalsmith-excerpts": true
  } 
}

Javascript Usage

var excerpts = require('metalsmith-excerpts');

metalsmith.use(excerpts());

License

MIT