A Metalsmith plugin to use complex partials inside metalsmith
$ npm install gobha-partials
let partials = require('gobha-partials')
metalsmith.use(partials())
{
extension: "html|php|md|hbs",
partialExtension: ".hbs",
partials: "partials"
}
The plugin checks every file extension and when the extension matches the regex it will process the file and replace the partials in this file
Defines which extension the partials have, othewise they will be ignored
Defines the root folder of the partials, based on the directory where metalsmith is executed.
It will search in all files and folder in the partials folder
create a new file in the partials folder with the extension hbs
Now you can place the partial in your files
To structure your partials you can put them in subfolders in the partials folder
Example: If you have a file /partials/layout/fancy_button.hbs
you can add them by putting the subfolder infront of the partialname
MIT