From f65c6580e125218f057ed1506f65956d01624328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Thu, 22 Oct 2026 17:29:49 +0200 Subject: [PATCH] SEO: sitemap construction filter uses isPathAllowed + pathOf (same rule as isPathVisibleIn) Co-Authored-By: Claude Opus 5.5 --- src/modules/frontend/createContentHelpers.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/frontend/createContentHelpers.ts b/src/modules/frontend/createContentHelpers.ts index 8800809..f70aaa4 100644 --- a/src/modules/frontend/createContentHelpers.ts +++ b/src/modules/frontend/createContentHelpers.ts @@ -15,7 +15,7 @@ import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry, SitemapRou import { getAnalyticsConfig } from '../analytics/getAnalyticsConfig.js' import { getConsentTexts } from '../consent/getConsentTexts.js' -import { normalizePath } from '../construction/logic.js' +import { isPathAllowed } from '../construction/logic.js' import { pathOf } from '../construction/visibility.js' import { createMarkdownRoute } from '../content/createMarkdownRenderer.js' import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js' @@ -457,9 +457,10 @@ export function createContentHelpers({ }) // Under construction: list only the pages visitors can still open — the // rest redirect to the homepage notice, which crawlers would index. + // Same check as isPathVisibleIn(mode, pathOf(url)) (security-perf branch), with the + // mode read once for the whole list. const open = await constructionPaths() - const allowed = open ? new Set(open.map(normalizePath)) : null - const visible = allowed ? entries.filter((e) => allowed.has(normalizePath(pathOf(e.url)))) : entries + const visible = open ? entries.filter((e) => isPathAllowed(pathOf(e.url), open)) : entries return transformSitemap ? await transformSitemap(visible) : visible } catch (error) { // At runtime a failure is an error (the sitemap route answers 503, so