diff --git a/scripts/test-seo.mjs b/scripts/test-seo.mjs index fdea603..a91cbb2 100644 --- a/scripts/test-seo.mjs +++ b/scripts/test-seo.mjs @@ -60,7 +60,7 @@ const NI = 'noindex, follow' const robotsCas = [ [AEP, '/', null], [AEP, '/agences', null], [AEP, '/fiche/12', null], [AEP, '/entree', null], [AEP, '/signaler', NI], [AEP, '/ajouter', NI], [AEP, '/proposer', NI], - [AEP, '/dev/fiche-mini-card', NI], [AEP, '/codev', NI], [AEP, '/codev/demo', NI], + [AEP, '/dev/fiche-mini-card', NI], [AEP, '/codev', null], [AEP, '/codev/acces', NI], [AEP, '/codev/fiche', NI], [AEP, '/codev/demo', NI], [AEP, '/codevelopper', null], [AEP, '/evenements/ruetz', NI], [EVT, '/ruetz', null], [EVT, '/evenements/ruetz', null], ] @@ -115,7 +115,7 @@ const routes = ['/', '/a-propos', '/agences', '/ajouter', '/codev', '/codev/cart '/dev/fiche-mini-card', '/entree', '/fiche/:id()', '/manifeste', '/media', '/outils', '/proposer', '/rag', '/signaler', '/trouver-du-taf', '/evenements', '/evenements/ruetz', '/evenements/:slug()'] egal('sitemap aep', cheminsSitemap(routes, AEP), - ['/', '/a-propos', '/agences', '/entree', '/manifeste', '/media', '/outils', '/trouver-du-taf']) + ['/', '/a-propos', '/agences', '/codev', '/entree', '/manifeste', '/media', '/outils', '/trouver-du-taf']) egal('sitemap event', cheminsSitemap(routes, EVT), ['/', '/ruetz']) const xml = sitemapXml([{ loc: `${A}/` }, { loc: `${A}/fiche/1?a=1&b=2`, lastmod: '2026-10-01' }]) @@ -163,7 +163,8 @@ if (base) { egal('HTTP / : canonique, pas de robots', [canon(hAcc), rob(hAcc)], [`${A}/`, null]) const hFiche = await page('/?fiche=108&vue=fiches') egal('HTTP /?fiche=108 → /fiche/108', canon(hFiche), `${A}/fiche/108`) - for (const p of ['/signaler', '/ajouter', '/proposer', '/codev']) egal(`HTTP ${p} noindex`, rob(await page(p)), NI) + for (const p of ['/signaler', '/ajouter', '/proposer', '/codev/acces']) egal(`HTTP ${p} noindex`, rob(await page(p)), NI) + egal('HTTP /codev : indexable (recette publique, lot Y)', rob(await page('/codev')), null) const rApi = await get('/api/stats') egal('HTTP /api/stats X-Robots-Tag', rApi.headers.get('x-robots-tag'), 'noindex') diff --git a/utils/seo.ts b/utils/seo.ts index dd927c3..8479a09 100644 --- a/utils/seo.ts +++ b/utils/seo.ts @@ -25,9 +25,12 @@ const PARAMS_GARDES: Record = { '/outils': ['tab'], } -/** Pages d'action ou privées : noindex, hors sitemap. /codev : tant qu'il est derrière un mot de passe (constaté le 21/10). */ +/** + * Pages d'action ou privées : noindex, hors sitemap. /codev est la recette publique depuis le lot Y + * (03/11) : indexable ; ses sous-pages (mot de passe, fiche, carto, QR, démo) restent hors index. + */ const NOINDEX_EXACT = ['/signaler', '/ajouter', '/proposer'] -const NOINDEX_PREFIXES = ['/dev', '/codev'] +const NOINDEX_PREFIXES = ['/dev', '/codev/acces', '/codev/fiche', '/codev/carto', '/codev/qr', '/codev/demo'] /** Pages qui ne font que rediriger (navigateTo 301 côté page) : jamais dans le sitemap. */ export const PAGES_REDIRECTION = ['/rag', '/contribuer']