A Metalsmith plugin that allows content to be included (nested) within other content by including the file path in the document.
Continuous testing courtesy of travis-ci:
This package can be installed through npm:
npm install metalsmith-include-content
If you are using the JS api for Metalsmith, then you can require the module and add it to your .use() directives:
var include = require('metalsmith-include-content');
Metalsmith()
.use(include())
.build(function(err) {
});
Then in your markdown files (using the default pattern it needs to be at the start of the line):
include path/to/file
If you are using the command-line version of Metalsmith, you can install via npm, and then add the metalsmith-include-content
key to your metalsmith.json
file:
{
"plugins": {
"metalsmith-include-content": {
"pattern": "^include (.*)",
"ignoreMissing": false
}
}
}
The plugin allows you to override the default behaviour by passing in options.
pattern
is the regular expression pattern that is used for finding includesignoreMissing
allows you to show or hide warnings if the include file does not exist
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.