1.0.1 • Published 6 years ago
metalsmith-merger v1.0.1
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.
Name | Type | Default |
---|---|---|
metadata | object | {} |
pattern | regex | *.html |
exclude | array | [] |
file | string | index-all.html |
header | fn(filename, file) | <h1>{title}</h1> |
content | fn(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.