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.
$ npm install metalsmith-merger
Include metalsmith-merger
in your metalsmith pipeline.
metalsmith-merger
can be used without options:
var merger = require('metalsmith-merger');
metalsmith.use(merger());
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} |
A set of metadata which will be added to the merged file.
The files to include in the merge.
An array of files to exclude from the merge.
The destination for the merged file.
A function which controls the display of the header in-between files.
A function which control the display of the content of the files.