seo: seo-routes.json lists every SEO route with metadata, not only the prerendered ones

So the prod app shell can give a route that has metadata but (yet) no
prerendered file its own head, self canonical and hreflang instead of the
homepage's.
This commit is contained in:
David Montero 2026-08-18 17:21:12 +02:00
parent 4da00840c6
commit 54e25cfed5
1 changed files with 4 additions and 1 deletions

View File

@ -108,10 +108,13 @@ try {
// Route metadata for the prod app shell (title/description per SEO route),
// so /<locale>/<route> paths that fall through to it get the route's own
// head instead of the homepage's.
const { SEO_ROUTES } = await vite.ssrLoadModule('/src/seoRoutes.ts');
writeFileSync(
join(distDir, 'seo-routes.json'),
JSON.stringify(
routes.map((r) => ({ path: r.path, title: r.seoMeta.title, description: r.seoMeta.description })),
SEO_ROUTES.filter((r) => r.seoMeta && !r.noindex).map((r) => ({
path: r.path, title: r.seoMeta.title, description: r.seoMeta.description,
})),
),
'utf-8',
);