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.
This commit is contained in:
Alex Verkhovsky 2026-03-05 08:16:16 -07:00
parent 96eec1cc22
commit 5608797aa0
1 changed files with 5 additions and 1 deletions

View File

@ -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.',