metalsmith-basename
A Metalsmith plugin that adds file's basename as a metadate for the file, making it available for example for permalinks and helps to generate files based on it.
npm i -D metalsmith-basename
opts.pattern (array)
Process only selected documents. Example:
opts.verbose (boolean)
Log the files that gets processed and skipped. Defaults to false.
Example
Example usage of plugin with others.
Installation:
npm i -D metalsmith \ harmonize \ gulp-load-plugins \ metalsmith-markdown-remarkable \ metalsmith-permalinks \ metalsmith-basename
Documents:
src/ my-document.md my another document.mdpackage.json
Building:
// Harmonize is required with metalsmith when using node <= 0.12 ;var Metalsmith = ;var loadPlugins = ; // Using gulp plugin loader to load metalsmith pluginsvar plugins = ; __dirname ;
Output:
build/ my-document/index.html my-another-document/index.htmlsrc/ my-document.md my another document.mdpackage.json
License
MIT licensed