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:
parent
4da00840c6
commit
54e25cfed5
|
|
@ -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',
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue