From 5608797aa06156b176e576cb088b9ba1b2812e39 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Thu, 5 Mar 2026 08:16:16 -0700 Subject: [PATCH] fix(i18n): exclude 404 pages from sitemap Custom 404 pages (root and zh-cn) were indexed as regular content in the sitemap. Add a filter to the @astrojs/sitemap integration that matches the /404 path segment precisely via regex on the URL pathname. --- website/astro.config.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/astro.config.mjs b/website/astro.config.mjs index 1f3c78d83..1b987d7f1 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -36,7 +36,11 @@ export default defineConfig({ }, integrations: [ - sitemap(), + // Exclude custom 404 pages (all locales) from the sitemap — they are + // treated as normal content docs by Starlight even with disable404Route. + sitemap({ + filter: (page) => !/\/404(\/|$)/.test(new URL(page).pathname), + }), starlight({ title: 'BMAD Method', tagline: 'AI-driven agile development with specialized agents and workflows that scale from bug fixes to enterprise platforms.',