Add robots.txt and sitemap for SEO #52

Merged
chrisp merged 2 commits from feat/sitemap-robots into main 2026-05-25 05:21:26 +00:00
Owner

Summary

  • Adds public/robots.txt blocking admin, API, league, and auth-only routes; points crawlers at /sitemap.xml
  • Adds scripts/generate-sitemap.mjs that writes public/sitemap.xml and public/sitemap.xml.gz at build time (6 public URLs)
  • Hooks sitemap generation into the build script so files are always fresh on deploy
  • Gitignores the generated sitemap files so they are never stale committed snapshots

Fixes #32
Fixes #38

Test plan

  • Run npm run sitemap — verify public/sitemap.xml and public/sitemap.xml.gz are created with today's date
  • Run npm run dev — verify GET /robots.txt and GET /sitemap.xml both return 200 with correct content
  • Confirm public/sitemap.xml is not tracked by git after a fresh generation (git status should not show it)
  • Validate sitemap XML at https://www.xml-sitemaps.com/validate-xml-sitemap.html

🤖 Generated with Claude Code

## Summary - Adds `public/robots.txt` blocking admin, API, league, and auth-only routes; points crawlers at `/sitemap.xml` - Adds `scripts/generate-sitemap.mjs` that writes `public/sitemap.xml` and `public/sitemap.xml.gz` at build time (6 public URLs) - Hooks sitemap generation into the `build` script so files are always fresh on deploy - Gitignores the generated sitemap files so they are never stale committed snapshots Fixes #32 Fixes #38 ## Test plan - [ ] Run `npm run sitemap` — verify `public/sitemap.xml` and `public/sitemap.xml.gz` are created with today's date - [ ] Run `npm run dev` — verify `GET /robots.txt` and `GET /sitemap.xml` both return 200 with correct content - [ ] Confirm `public/sitemap.xml` is not tracked by git after a fresh generation (`git status` should not show it) - [ ] Validate sitemap XML at https://www.xml-sitemaps.com/validate-xml-sitemap.html 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chrisp added 2 commits 2026-05-25 05:17:18 +00:00
Adds a static robots.txt blocking admin/API/auth routes, a sitemap
generation script (scripts/generate-sitemap.mjs) that writes both
sitemap.xml and sitemap.xml.gz to public/, and hooks it into the
build so the sitemap is always fresh on deploy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix robots.txt and sitemap issues from code review
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 1m32s
🚀 Deploy / ʦ TypeScript (pull_request) Successful in 1m23s
🚀 Deploy / 🔍 Lint (pull_request) Successful in 49s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
8e73296067
- Point Sitemap directive at /sitemap.xml (not .gz) so crawlers receive
  plain XML without needing Content-Encoding headers
- Add Disallow: /leagues/ to block all auth-gated league routes
- Gitignore public/sitemap.xml* so they are always generated fresh at
  build time rather than serving a stale committed snapshot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chrisp merged commit b4c224b368 into main 2026-05-25 05:21:26 +00:00
Sign in to join this conversation.
No description provided.