From 384224cb624030522057df22527312957665d8e9 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Mon, 7 Oct 2024 17:16:11 +0800 Subject: [PATCH] docs: add sitemap to improve SEO --- website/docusaurus.config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 58afdfb..3ce9197 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -57,6 +57,18 @@ const config: Config = { require.resolve('./src/css/custom.css'), ], }, + sitemap: { + lastmod: 'date', + changefreq: 'weekly', + priority: 0.5, + ignorePatterns: ['/tags/**'], + filename: 'sitemap.xml', + createSitemapItems: async (params) => { + const { defaultCreateSitemapItems, ...rest } = params; + const items = await defaultCreateSitemapItems(rest); + return items.filter((item) => !item.url.includes('/page/')); + }, + }, }, ], ],