Skip to content

[Directory] Eliminate directory-entry lookup noise from non-product routes - #32583

Draft
mvvmm wants to merge 1 commit into
productionfrom
fix/directory-entry-lookup-noise
Draft

[Directory] Eliminate directory-entry lookup noise from non-product routes#32583
mvvmm wants to merge 1 commit into
productionfrom
fix/directory-entry-lookup-noise

Conversation

@mvvmm

@mvvmm mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What changed

Added getDirectoryEntryBySection() in src/util/directory.ts — a shared helper that resolves directory entries by URL section (first path segment) using a pre-built map from entry.data.entry.url. Preserves dots so 1.1.1.1 resolves correctly, and skips known non-product routes (videos, glossary, plans, directory, sponsorships, resources, 404).

Replaced 6 scattered getEntry("directory", section.replaceAll(".", "")) call sites across 4 files with the shared helper:

  • src/pages/[...slug].astro
  • src/components/PageHead.astro
  • src/components/cf/ResourcesBySelector.astro
  • src/util/sidebar.ts (3 locations)

Root causes

  • replaceAll(".", "") corrupted 1.1.1.1 into 1111, which has no directory entry (85 warnings)
  • Non-product routes like /videos/, /resources/, /glossary/ were looked up as directory entries (37 warnings)
  • The lookup was duplicated across 4 files with no shared guard

Results

Metric Before After
Entry directory → ... was not found. 122 0
Pages built 8,802 8,802

Checklist

  • pnpm run check — 0 errors
  • pnpm run build — 8,802 pages, no new warnings
  • pnpm exec prettier — clean

…outes

Add getDirectoryEntryBySection() in src/util/directory.ts that resolves
entries by URL section (first path segment) with a pre-built map from
entry.data.entry.url, preserving dots so 1.1.1.1 resolves correctly.
Skips known non-product routes (videos, glossary, plans, directory,
sponsorships, resources, 404) to avoid silent miss warnings.

Replace 6 scattered getEntry("directory", section.replaceAll(".", ""))
call sites across [...slug].astro, PageHead.astro, ResourcesBySelector.astro,
and sidebar.ts with the shared helper.

Results:
- "Entry directory → ... was not found." messages: 122 → 0
- No new build warnings, 8802 pages built successfully
@github-actions github-actions Bot added the size/s label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants