Metalsmith plugin to define static asset files through file conventions.
npm install --save metalsmith-assets-convention
If you are using the command-line version of Metalsmith, you can install via npm, and then add the metalsmith-assets-convention
key to your metalsmith.json
file:
{
"plugins": {
"metalsmith-assets-convention": {
"extname": ".assets"
}
}
}
If you are using the JS Api for Metalsmith, then you can require the module and add it to your .use()
directives:
var assets = require('metalsmith-assets-convention');
metalsmith.use(assets({
extname: '.assets'
}));
Each static file copy is handled through naming the <name>.assets
files. The file's metadata options are passed off to metalsmith-assets
to copy the assets. All metalsmith-assets
options apply, defined through each .static file:
---
source: public
destination: .
---
Copy all the public files into the build directory.
source
represents the path to the original assets.destination
represents the path to where the final files will live. When not provided, will be where the original.asset
file existed.
MIT