feat(docs): add sitemap.xml + robots.txt for SEO#15
Merged
Conversation
Sitemap is generated by an SSR route at /sitemap.xml and prerendered to dist/client/sitemap.xml at build time. LHCI now parses the static sitemap to derive its audit URL list, removing the manual content/docs walk and giving us a single source of truth for crawler + audit URLs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Preview releaseLatest commit: No packages have been released. |
Site is effectively static aside from /api/search (Orama search index). Enable crawlLinks from / to discover docs HTML pages + their .mdx companions (server.ts rewrites /docs/foo.mdx -> /raw/foo), and seed the routes that aren't linked from HTML (llms.txt, llms-full.txt, sitemap.xml). Filter excludes /api/* and hash anchors. Result: 46 prerendered files served directly from Cloudflare's static asset binding instead of invoking the worker per request. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
src/routes/sitemap[.]xml.tsbuilds the sitemap fromsource.getPages(); prerendered todist/client/sitemap.xmlat build viatanstackStart({ pages: [...] }).public/robots.txtallows all crawlers, blocks/api/, and references the sitemap URL..lighthouserc.cjsnow parsesdist/client/sitemap.xmlinstead of walkingcontent/docs— single source of truth for crawler + LHCI audit URLs./api/search(Orama).crawlLinks: truefrom/discovers all docs HTML pages + their.mdxcompanions (server.ts rewrite). 46 files served from Cloudflare's static asset binding instead of invoking the worker per request.Test plan
pnpm --filter docsite buildprerenders 46 pages: home, sitemap, llms.txt/full.txt, 21 docs HTML + 21 .mdxpnpm --filter docsite exec tsc --noEmitpassesnode -e "require('./.lighthouserc.cjs')"parses 22 URLs from the static sitemappnpm --filter docsite check:seopasses in CI (LHCI assertions still green; performance score should improve)curl https://env.oss.variable.land/sitemap.xmlandrobots.txtreturn the prerendered files/docs/*)🤖 Generated with Claude Code