Skip to content

docs: make Email SDK agent-ready#2

Open
leoisadev1 wants to merge 2 commits into
mainfrom
t3code/37af2119
Open

docs: make Email SDK agent-ready#2
leoisadev1 wants to merge 2 commits into
mainfrom
t3code/37af2119

Conversation

@leoisadev1
Copy link
Copy Markdown
Member

Automated PR - Greptile review workflow

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
email-sdk-fumadocs Ready Ready Preview, Comment May 29, 2026 9:32pm

@leoisadev1
Copy link
Copy Markdown
Member Author

@greptile review

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR makes the Email SDK docs site agent-ready by adding llms.txt/llms-full.txt content-type headers, new robots.txt and sitemap.xml routes, Open Graph/Twitter meta tags, and two new documentation pages (provider-readiness, ai-resources). The agents/skill.mdx page is relocated to getting-started/agent-skill.mdx and the top-level agents/ category is dissolved.

  • New infrastructure routes (robots.txt, sitemap.xml) are cleanly implemented: robots.txt uses a single wildcard rule with a Sitemap: pointer; sitemap.xml resolves all page URLs to absolute URLs via new URL(url, siteUrl) with a complete five-entity XML escape function.
  • __root.tsx meta tags are updated to add og:type, og:title, og:description, and twitter:card: summary using shared constants; no og:url or canonical tag is emitted (intentionally left to per-page routes to avoid a static root value on every page).
  • provider-readiness.mdx and ai-resources.mdx are new well-structured pages covering production adapter selection, fallback safety, test commands, and how to feed the docs to coding assistants.

Confidence Score: 5/5

This PR is safe to merge — all changes are documentation content and supporting infrastructure with no logic that touches the email-sending core.

The new route handlers (robots.txt, sitemap.xml) are server-only and straightforward; the sitemap correctly resolves relative paths to absolute URLs and escapes all five required XML entities. The meta-tag additions in the root route use shared constants and avoid introducing incorrect canonical or og:url values. The two new docs pages add content only.

No files require special attention.

Important Files Changed

