A Metalsmith plugin for registering Handlebars partials.
Install via npm i AnthonyAtZinid/metalsmith-register-partials
then add the metalsmith-register-partials
key to your metalsmith.json
plugins, something like so:
{
"plugins": {
"metalsmith-register-partials": {
"directory": "partials"
"suffix": ".html"
}
}
}
This will register all files with the suffix .html
in the directory partials
(relative to your source) and use the path after partials
and entire filename minus .html
as the partial name.
Works for files in subfolders
Works in a metalsmith pipeline
MIT, see LICENSE.md for details.