| 1 | import type { MetadataRoute } from "next"; |
| 2 | import { contentLocalesForPath } from "@/lib/i18n/content-locales"; |
| 3 | import { SITE_URL } from "@/lib/page-meta"; |
| 4 | |
| 5 | // Public, indexable routes (locale-prefixed). /admin and /api are |
| 6 | // intentionally excluded; see app/robots.ts. |
| 7 | const PATHS = ["", "/product", "/install", "/constitution", "/models", "/plugins", "/runtime", "/docs", "/docs/auth", "/docs/computers", "/docs/configuration", "/docs/constitution", "/docs/guide", "/docs/hooks", "/docs/mcp", "/docs/modes", "/docs/fleet", "/docs/runtime-api", "/docs/sandbox", "/docs/subagents", "/docs/tools", "/docs/troubleshooting", "/docs/trust", "/docs/vocabulary", "/docs/web", "/docs/work", "/faq", "/roadmap", "/feed", "/digest", "/changelog", "/contribute", "/community", "/signin", "/signup", "/legal/terms", "/legal/privacy"]; |
| 8 | |
| 9 | export default function sitemap(): MetadataRoute.Sitemap { |
| 10 | return [...PATHS, "/computer-use"].flatMap((path) => |
| 11 | contentLocalesForPath(path || "/").map((locale) => ({ |
| 12 | url: `${SITE_URL}/${locale}${path}`, |
| 13 | alternates: { |
| 14 | languages: Object.fromEntries( |
| 15 | contentLocalesForPath(path || "/").map((l) => [ |
| 16 | l, |
| 17 | `${SITE_URL}/${l}${path}`, |
| 18 | ]), |
| 19 | ), |
| 20 | }, |
| 21 | })), |
| 22 | ); |
| 23 | } |
| 24 |