1.0.1 • Published 6 years ago

metalsmith-merger v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

metalsmith-merger

A Metalsmith plugin that merges files.

This is useful when you want a single-page version of your site. I created this to package a documentation website into a single, printable page.

Installation

$ npm install metalsmith-merger

Usage

Include metalsmith-merger in your metalsmith pipeline.

metalsmith-merger can be used without options:

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

metalsmith.use(merger());

Options

By passing in certain properties, you can change the behavior.

NameTypeDefault
metadataobject{}
patternregex*.html
excludearray[]
filestringindex-all.html
headerfn(filename, file)<h1>{title}</h1>
contentfn(filename, file){contents}

metadata

A set of metadata which will be added to the merged file.

pattern

The files to include in the merge.

exclude

An array of files to exclude from the merge.

file

The destination for the merged file.

header

A function which controls the display of the header in-between files.

content

A function which control the display of the content of the files.