A Metalsmith plugin to ignore files that match a pattern.
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
History.md
Readme.md
package-lock.json
package.json 1.0.0 Jul 17, 2018

Readme.md

metalsmith-ignore

A Metalsmith plugin to ignore files that match a pattern. Uses multimatch for matching.

Installation

$ npm install metalsmith-ignore

CLI Usage

Install via npm and then add the metalsmith-ignore key to your metalsmith.json plugins. The simplest case just ignores a single pattern:

{
  "plugins": {
    "metalsmith-ignore": "drafts/*"
  }
}

But you can also pass an array of patterns to ignore:

{
  "plugins": {
    "metalsmith-ignore": [
      "drafts/*",
      "unfinished/*"
    ]
  }
}

Javascript Usage

Pass the options to Metalsmith#use:

var ignore = require('metalsmith-ignore');

metalsmith.use(ignore('drafts/*'));

You can also pass an array of patterns to ignore:

var ignore = require('metalsmith-ignore');

metalsmith.use(ignore([
  'drafts/*',
  'unfinished/*'
]));

License

MIT