Skip to content

fix(sitemap): generate sitemap.xml from content so all pages are included#44

Merged
sandervanhooft merged 1 commit into
mainfrom
claude/nostalgic-haibt-33847e
Jun 24, 2026
Merged

fix(sitemap): generate sitemap.xml from content so all pages are included#44
sandervanhooft merged 1 commit into
mainfrom
claude/nostalgic-haibt-33847e

Conversation

@sandervanhooft

Copy link
Copy Markdown
Member

Problem

public/sitemap.xml was a hand-maintained static file that nothing regenerated. Newly-added pages — especially docs synced in from vatly-laravel / vatly-api-php, where no human ever edits the sitemap — silently went missing.

7 pages were absent, including /packages/laravel/migrating-to-vatly:

  • /packages/laravel/migrating-to-vatly, /packages/laravel/comparison, /packages/laravel/configuration (synced from vatly-laravel)
  • /guides/selling-workflow, /guides/testing
  • /api-reference/test-helpers, /api-reference/webhook-events

Fix

Make the sitemap self-generating from content/ so it can't drift again.

  • scripts/generate-sitemap.mjs — walks content/ and derives each route the way Docus serves it (strip N. order prefixes, index.md → parent route, readme kept literal). Full rebuild on every run, so removed pages are dropped too.
  • Regenerated public/sitemap.xml — 36 → 43 URLs. Verified against all 36 previously-live URLs: zero changed, none dropped, valid XML, idempotent.
  • CI wiring:
    • deploy.yml regenerates before every build.
    • sync-sdk-docs.yml regenerates after the doc sync and commits the sitemap alongside the synced content — so synced page adds/removes flow into the sitemap automatically.
  • package.json — added npm run sitemap and a prebuild hook for local builds.

Verification

```
old: 36 new: 43 (+7, exactly the missing pages)
In OLD but NOT in NEW: (none — no regressions)
valid XML ✓
✓ idempotent (CI won't make spurious commits)
removal test: drop a page → regenerate → entry gone (43→42); restore → back (→43)
```

…uded

The sitemap was a hand-maintained static file that nothing regenerated, so
newly-added pages — especially docs synced in from vatly-laravel/vatly-api-php,
where no human edits the sitemap — silently went missing. 7 pages were absent,
including /packages/laravel/migrating-to-vatly.

- Add scripts/generate-sitemap.mjs: walks content/ and derives each route the
  way Docus serves it (strip N. prefixes, index -> parent, readme kept literal).
  Verified against all 36 previously-live URLs (zero changed).
- Regenerate public/sitemap.xml: 36 -> 43 URLs, no existing URL dropped.
- Wire into CI: deploy.yml regenerates before build; sync-sdk-docs.yml
  regenerates after the doc sync and commits the sitemap alongside content.
- Add npm scripts (sitemap + prebuild) for local builds.
@sandervanhooft sandervanhooft merged commit 44aee7b into main Jun 24, 2026
2 checks passed
@sandervanhooft sandervanhooft deleted the claude/nostalgic-haibt-33847e branch June 24, 2026 23:56
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