Skip to content

Commit

Permalink
Apply Prettier Formatting Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavberi committed Mar 24, 2024
1 parent 7ecc28c commit 3ee61cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"scripts": {
"dev": "next dev -p 80",
"sitemap": "node sitemap.js",
"build": "next build",
"start": "next start -p 80",
"lint": "next lint"
"lint": "next lint",
"sitemap": "node sitemap.js"
},
"dependencies": {
"@emotion/cache": "^11.11.0",
Expand Down
12 changes: 5 additions & 7 deletions sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const mapToSitemapFormat = (path) => ({
.execSync(`git log -1 --pretty="format:%ci" ${path}`)
.toString()
.trim(),
});
});
/**
* Returns a string representation of a date unit. e.g. dd, mm, yy
*
Expand All @@ -80,20 +80,18 @@ const mapToSitemapFormat = (path) => ({
const ROOT_SITEMAP_ENTRY = {
url: SITEMAP_HOSTNAME,
lastmod: makeDate(
fs
.statSync(APP_ROOT + "/" + PAGE_FILENAME)
.mtime.toLocaleString()
// .split("/")
fs.statSync(APP_ROOT + "/" + PAGE_FILENAME).mtime.toLocaleString(),
// .split("/")
),
};
const content = await streamToPromise(
Readable.from([
ROOT_SITEMAP_ENTRY,
...SITEMAP_PATHS.map((url) => mapToSitemapFormat(url)),
]).pipe(stream)
]).pipe(stream),
).then((data) => data.toString());
console.info("Successfully generated sitemap...");

// Write our sitemap contents to [WRITE_FILE_PATH].
fs.writeFileSync(WRITE_FILE_PATH, content);
} catch (err) {
Expand Down

0 comments on commit 3ee61cb

Please sign in to comment.