A Metalsmith plugin to extract untemplatized file contents.
This can be pretty useful when you need to access file contents without any template rendering in other templates (such as RSS/Atom feeds).
$ npm install --save metalsmith-untemplatize
{
"plugins": {
"metalsmith-untemplatize": {
"key": "untemplatized"
}
}
}
var untemplatize = require('metalsmith-untemplatize');
metalmisth.use(untemplatize({
key: 'untemplatized'
}));
Be sure to add this plugin before metalsmith-templates and after any rendering content plugin like metalsmith-markdown.
Example:
Metalsmith(__dirname)
.use(markdown())
.use(untemplatize())
.use(templates('handlebars'))
.build();
The key name which stores the untemplatized content. Defaults to untemplatized
.
Feel free to use your own (example: content
, body
, banana
or anything else).
MIT