From b422f2b4c14332f57a82fff96323500149ca372b Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Thu, 16 Apr 2026 01:06:26 -0300 Subject: [PATCH] fix(seo): include circuitExamples in sitemap generator generate-sitemap.mjs was only scanning examples.ts for example IDs using a textual regex. With the 40 new circuit examples living in a separate file (examples-circuits.ts), they were missing from the generated sitemap.xml and therefore invisible to search engines / SSR prerender URL list. Now the generator reads both source files and merges their example IDs. Also includes auto-applied formatting changes to generate-component-metadata.ts. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/scripts/generate-sitemap.mjs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/scripts/generate-sitemap.mjs b/frontend/scripts/generate-sitemap.mjs index 287bc28f..c378f03b 100644 --- a/frontend/scripts/generate-sitemap.mjs +++ b/frontend/scripts/generate-sitemap.mjs @@ -47,9 +47,15 @@ const routes = new Function('DOMAIN', `return [${arrayStr}]`)(DOMAIN); const indexable = routes.filter((r) => !r.noindex); -// Parse example project IDs and add /examples/:id URLs +// Parse example project IDs and add /examples/:id URLs. +// Reads both examples.ts (legacy) and examples-circuits.ts (analog/digital/ +// electromech examples added in circuitExamples). const examplesSource = readFileSync(resolve(__dirname, '../src/data/examples.ts'), 'utf-8'); -const exampleIds = parseExampleIds(examplesSource); +const circuitSource = readFileSync(resolve(__dirname, '../src/data/examples-circuits.ts'), 'utf-8'); +const exampleIds = [ + ...parseExampleIds(examplesSource), + ...parseExampleIds(circuitSource), +]; const exampleUrls = exampleIds.map((id) => ({ loc: `${DOMAIN}/examples/${id}`,