chore: sitemap

This commit is contained in:
camera-2018
2023-08-11 02:27:13 +08:00
parent 6955f50136
commit c607ce8469

View File

@@ -158,23 +158,8 @@ export default withMermaid({
},
},
},
transformHtml: (_, id, { pageData }) => {
if (!/[\\/]404\.html$/.test(id))
links.push({
// you might need to change this if not using clean urls mode
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
lastmod: pageData.lastUpdated
})
},
buildEnd: async ({ outDir }) => {
const sitemap = new SitemapStream({
hostname: 'https://hdu-cs.wiki/'
})
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'))
sitemap.pipe(writeStream)
links.forEach((link) => sitemap.write(link))
sitemap.end()
await new Promise((r) => writeStream.on('finish', r))
sitemap: {
hostname: 'https://hdu-cs.wiki'
},
vite: {
resolve: {