From 54e25cfed5d37ad1e218de87771f7ab5a030553b Mon Sep 17 00:00:00 2001 From: David Montero Date: Tue, 18 Aug 2026 17:21:12 +0200 Subject: [PATCH] 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. --- frontend/scripts/prerender-seo.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/scripts/prerender-seo.mjs b/frontend/scripts/prerender-seo.mjs index 89d3c6b7..6d199084 100644 --- a/frontend/scripts/prerender-seo.mjs +++ b/frontend/scripts/prerender-seo.mjs @@ -108,10 +108,13 @@ try { // Route metadata for the prod app shell (title/description per SEO route), // so // 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', );