metalsmith-sitemap
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -102,3 +102,3 @@ /** | ||
if (omitIndex && path.basename(file) === 'index.html') { | ||
return S(file).chompRight('index.html').s; | ||
return replaceBackslash(S(file).chompRight('index.html')).s; | ||
} | ||
@@ -108,9 +108,17 @@ | ||
if (omitExtension) { | ||
return S(file).chompRight(path.extname(file)).s; | ||
return replaceBackslash(S(file).chompRight(path.extname(file))).s; | ||
} | ||
// Otherwise just use 'file' | ||
return file; | ||
return replaceBackslash(S(file)).s; | ||
} | ||
function replaceBackslash(url) { | ||
if (path.sep != '/') { | ||
return url.replaceAll(path.sep, '/'); | ||
} | ||
return url; | ||
} | ||
Object.keys(files).forEach(function(file) { | ||
@@ -117,0 +125,0 @@ // Get the current file's frontmatter |
{ | ||
"name": "metalsmith-sitemap", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A metalsmith plugin for generating a sitemap.xml file.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -195,2 +195,13 @@ var assert = require('assert'); | ||
it('should replace win32 backslash by slash', function(done){ | ||
Metalsmith('test/fixtures/win32-backslash') | ||
.use(sitemap('http://www.website.com/')) | ||
.build(function(err){ | ||
if (err) { | ||
return done(err); | ||
} | ||
equal('test/fixtures/win32-backslash/expected', 'test/fixtures/win32-backslash/build'); | ||
done(); | ||
}); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
23623
61
327
0