diff options
author | ache <ache@ache.one> | 2023-11-16 09:26:45 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2023-11-16 09:26:45 +0100 |
commit | 093fdafe3ecded8ebc3ffb75bbd0860afdaf5bec (patch) | |
tree | b6c3bdab02c534e36481880b442a763799b79457 | |
parent | Push avif alternativ to png (diff) |
Readabilty of sitemap generation
-rw-r--r-- | src/build/index.mjs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/build/index.mjs b/src/build/index.mjs index 63f2d6a..a2b10af 100644 --- a/src/build/index.mjs +++ b/src/build/index.mjs @@ -135,11 +135,15 @@ for (const lang in i18n) { } console.log(`Create: sitemap.xml`); + // Create a stream to write to -const stream = new SitemapStream({hostname: 'https://ache.one'}) +const stream = new SitemapStream({hostname: 'https://ache.one'}); // Return a promise that resolves with your XML string -streamToPromise(Readable.from(links).pipe(stream)).then((data) => - data.toString() -).then(sitemapXML => fs.writeFileSync("sitemap.xml", sitemapXML)); +streamToPromise( + Readable.from(links) + .pipe(stream)) + .then(data => data.toString()) + .then(sitemapXML => fs.writeFileSync("sitemap.xml", sitemapXML) +); |