gulp-sitemap
Advanced tools
Comparing version 0.2.4 to 0.2.5
12
index.js
@@ -24,8 +24,5 @@ 'use strict'; | ||
var priority = params.priority && params.priority.toString() || '0.5'; | ||
//set default base site url | ||
var siteUrl; | ||
//set xml spacing. can be \t for tabs | ||
var spacing = params.spacing || ' '; | ||
//array to hold lines of output sitemap.xml | ||
@@ -43,7 +40,7 @@ var xmlOutput = [].concat(xmlHeader); | ||
*/ | ||
var addFile = function (file, lastmod, cb) { | ||
var addFile = function (filename, lastmod, cb) { | ||
//format mtime to ISO (same as +00:00) | ||
lastmod = new Date(lastmod).toISOString(); | ||
//turn index.html into -> / | ||
var relativeFile = file.relative.replace(/(index)\.(html?){1}$/, '', 'i'); | ||
var relativeFile = filename.replace(/(index)\.(html?){1}$/, '', 'i'); | ||
//url location. Use slash to convert windows \\ or \ to / | ||
@@ -105,3 +102,3 @@ var loc = siteUrl + slash(relativeFile); | ||
//add file to xml | ||
return addFile(file, lastmod, cb); | ||
return addFile(file.relative, lastmod, cb); | ||
} | ||
@@ -123,3 +120,3 @@ | ||
//add file to xml | ||
return addFile(file, stats.mtime, cb); | ||
return addFile(file.relative, stats.mtime, cb); | ||
}.bind(this)); | ||
@@ -129,2 +126,3 @@ }, | ||
if (!firstFile) { | ||
//no files | ||
return cb(); | ||
@@ -131,0 +129,0 @@ } |
{ | ||
"name": "gulp-sitemap", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Generate a search engine friendly sitemap.xml using a Gulp stream", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
9528