sitemap-static
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -1,1 +0,1 @@ | ||
["index.html"] | ||
["index.html", "some_dir"] |
12
index.js
'use strict'; | ||
var findit = require('findit'); | ||
var path = require('path'); | ||
@@ -57,5 +58,7 @@ var header = '<?xml version="1.0" encoding="UTF-8"?>\n' + | ||
stream.write(indent(1) + '<url>\n' + indent(2) + | ||
'<loc>' + prefix + file + '</loc>\n' + | ||
indent(1) + '</url>'); | ||
stream.write( | ||
indent(1) + '<url>\n' + | ||
indent(2) + '<loc>' + prefix + path.relative(o.findRoot, file) + '</loc>\n' + | ||
indent(1) + '</url>' | ||
); | ||
@@ -66,3 +69,6 @@ }); | ||
stream.write('</urlset>\n'); | ||
if (stream !== process.stdout) { | ||
stream.end(); | ||
} | ||
}); | ||
}; |
{ | ||
"name": "sitemap-static", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "generate a sitemap for a static website", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,4 @@ var test = require('tap').test, | ||
}), { | ||
findRoot: 'fixtures/one' | ||
findRoot: 'fixtures/one', | ||
prefix: 'http://www.example.com/' | ||
}); | ||
@@ -27,3 +28,4 @@ }); | ||
}), { | ||
findRoot: 'fixtures/two/' | ||
findRoot: 'fixtures/two/', | ||
prefix: 'http://www.example.com/' | ||
}); | ||
@@ -41,4 +43,5 @@ }); | ||
findRoot: 'fixtures/two', | ||
ignoreFile: 'fixtures/ignore.json' | ||
ignoreFile: 'fixtures/ignore.json', | ||
prefix: 'http://www.example.com/' | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47293
123