fix(sitemap): generate sitemap.xml from content so all pages are included#44
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
public/sitemap.xmlwas a hand-maintained static file that nothing regenerated. Newly-added pages — especially docs synced in fromvatly-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 fromvatly-laravel)/guides/selling-workflow,/guides/testing/api-reference/test-helpers,/api-reference/webhook-eventsFix
Make the sitemap self-generating from
content/so it can't drift again.scripts/generate-sitemap.mjs— walkscontent/and derives each route the way Docus serves it (stripN.order prefixes,index.md→ parent route,readmekept literal). Full rebuild on every run, so removed pages are dropped too.public/sitemap.xml— 36 → 43 URLs. Verified against all 36 previously-live URLs: zero changed, none dropped, valid XML, idempotent.deploy.ymlregenerates before every build.sync-sdk-docs.ymlregenerates after the doc sync and commits the sitemap alongside the synced content — so synced page adds/removes flow into the sitemap automatically.package.json— addednpm run sitemapand aprebuildhook 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)
```