Skip to content

feat(seo): add robots.txt and sitemap.xml - #1085

Open
mdo wants to merge 1 commit into
seo-diffshub-404sfrom
seo-robots-sitemap
Open

feat(seo): add robots.txt and sitemap.xml#1085
mdo wants to merge 1 commit into
seo-diffshub-404sfrom
seo-robots-sitemap

Conversation

@mdo

@mdo mdo commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Neither production site served a robots.txt or sitemap.xml (both 404 on diffs.com / trees.software; shadowed on diffshub.com until the 404 fix in the base PR). Search engines got no crawl guidance and no URL inventory.
  • Adds Next.js robots.ts + sitemap.ts to both apps.
  • The docs sitemap is site-aware: 8 diffs routes or 10 trees routes, selected by NEXT_PUBLIC_SITE (the other product's routes call notFound(), so advertising both would point crawlers at guaranteed 404s). DiffsHub lists only the home page.
  • New apps/docs/lib/site-origin.ts centralizes the origin shared by robots, sitemap, and (in the next PR) canonicals.

Test plan

  • /robots.txt returns a valid file pointing at /sitemap.xml on both apps
  • /sitemap.xml lists the correct route set per site
  • moonx docs:typecheck and moonx diffshub:typecheck

Stacked on #1084 (2 of 4).

Neither production site served a robots.txt or sitemap.xml (both 404, or shadowed by the diffshub catch-all before its 404 fix). Adds Next.js robots.ts and sitemap.ts to both apps. The docs sitemap is site-aware (8 diffs routes or 10 trees routes, chosen by NEXT_PUBLIC_SITE); diffshub lists only the home page since the viewer path space is unbounded and noindex. A shared lib/site-origin centralizes the origin used by robots, sitemap, and canonical URLs.
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-diffshub Ready Ready Preview Aug 19, 2026 9:17pm
pierre-docs-diffs Ready Ready Preview Aug 19, 2026 9:17pm
pierre-docs-trees Ready Ready Preview Aug 19, 2026 9:17pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pierrejs-diff-demo Skipped Skipped Aug 19, 2026 9:17pm

Request Review

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.

2 participants