Skip to content

feat(docs): SEO Phase 1 — sitemap, robots.txt, metadata and canonical URLs#23

Merged
codewizdave merged 1 commit into
mainfrom
seo/documentation-metadata
Jun 5, 2026
Merged

feat(docs): SEO Phase 1 — sitemap, robots.txt, metadata and canonical URLs#23
codewizdave merged 1 commit into
mainfrom
seo/documentation-metadata

Conversation

@codewizdave

Copy link
Copy Markdown
Contributor

Summary

SEO Phase 1 critical improvements for the @deessejs/errors documentation site. This PR addresses the most impactful missing SEO elements identified in the documentation audit.

What changed

File Change
apps/web/src/app/sitemap.ts New — Image sitemap for all doc pages
apps/web/src/app/robots.ts New — robots.txt with sitemap directive
apps/web/src/app/(home)/page.tsx Added homepage metadata export (description, OpenGraph, Twitter Card)
apps/web/src/app/docs/[[...slug]]/page.tsx Added canonical URLs via alternates.canonical
apps/web/src/app/layout.tsx Added sitemap discovery link in <head>
apps/web/src/app/og/docs/[...slug]/route.tsx Fixed defensive slug handling (safely strips image.png)
apps/web/src/app/og/home/route.tsx New — Homepage OG image route
apps/web/src/lib/shared.ts Added siteUrl as single source of truth

Test plan

  • npm run dev → visit /sitemap.xml — all doc pages + homepage present
  • npm run dev → visit /robots.txt — directives displayed correctly
  • View page source on homepage — <meta name="description">, og:*, twitter:*, <link rel="canonical"> present
  • View page source on any doc — <link rel="canonical"> present
  • View page source on any page — <link rel="sitemap"> present
  • Visit /og/docs/error-factory/image.png — OG image renders correctly
  • Visit /og/home/image.png — homepage OG image renders correctly
  • npm run type-check — passes

🤖 Generated with Claude Code

…URLs

SEO Phase 1 critical improvements for @deessejs/errors documentation site:

- Add sitemap.ts with image sitemap (all doc pages + OG images)
- Add robots.ts (allow all, disallow /api/search and /llms.mdx)
- Add homepage metadata: description, OpenGraph, Twitter Card
- Add canonical URLs to all doc pages via generateMetadata
- Fix OG image route slug handling (defensive slice, removes 'image.png' safely)
- Add homepage OG image route at /og/home
- Add siteUrl to shared.ts as single source of truth
- Add sitemap discovery link to root layout <head>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
errors-web Ready Ready Preview, Comment Jun 4, 2026 2:56pm

@codewizdave codewizdave merged commit 6047562 into main Jun 5, 2026
6 checks passed
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.

1 participant