Browse Source

Fixed the siteMap generator.

pull/4/head
jrtechs 6 years ago
parent
commit
0da9c29df8
2 changed files with 20 additions and 16 deletions
  1. +11
    -0
      sitemap.txt
  2. +9
    -16
      utils/generateSiteMap.js

+ 11
- 0
sitemap.txt View File

@ -0,0 +1,11 @@
http://jrtechs.net/
http://jrtechs.net/category/projects
http://jrtechs.net/category/java
http://jrtechs.net/category/test
http://jrtechs.net/category/testing-2
http://jrtechs.net/category/testing-three 3
http://jrtechs.net/category/other
http://jrtechs.net/projects/steam-friends-graph
http://jrtechs.net/projects/java-fibonacci-solver
http://jrtechs.net/projects/musical-floppy-drive-build-log
http://jrtechs.net/java/top-three-recommended-java-ides

+ 9
- 16
utils/generateSiteMap.js View File

@ -13,24 +13,17 @@ module.exports=
{ {
sql.getSiteMap().then(function(result) sql.getSiteMap().then(function(result)
{ {
var buf = Buffer.from(result, 'utf8');
var path = '../sitemap.txt';
fs.open(path, 'w', function(error, fd)
console.log(result);
fs.writeFile("./sitemap.txt", result, function(err)
{ {
if(error)
throw 'could not open file: ' + error;
fs.write(fd, buf, 0, buf.length, null, function(err)
if(err)
{ {
if(err)
throw "error writing file: " + err;
fs.close(fd, function()
{
console.log("Updated Sitemap");
})
});
console.log(err);
}
else
{
console.log("sitemap updated");
}
}); });
}); });
} }

Loading…
Cancel
Save