Filename Overview
apps/fumadocs/src/lib/shared.ts Extracts siteDescription and siteUrl as shared constants; siteUrl reads from SITE_URL / VITE_SITE_URL env vars with a hardcoded fallback, used only in server-side route handlers so the process.env access is appropriate.
apps/fumadocs/src/routes/__root.tsx Adds og:type, og:title, og:description, twitter:card (summary), twitter:title, and twitter:description meta tags using the new shared constants; no og:url or canonical are added, which is intentional.
apps/fumadocs/src/routes/sitemap[.]xml.ts New sitemap route generating absolute URLs via new URL(url, siteUrl); escapeXml covers all five XML entities (&, <, >, ", '); Content-Type correctly set to application/xml.
apps/fumadocs/src/routes/robots[.]txt.ts New robots.txt route; simple and correct — one wildcard User-agent with Allow: / and a Sitemap pointer using siteUrl.
apps/fumadocs/content/docs/getting-started/provider-readiness.mdx New page covering production checklist, recommended adapter pairs, fallback safety, retry/fallback ordering, hook usage, and test coverage table.
apps/fumadocs/content/docs/getting-started/ai-resources.mdx New page documenting llms.txt, llms-full.txt, and per-page Markdown endpoints with grounding examples for assistants.
apps/fumadocs/vite.config.ts Adds robots.txt and sitemap.xml to the pre-render path list so they are included in the static build output.

Reviews (4): Last reviewed commit: "fix: address Greptile review feedback" | Re-trigger Greptile

Comment thread apps/fumadocs/src/routes/__root.tsx Outdated
Comment thread apps/fumadocs/src/routes/sitemap[.]xml.ts
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR makes the Email SDK docs site agent-ready by adding llms.txt, llms-full.txt, robots.txt, and sitemap.xml endpoints, two new docs pages (provider readiness and AI resources), and moving the agent skill page into the getting-started section. It also enriches the root route with OG/Twitter meta tags and a canonical link.

  • New routes: robots.txt (explicit AI crawler allowlist), sitemap.xml (full URL inventory), and Content-Type headers on both llms.txt endpoints — all clean additions.
  • New docs pages: provider-readiness.mdx and ai-resources.mdx cover production adapter selection, fallback safety rules, and machine-readable resource URLs; content is accurate and consistent with the SDK.
  • Meta tag additions in __root.tsx: The canonical <link> and og:url are both hardcoded to the root domain (siteUrl), so every docs page will emit the wrong canonical URL pointing to the homepage — this needs to be made per-page before merging.

Confidence Score: 3/5

The docs content and new endpoints are solid, but the root route emits a static canonical URL on every page, which will tell search engines that all docs pages are duplicates of the homepage.

Almost all of the changes — new routes, docs pages, nav restructuring, Content-Type fixes — are clean and correct. The one issue that needs attention before merging is in __root.tsx: the canonical link and og:url are both set to the root domain for every page on the site, so every individual docs page will incorrectly declare itself a duplicate of the homepage. This will actively harm search indexing of the doc pages this PR is designed to surface.

apps/fumadocs/src/routes/__root.tsx needs per-page canonical and og:url values instead of the static siteUrl root.

Important Files Changed

Filename Overview
apps/fumadocs/src/routes/__root.tsx Adds OG/Twitter meta tags and a canonical link — but the canonical href and og:url are both hardcoded to the root domain, so every docs page will emit the wrong canonical URL. Also uses twitter:card summary_large_image without a twitter:image tag.
apps/fumadocs/src/lib/shared.ts Adds siteDescription and siteUrl constants; siteUrl falls back to the hardcoded domain when env vars are absent. Clean change.
apps/fumadocs/src/routes/sitemap[.]xml.ts New sitemap route that enumerates all docs pages and their Markdown equivalents. Includes /llms.txt and /llms-full.txt which are non-HTML entries; escapeXml only handles &, <, > which is sufficient for URLs.
apps/fumadocs/src/routes/robots[.]txt.ts New robots.txt route explicitly allows all AI crawlers; per-bot Allow entries are redundant given the wildcard Allow: / rule, but functionally correct.
apps/fumadocs/content/docs/getting-started/provider-readiness.mdx New production checklist page covering adapter selection, fallback safety, retry order, hooks, and test coverage. Content is accurate and consistent with the codebase.
apps/fumadocs/content/docs/getting-started/ai-resources.mdx New page documenting machine-readable endpoints (llms.txt, per-page .md, llms-full.txt) for AI assistant use. Clean and accurate.

Sequence Diagram

sequenceDiagram
    participant Bot as AI Crawler / Search Tool
    participant Robots as /robots.txt
    participant Sitemap as /sitemap.xml
    participant LLMs as /llms.txt
    participant LLMsFull as /llms-full.txt
    participant Docs as /docs/{page}.md

    Bot->>Robots: GET /robots.txt
    Robots-->>Bot: Allow: / + Sitemap pointer

    Bot->>Sitemap: GET /sitemap.xml
    Sitemap-->>Bot: All HTML + Markdown URLs

    Bot->>LLMs: GET /llms.txt
    LLMs-->>Bot: Compact docs index (text/plain)

    Bot->>LLMsFull: GET /llms-full.txt
    LLMsFull-->>Bot: Full docs bundle (text/plain)

    Bot->>Docs: GET /docs/getting-started/quickstart.md
    Docs-->>Bot: Per-page Markdown
Loading

Fix All in Claude Code

Reviews (2): Last reviewed commit: "docs: make Email SDK agent-ready" | Re-trigger Greptile

Comment thread apps/fumadocs/src/routes/__root.tsx Outdated
Comment thread apps/fumadocs/src/routes/__root.tsx
Comment thread apps/fumadocs/src/routes/robots[.]txt.ts Outdated
Comment thread apps/fumadocs/src/routes/sitemap[.]xml.ts Outdated
@leoisadev1
Copy link
Copy Markdown
Member Author

@greptile 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.

1 participant