fix(sitemap): render all published Pages, blog posts, and blog topics - #40
Merged
Conversation
- Fix COLLECTION_PREFIX_MAP for BlogPosts: 'posts' -> 'blog/post' to match the actual live route app/(frontend)/blog/post/[slug]/page.tsx. The old prefix produced /posts/<slug> URLs that don't exist, which would have broken the sitemap, generateContentURL previews, and live-preview links for every blog post. - Uncomment the BlogPosts and BlogTopics blocks in app/sitemap.ts so /blog, /blog/post/<slug>, and /blog/<topic> are included alongside Pages. - Skip the draft: false query option for BlogTopics in getCollectionData, since that collection has no drafts/versions system and querying with draft: false is unsupported there (per the existing warning comment in src/collections/BlogTopics/index.ts). - Update generateContentPath/generateContentURL/generatePreviewPath test fixtures to expect the corrected /blog/post/... paths. ResumeDocuments (/resume/[slug]) intentionally stays out of the sitemap: that collection requires authenticated read access and holds per-job-application generated resume variants, not general public content. Making it crawlable would require a separate access-control decision.
| poster={item.poster ?? undefined} | ||
| preload={priority ? 'auto' : 'metadata'} | ||
| ref={videoRef} | ||
| src={item.url} |
| poster={item.poster ?? undefined} | ||
| preload={priority ? 'auto' : 'metadata'} | ||
| ref={videoRef} | ||
| src={item.url} |
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.
Summary
sitemap.xmlto include every publicly crawlable path, not just Pages.COLLECTION_PREFIX_MAP: BlogPosts generated/posts/<slug>URLs that don't exist — the real route is/blog/post/<slug>. This also fixes broken live-preview links for blog posts.app/sitemap.ts.draft: falsequery option for BlogTopics, which has no drafts/versions system and can't be filtered that way.generateContentPath,generateContentURL, andgeneratePreviewPathto match the corrected paths.Explicitly out of scope
/resume/[slug](ResumeDocuments) is not added to the sitemap — that collection requires authenticated read access and stores per-job-application generated resume documents, not general public content. Making it public/crawlable would require a separate, deliberate access-control change (confirmed with the repo owner).Test plan
pnpm typecheck— no new errors (14 pre-existing errors unrelated to this change, confirmed present ondevelopbefore this branch)pnpm test— 450/450 passingpnpm linton changed files — no errors (a few style infos matching existing bracket-notation style in the file)/sitemap.xmloutput in a running app (build/dev not run in this session)🤖 Generated with Claude Code