From c607ce8469009422d74dabf944b4926f9ffeec8f Mon Sep 17 00:00:00 2001 From: camera-2018 <2907618001@qq.com> Date: Fri, 11 Aug 2023 02:27:13 +0800 Subject: [PATCH] chore: sitemap --- .vitepress/config.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.vitepress/config.js b/.vitepress/config.js index ad3891e..2b082c9 100644 --- a/.vitepress/config.js +++ b/.vitepress/config.js @@ -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: {