From 8dde510a59ddbbdb27456b80e161cc75286f795c Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Wed, 6 Mar 2024 20:36:50 +0500 Subject: [PATCH] seo: add tag pages to sitemap --- src/pages/sitemap.xml.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/sitemap.xml.ts b/src/pages/sitemap.xml.ts index e86cf4e..7b7ff2a 100644 --- a/src/pages/sitemap.xml.ts +++ b/src/pages/sitemap.xml.ts @@ -11,6 +11,14 @@ export async function GET(context: APIContext) { ${context.site}services ${context.site}cinema` + notes + .map(entry => entry.data.tags) + .flat() + .filter((tag, i, self) => self.findIndex(t => t.slug === tag.slug) === i) + .forEach(tag => { + sitemap += `${context.site}tags/${tag.slug}` + }) + notes.forEach(note => { sitemap += `${context.site}notes/${note.slug}` })