Skip to content

fix(sitemap): emit article slugs via generated manifest, not fs - #128

Merged
sarthakagrawal927 merged 1 commit into
mainfrom
fix/sitemap-article-manifest
Sep 20, 2026
Merged

sarthakagrawal927 merged 1 commit into
mainfrom
fix/sitemap-article-manifest

Conversation

@sarthakagrawal927

Copy link
Copy Markdown
Member

Summary

  • Live /sitemap.xml listed only the 10 static routes — zero of the 13 article pages. Root cause: sitemap.ts enumerated landing-astro/src/pages/articles via existsSync/readdirSync, which silently returns empty inside the deployed Worker (no filesystem).
  • landing-astro/scripts/sync-articles.mjs now emits src/data/published-articles.ts (auto biome-formatted, same pattern as karte's emitter) that sitemap.ts imports instead.
  • The sitemap contract test now also asserts manifest↔disk parity so a hand-added article without a re-sync fails CI.

Test plan

  • vitest src/__tests__/sitemap.test.ts — 5/5 (incl. new drift assertion)
  • tsc --noEmit + biome check clean
  • Live verify /sitemap.xml lists /articles/<slug> after deploy

Generated with Devin

sitemap.ts enumerated landing-astro/src/pages/articles with
existsSync/readdirSync — inside the deployed Worker there is no
filesystem, so /sitemap.xml silently listed zero articles. The sync
script now emits src/data/published-articles.ts (biome-formatted) that
sitemap.ts imports; the contract test also asserts the manifest cannot
drift from the on-disk pages.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sarthakagrawal927
sarthakagrawal927 merged commit 8b47fc7 into main Sep 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant