Skip to content

KevinGimbel/metalsmith-simple-excerpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

metalsmith-simple-excerpt

A Metalsmith Plugin to create excerpts from file contents. Reads the first parts of the content Buffer, creates a subset of words and saves them to the file.

Installation

Install via git:

$ git clone https://github.com/kevingimbel/metalsmith-simple-excerpt node_modules/metalsmith-simple-excerpt

Install with npm

$ npm install metalsmith-simple-excerpt

Usage

Plug the excerpt into your Metalsmith pipeline. Important simpleExcerpt must be called before transforming the markdown files!

var simpleExcerpt = require('metalsmith-simple-excerpt');

var ms = Metalsmith(__dirname);
ms.use(simpleExcerpt({
  size: 50,
  bufferSize: 300,
  encoding: 'utf-8'  
});

Options

Name Type Default Description
size Integer 50 Count of returned words.
bufferSize Integer 300 Buffer length to read from
encoding String utf-8 Desired file Encoding

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published