gulp-sitemap
Advanced tools
Comparing version 2.0.1 to 2.0.2
26
index.js
@@ -18,3 +18,4 @@ 'use strict'; | ||
lastmod: null, | ||
mappings: [] | ||
mappings: [], | ||
verbose: false | ||
}); | ||
@@ -35,12 +36,10 @@ | ||
return through.obj(function (file, enc, cb) { | ||
return through.obj(function (file, enc, callback) { | ||
//we handle null files (that have no contents), but not dirs | ||
if (file.isDirectory()) { | ||
cb(null, file); | ||
return; | ||
return callback(null, file); | ||
} | ||
if (file.isStream()) { | ||
cb(new gutil.PluginError(pluginName, 'Streaming not supported')); | ||
return; | ||
return callback(new gutil.PluginError(pluginName, 'Streaming not supported')); | ||
} | ||
@@ -50,4 +49,3 @@ | ||
if (/404\.html?$/i.test(file.relative)) { | ||
cb(); | ||
return; | ||
return callback(); | ||
} | ||
@@ -58,10 +56,12 @@ | ||
entries.push(entry); | ||
cb(); | ||
callback(); | ||
}, | ||
function (cb) { | ||
function (callback) { | ||
if (!firstFile) { | ||
cb(); | ||
return; | ||
return callback(); | ||
} | ||
var contents = sitemap.prepareSitemap(entries, config); | ||
if (options.verbose) { | ||
gutil.log(pluginName, 'Files in sitemap:', entries.length); | ||
} | ||
//create and push new vinyl file for sitemap | ||
@@ -74,4 +74,4 @@ this.push(new gutil.File({ | ||
})); | ||
cb(); | ||
callback(); | ||
}); | ||
}; |
{ | ||
"name": "gulp-sitemap", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Generate a search engine friendly sitemap.xml using a Gulp stream", | ||
@@ -5,0 +5,0 @@ "repository": "pgilad/gulp-sitemap", |
@@ -190,2 +190,12 @@ # [gulp](https://github.com/wearefractal/gulp)-sitemap | ||
#### verbose | ||
Type: `boolean` | ||
Required: `false` | ||
Default: `false` | ||
If true, will log the number of files that where handled. | ||
## Complementary plugins | ||
@@ -192,0 +202,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12758
211