metalsmith
Advanced tools
Comparing version 1.6.0 to 1.7.0
1.7.0 - April 30, 2015 | ||
---------------------- | ||
* add `ignore` support | ||
1.6.0 - April 14, 2015 | ||
@@ -3,0 +7,0 @@ ---------------------- |
@@ -40,2 +40,3 @@ | ||
this.plugins = []; | ||
this.ignores = []; | ||
this.directory(directory); | ||
@@ -160,2 +161,14 @@ this.metadata({}); | ||
/** | ||
* Add a file or files to the list of ignores. | ||
* | ||
* @param {String or Strings} The names of files or directories to ignore. | ||
* @return {Metalsmith} | ||
*/ | ||
Metalsmith.prototype.ignore = function(files){ | ||
if (!arguments.length) return this.ignores.slice(); | ||
this.ignores = this.ignores.concat(files); | ||
return this; | ||
}; | ||
/** | ||
* Resolve `paths` relative to the root directory. | ||
@@ -217,3 +230,4 @@ * | ||
var concurrency = this.concurrency(); | ||
var paths = yield readdir(dir); | ||
var ignores = this.ignores || null; | ||
var paths = yield readdir(dir, ignores); | ||
var files = []; | ||
@@ -220,0 +234,0 @@ var complete = 0; |
{ | ||
"name": "metalsmith", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/segmentio/metalsmith.git", |
@@ -178,2 +178,8 @@ | ||
#### #ignore(path) | ||
Ignore files from being loaded into Metalsmith. `file` can be a string, | ||
or an array of files. Glob syntax is supported via | ||
[minimatch](https://github.com/isaacs/minimatch). | ||
#### #metadata(json) | ||
@@ -180,0 +186,0 @@ |
25109
9
302
237