gulp-sitemap
Advanced tools
Comparing version 2.0.2 to 2.1.0
26
index.js
@@ -21,15 +21,18 @@ 'use strict'; | ||
}); | ||
var entries = []; | ||
var firstFile; | ||
var msg; | ||
if (!config.siteUrl) { | ||
throw new gutil.PluginError(pluginName, 'siteUrl is a required param'); | ||
msg = 'siteUrl is a required param'; | ||
throw new gutil.PluginError(pluginName, msg); | ||
} | ||
if (options.changeFreq) { | ||
gutil.log(pluginName, chalk.magenta('changeFreq') + ' has been deprecated. Please use ' + chalk.cyan('changefreq')); | ||
msg = chalk.magenta('changeFreq') + ' has been deprecated. Please use ' + chalk.cyan('changefreq'); | ||
gutil.log(pluginName, msg); | ||
config.changefreq = options.changeFreq; | ||
} | ||
if (config.siteUrl.slice(-1) !== '/') { | ||
config.siteUrl += '/'; | ||
config.siteUrl = config.siteUrl + '/'; | ||
} | ||
var entries = []; | ||
var firstFile; | ||
@@ -43,3 +46,4 @@ return through.obj(function (file, enc, callback) { | ||
if (file.isStream()) { | ||
return callback(new gutil.PluginError(pluginName, 'Streaming not supported')); | ||
msg = 'Streaming not supported'; | ||
return callback(new gutil.PluginError(pluginName), msg); | ||
} | ||
@@ -52,4 +56,7 @@ | ||
firstFile = firstFile || file; | ||
var entry = sitemap.getEntryConfig(file.relative, file.stat && file.stat.mtime, config); | ||
if (!firstFile) { | ||
firstFile = file; | ||
} | ||
var mtime = file.stat ? file.stat.mtime : null; | ||
var entry = sitemap.getEntryConfig(file.relative, mtime, config); | ||
entries.push(entry); | ||
@@ -64,3 +71,4 @@ callback(); | ||
if (options.verbose) { | ||
gutil.log(pluginName, 'Files in sitemap:', entries.length); | ||
msg = 'Files in sitemap: ' + entries.length; | ||
gutil.log(pluginName, msg); | ||
} | ||
@@ -67,0 +75,0 @@ //create and push new vinyl file for sitemap |
'use strict'; | ||
var slash = require('slash'); | ||
var multimatch = require('multimatch'); | ||
var contains = require('lodash.contains'); | ||
var includes = require('lodash.includes'); | ||
@@ -113,3 +113,3 @@ //TODO: export this to an external module | ||
} | ||
return contains(validChangefreqs, changefreq.toLowerCase()); | ||
return includes(validChangefreqs, changefreq.toLowerCase()); | ||
} | ||
@@ -116,0 +116,0 @@ |
{ | ||
"name": "gulp-sitemap", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Generate a search engine friendly sitemap.xml using a Gulp stream", | ||
@@ -37,15 +37,15 @@ "repository": "pgilad/gulp-sitemap", | ||
"dependencies": { | ||
"chalk": "^0.5.1", | ||
"gulp-util": "^3.0.1", | ||
"lodash.contains": "^2.4.1", | ||
"lodash.defaults": "^2.4.1", | ||
"chalk": "^1.0.0", | ||
"gulp-util": "^3.0.4", | ||
"lodash.defaults": "^3.1.1", | ||
"lodash.includes": "^3.1.1", | ||
"multimatch": "^2.0.0", | ||
"slash": "^1.0.0", | ||
"through2": "^0.6.3" | ||
"through2": "^0.6.5" | ||
}, | ||
"devDependencies": { | ||
"gulp": "^3.8.10", | ||
"mocha": "*", | ||
"should": "*" | ||
"gulp": "^3.8.11", | ||
"mocha": "^2.2.4", | ||
"should": "^6.0.1" | ||
} | ||
} |
12963
179
+ Addedlodash.includes@^3.1.1
+ Addedlodash._baseassign@3.2.0(transitive)
+ Addedlodash._baseindexof@3.1.0(transitive)
+ Addedlodash._bindcallback@3.0.1(transitive)
+ Addedlodash._createassigner@3.1.1(transitive)
+ Addedlodash.assign@3.2.0(transitive)
+ Addedlodash.defaults@3.1.2(transitive)
+ Addedlodash.includes@3.1.3(transitive)
+ Addedlodash.isstring@3.0.1(transitive)
- Removedlodash.contains@^2.4.1
- Removedansi-regex@0.2.1(transitive)
- Removedansi-styles@1.1.0(transitive)
- Removedchalk@0.5.1(transitive)
- Removedhas-ansi@0.1.0(transitive)
- Removedlodash._basebind@2.4.1(transitive)
- Removedlodash._basecreate@2.4.1(transitive)
- Removedlodash._basecreatecallback@2.4.1(transitive)
- Removedlodash._basecreatewrapper@2.4.1(transitive)
- Removedlodash._baseindexof@2.4.1(transitive)
- Removedlodash._createwrapper@2.4.1(transitive)
- Removedlodash._isnative@2.4.1(transitive)
- Removedlodash._objecttypes@2.4.1(transitive)
- Removedlodash._setbinddata@2.4.1(transitive)
- Removedlodash._shimkeys@2.4.1(transitive)
- Removedlodash._slice@2.4.1(transitive)
- Removedlodash.bind@2.4.1(transitive)
- Removedlodash.contains@2.4.3(transitive)
- Removedlodash.defaults@2.4.1(transitive)
- Removedlodash.forown@2.4.1(transitive)
- Removedlodash.identity@2.4.1(transitive)
- Removedlodash.isarray@2.4.1(transitive)
- Removedlodash.isfunction@2.4.1(transitive)
- Removedlodash.isobject@2.4.1(transitive)
- Removedlodash.isstring@2.4.1(transitive)
- Removedlodash.keys@2.4.1(transitive)
- Removedlodash.noop@2.4.1(transitive)
- Removedlodash.support@2.4.1(transitive)
- Removedstrip-ansi@0.3.0(transitive)
- Removedsupports-color@0.2.0(transitive)
Updatedchalk@^1.0.0
Updatedgulp-util@^3.0.4
Updatedlodash.defaults@^3.1.1
Updatedthrough2@^0.6.5