metalsmith-branch
A metalsmith plugin to run separate middleware pipelines on selected files.
Facilitates 'declarative' pipelines by file pattern or filter, since it means each plugin doesn't have to implement its own filtering. See examples below.
April 2014: Please bear in mind that this is 0.0.x software and use with caution, especially since metalsmith itself is likely to change.
Installation
$ npm install metalsmith-branch
Usage
In your build file:
var branch = metalsmith // you can also specify the pattern directly in constructor metalsmith // or select files by function of their name, properties, and order: var { var dt = last = dt dt dt; last return propspublished >= last ;} metalsmith
Note that nested branches are possible too.
// to post-process only markdown-sourced files in a 'special' dir: metalsmith
It's also possible to specify an array of patterns:
// to select all markdown files in the "posts" and "projects" directories: metalsmith
See multimatch for all pattern options.
License
MIT