Files
technical-writer 2e90643938
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: 7
sop-checklist-gate / gate (pull_request_target) Successful in 4s
Secret scan / secret-scan (pull_request) Successful in 17s
CI / build (pull_request) Successful in 1m6s
feat(seo/geo): add sitemap.xml, robots.txt, and llms.txt
- sitemap.ts: all 112 doc URLs, generated from the fumadocs source tree
- robots.ts: allow-all (incl. AI answer-engine bots) + sitemap pointer
- llms.txt: llmstxt.org index — product summary + 111 grouped doc links so
  ChatGPT/Claude/Perplexity/Gemini can discover and correctly cite the docs (GEO)
Build verified (next build exit 0; all three render as static routes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 22:22:32 -07:00

32 lines
1.1 KiB
TypeScript

import type { MetadataRoute } from 'next';
import { source } from '@/lib/source';
const BASE = 'https://doc.moleculesai.app';
// Static sitemap of every documentation page, generated from the fumadocs
// source tree at build time. Helps search engines and answer engines
// (Google, Bing, Perplexity, ChatGPT) discover and crawl the full docs set.
export default function sitemap(): MetadataRoute.Sitemap {
const now = new Date();
const docPages = source.getPages().map((page) => ({
url: `${BASE}${page.url}`,
lastModified: now,
changeFrequency: 'weekly' as const,
priority: page.url === '/docs' ? 1.0 : 0.7,
}));
const staticRoutes = [
{ url: `${BASE}/`, changeFrequency: 'weekly' as const, priority: 0.9 },
{ url: `${BASE}/docs`, changeFrequency: 'weekly' as const, priority: 1.0 },
].map((r) => ({ ...r, lastModified: now }));
// de-dupe /docs if it also appears in docPages
const seen = new Set<string>();
return [...staticRoutes, ...docPages].filter((e) => {
if (seen.has(e.url)) return false;
seen.add(e.url);
return true;
});
}