A Metalsmith plugin that isolates files by a pattern. This allows you to apply other metalsmith plugins only to specific files.
- can match files by pattern
$ npm install metalsmith-isolate
by pattern - this is just passing a globing pattern. The passed pattern can be a single pattern (as a string) or an array of globing patterns. For more information read the multimatch patterns documentation.
var isolate = require('metalsmith-isolate'),
permalinks = require('metalsmith-permalinks');
metalsmith.use(isolate(["*.md"]))
// apply other plugins only to *.md files
// e.g. permalinks
.use(permalinks({
pattern: ':date/:title',
}))
// use empty selector to reset
.use(isolate());