@vercel/geistdocs 1.2.1 → 1.2.3-canary.1d733b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts +8 -0
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right-small.js +4 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts +5 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right.js +4 -0
- package/dist/assets/icons/icon-check.d.ts +5 -0
- package/dist/assets/icons/icon-check.d.ts.map +1 -0
- package/dist/assets/icons/icon-check.js +4 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts +8 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-down-small.js +7 -0
- package/dist/assets/icons/icon-chevron-right.d.ts +5 -0
- package/dist/assets/icons/icon-chevron-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-right.js +4 -0
- package/dist/assets/icons/icon-copy.d.ts +5 -0
- package/dist/assets/icons/icon-copy.d.ts.map +1 -0
- package/dist/assets/icons/icon-copy.js +4 -0
- package/dist/assets/icons/icon-file-text.d.ts +5 -0
- package/dist/assets/icons/icon-file-text.d.ts.map +1 -0
- package/dist/assets/icons/icon-file-text.js +4 -0
- package/dist/assets/icons/icon-menu-alt.d.ts +5 -0
- package/dist/assets/icons/icon-menu-alt.d.ts.map +1 -0
- package/dist/assets/icons/icon-menu-alt.js +4 -0
- package/dist/assets/icons/icon-slash-forward.d.ts +8 -0
- package/dist/assets/icons/icon-slash-forward.d.ts.map +1 -0
- package/dist/assets/icons/icon-slash-forward.js +4 -0
- package/dist/assets/icons/index.d.ts +10 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/dist/assets/icons/index.js +10 -0
- package/dist/assets/logos/index.d.ts +15 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/dist/assets/logos/index.js +15 -0
- package/dist/assets/logos/logo-ai-elements.d.ts +8 -0
- package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-elements.js +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-sdk.js +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-chat-sdk.js +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-flags-sdk.js +8 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts +9 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -0
- package/dist/assets/logos/logo-icon-vercel.js +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts.map +1 -0
- package/dist/assets/logos/logo-nextjs.js +7 -0
- package/dist/assets/logos/logo-streamdown.d.ts +8 -0
- package/dist/assets/logos/logo-streamdown.d.ts.map +1 -0
- package/dist/assets/logos/logo-streamdown.js +8 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts +8 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -0
- package/dist/assets/logos/logo-svelte-kit.js +7 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts +8 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -0
- package/dist/assets/logos/logo-vercel-oss.js +7 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-workflow-sdk.js +8 -0
- package/dist/cli/index.js +3 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +45 -0
- package/dist/components/copy-prompt.d.ts +11 -0
- package/dist/components/copy-prompt.d.ts.map +1 -0
- package/dist/components/copy-prompt.js +58 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +117 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/footer.d.ts +8 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +6 -0
- package/dist/home-layout.d.ts +11 -0
- package/dist/home-layout.d.ts.map +1 -0
- package/dist/home-layout.js +31 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/config-context.d.ts +10 -0
- package/dist/internal/config-context.d.ts.map +1 -0
- package/dist/internal/config-context.js +15 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/footer/github-button.d.ts +7 -0
- package/dist/internal/footer/github-button.d.ts.map +1 -0
- package/dist/internal/footer/github-button.js +10 -0
- package/dist/internal/footer/rss-button.d.ts +2 -0
- package/dist/internal/footer/rss-button.d.ts.map +1 -0
- package/dist/internal/footer/rss-button.js +4 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/localized-link.d.ts +8 -0
- package/dist/internal/localized-link.d.ts.map +1 -0
- package/dist/internal/localized-link.js +13 -0
- package/dist/internal/navbar/desktop-menu.d.ts +10 -0
- package/dist/internal/navbar/desktop-menu.d.ts.map +1 -0
- package/dist/internal/navbar/desktop-menu.js +11 -0
- package/dist/internal/navbar/mobile-menu.d.ts +7 -0
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -0
- package/dist/internal/navbar/mobile-menu.js +44 -0
- package/dist/internal/navbar/navbar-logo.d.ts +16 -0
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -0
- package/dist/internal/navbar/navbar-logo.js +30 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +13 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +171 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/page-visibility.d.ts +18 -0
- package/dist/internal/page-visibility.d.ts.map +1 -0
- package/dist/internal/page-visibility.js +24 -0
- package/dist/internal/provider-client.d.ts +9 -0
- package/dist/internal/provider-client.d.ts.map +1 -0
- package/dist/internal/provider-client.js +24 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +9 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +38 -0
- package/dist/internal/table-of-contents.d.ts +9 -0
- package/dist/internal/table-of-contents.d.ts.map +1 -0
- package/dist/internal/table-of-contents.js +5 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/navigation-menu.d.ts +17 -0
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -0
- package/dist/internal/ui/navigation-menu.js +38 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +14 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +31 -0
- package/dist/mdx.d.ts +67 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +35 -0
- package/dist/mobile-docs-bar.d.ts +7 -0
- package/dist/mobile-docs-bar.d.ts.map +1 -0
- package/dist/mobile-docs-bar.js +13 -0
- package/dist/navbar.d.ts +7 -0
- package/dist/navbar.d.ts.map +1 -0
- package/dist/navbar.js +10 -0
- package/dist/pages/docs.d.ts +83 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +98 -0
- package/dist/proxy.d.ts +37 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +189 -0
- package/dist/routes/agents.d.ts +21 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +201 -0
- package/dist/routes/chat.d.ts +14 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +251 -0
- package/dist/routes/llms.d.ts +52 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +110 -0
- package/dist/routes/search.d.ts +13 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +81 -0
- package/dist/routes/sitemap.d.ts +47 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +176 -0
- package/dist/shiki-theme.d.ts +20 -0
- package/dist/shiki-theme.d.ts.map +1 -0
- package/dist/shiki-theme.js +110 -0
- package/dist/sidebar.d.ts +11 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +16 -0
- package/dist/source-config.d.ts +68 -0
- package/dist/source-config.d.ts.map +1 -0
- package/dist/source-config.js +161 -0
- package/dist/source.d.ts +181 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +142 -0
- package/dist/versions.d.ts +45 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +79 -0
- package/package.json +186 -9
- package/source-config.js +174 -0
- package/styles.css +556 -0
- package/template/AGENTS.md +82 -0
- package/template/_gitignore +29 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +24 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +23 -0
- package/template/app/[lang]/(home)/components/templates.tsx +48 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +15 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/agents.md/route.ts +6 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +22 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +595 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components.json +22 -0
- package/template/content/docs/agent-readiness.mdx +103 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +89 -0
- package/template/content/docs/configuration.cn.mdx +155 -0
- package/template/content/docs/configuration.mdx +275 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +40 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +51 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +29 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +89 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +108 -0
- package/template/content/docs/index.cn.mdx +57 -0
- package/template/content/docs/index.mdx +95 -0
- package/template/content/docs/internationalization.cn.mdx +111 -0
- package/template/content/docs/internationalization.mdx +122 -0
- package/template/content/docs/llms-txt.cn.mdx +72 -0
- package/template/content/docs/llms-txt.mdx +86 -0
- package/template/content/docs/md.cn.mdx +65 -0
- package/template/content/docs/md.mdx +82 -0
- package/template/content/docs/meta.json +25 -0
- package/template/content/docs/migration.mdx +321 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +80 -0
- package/template/content/docs/provider.cn.mdx +70 -0
- package/template/content/docs/provider.mdx +74 -0
- package/template/content/docs/proxy.cn.mdx +96 -0
- package/template/content/docs/proxy.mdx +178 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +108 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +411 -0
- package/template/content/docs/theme-aware-image.mdx +57 -0
- package/template/content/docs/versioned-docs.cn.mdx +117 -0
- package/template/content/docs/versioned-docs.mdx +228 -0
- package/template/geistdocs.tsx +77 -0
- package/template/lib/geistdocs/config.tsx +30 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +17 -0
- package/template/source.config.ts +23 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 国际化
|
|
3
|
+
description: 为您的文档站点添加多语言支持
|
|
4
|
+
type: guide
|
|
5
|
+
summary: 通过 Geistdocs CLI 和 Fumadocs 路由实现多语言文档自动翻译。
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/configuration
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Geistdocs 支持开箱即用的国际化 (i18n),使用 Fumadocs 的语言感知路由。您可以通过 Geistdocs CLI 提供多语言文档并使用自动翻译。
|
|
13
|
+
|
|
14
|
+
## 工作原理
|
|
15
|
+
|
|
16
|
+
i18n 系统使用带有 `[lang]` URL 段的动态路由。默认语言(英语)不会显示在 URL 中,而其他语言会获得前缀:
|
|
17
|
+
|
|
18
|
+
- `/docs/getting-started` - 英语(默认)
|
|
19
|
+
- `/cn/docs/getting-started` - 中文
|
|
20
|
+
|
|
21
|
+
用户可以使用导航栏中的语言选择器切换语言。
|
|
22
|
+
|
|
23
|
+
## 翻译内容
|
|
24
|
+
|
|
25
|
+
使用 Geistdocs CLI 自动翻译您的 MDX 文件:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx @vercel/geistdocs translate
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
CLI 会从 `geistdocs.tsx` 中读取目标语言并提示您选择要翻译的文件。
|
|
32
|
+
|
|
33
|
+
翻译由 Geistdocs 平台生成,并与原始文件并存保存在带有区域后缀的文件中(例如,`introduction.cn.mdx`)。
|
|
34
|
+
|
|
35
|
+
### 命令选项
|
|
36
|
+
|
|
37
|
+
您可以直接传递选项以跳过交互式提示:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Translate files using the default glob pattern
|
|
41
|
+
npx @vercel/geistdocs translate
|
|
42
|
+
|
|
43
|
+
# Translate files matching a specific glob pattern
|
|
44
|
+
npx @vercel/geistdocs translate "content/docs/**/*.mdx"
|
|
45
|
+
|
|
46
|
+
# Use a custom config file
|
|
47
|
+
npx @vercel/geistdocs translate "content/**/*.mdx" --config custom-config.tsx
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| 选项 | 描述 |
|
|
51
|
+
| ----------- | ---------------------------------------------------------- |
|
|
52
|
+
| `--config` | 含有翻译配置的配置文件路径(默认:`geistdocs.tsx`) |
|
|
53
|
+
| `--url` | 自定义翻译 API URL |
|
|
54
|
+
|
|
55
|
+
### 批量处理
|
|
56
|
+
|
|
57
|
+
当翻译多个文件时,CLI 会自动将它们分成每组 10 个的批次,以避免速率限制。每个批次完成时都会显示进度。
|
|
58
|
+
|
|
59
|
+
## 配置
|
|
60
|
+
|
|
61
|
+
在 `geistdocs.tsx` 中配置支持的语言:
|
|
62
|
+
|
|
63
|
+
```typescript title="geistdocs.tsx"
|
|
64
|
+
export const translations = {
|
|
65
|
+
en: {
|
|
66
|
+
displayName: "English",
|
|
67
|
+
},
|
|
68
|
+
cn: {
|
|
69
|
+
displayName: "中文",
|
|
70
|
+
search: "搜尋文檔",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`translations` 对象中的第一个区域设置被视为默认/源语言,并且不会作为翻译目标。
|
|
76
|
+
|
|
77
|
+
### 添加新语言
|
|
78
|
+
|
|
79
|
+
添加新语言的步骤:
|
|
80
|
+
|
|
81
|
+
1. 在 `translations` 对象中添加带有语言代码的新键
|
|
82
|
+
2. 为诸如 `displayName` 和 `search` 之类的 UI 元素添加翻译
|
|
83
|
+
3. 运行 `npx @vercel/geistdocs translate "content/**/*.mdx"` 以生成翻译内容
|
|
84
|
+
|
|
85
|
+
语言选择器将自动包含您添加的新语言。
|
|
86
|
+
|
|
87
|
+
## 内容组织
|
|
88
|
+
|
|
89
|
+
翻译后的文件与原始文件并存并带有语言后缀保存:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
content/docs/
|
|
93
|
+
├── getting-started.mdx # English (default)
|
|
94
|
+
├── getting-started.cn.mdx # Chinese
|
|
95
|
+
├── getting-started.fr.mdx # French
|
|
96
|
+
└── getting-started.es.mdx # Spanish
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Fumadocs 会根据 URL 路径自动提供正确的文件。
|
|
100
|
+
|
|
101
|
+
## 翻译 UI 元素
|
|
102
|
+
|
|
103
|
+
`geistdocs.tsx` 中的 `translations` 对象控制诸如搜索占位符、导航标签和错误消息等 UI 文本。为您支持的每种语言添加相应的翻译。
|
|
104
|
+
|
|
105
|
+
如果您没有为某个特定元素提供翻译,则会回退到英语。
|
|
106
|
+
|
|
107
|
+
## 语言检测
|
|
108
|
+
|
|
109
|
+
语言由 URL 路径确定。不根据浏览器设置进行自动检测——用户必须使用语言选择器显式选择他们的语言。
|
|
110
|
+
|
|
111
|
+
这种方法为用户提供了完全的控制,并确保他们看到预期的语言。
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Internationalization
|
|
3
|
+
description: Add multi-language support to your documentation site
|
|
4
|
+
type: guide
|
|
5
|
+
summary: Serve documentation in multiple languages with automatic translation via the Geistdocs CLI and Fumadocs routing.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/configuration
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Geistdocs supports internationalization (i18n) out of the box using Fumadocs' language-aware routing. You can serve documentation in multiple languages with automatic translation via the Geistdocs CLI.
|
|
13
|
+
|
|
14
|
+
<CopyPrompt text="Help me add a new language to this Geistdocs project. Update translations in geistdocs.tsx, run the Geistdocs translate command for content/docs, and explain how localized routes are generated.">
|
|
15
|
+
Help me add a new language to this Geistdocs project. Update `translations` in `geistdocs.tsx`, run the Geistdocs translate command for `content/docs`, and explain how localized routes are generated.
|
|
16
|
+
</CopyPrompt>
|
|
17
|
+
|
|
18
|
+
## How it works
|
|
19
|
+
|
|
20
|
+
The i18n system uses dynamic routing with a `[lang]` URL segment. The default language (English) doesn't show in URLs, while other languages get a prefix:
|
|
21
|
+
|
|
22
|
+
- `/docs/getting-started` - English (default)
|
|
23
|
+
- `/cn/docs/getting-started` - Chinese
|
|
24
|
+
|
|
25
|
+
Users can switch languages using the language selector in the navigation bar.
|
|
26
|
+
|
|
27
|
+
## Translating Content
|
|
28
|
+
|
|
29
|
+
Use the Geistdocs CLI to automatically translate your MDX files:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm translate
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The CLI reads your target locales from `geistdocs.tsx`. If no locales are found in the config, you'll be prompted to enter them manually.
|
|
36
|
+
|
|
37
|
+
Translations are generated using the Geistdocs platform and saved alongside your original file with the locale suffix (e.g., `introduction.cn.mdx`).
|
|
38
|
+
|
|
39
|
+
### Command Options
|
|
40
|
+
|
|
41
|
+
You can pass options directly to customize the translation behavior:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Translate all MDX files (uses default pattern)
|
|
45
|
+
pnpm translate
|
|
46
|
+
|
|
47
|
+
# Translate files matching a specific glob pattern
|
|
48
|
+
pnpm translate "content/docs/**/*.mdx"
|
|
49
|
+
|
|
50
|
+
# Use a custom config file
|
|
51
|
+
pnpm translate "content/**/*.mdx" --config custom-config.tsx
|
|
52
|
+
|
|
53
|
+
# Use a custom translation API URL
|
|
54
|
+
pnpm translate --url "https://custom-api.example.com/translate"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Option | Description |
|
|
58
|
+
| ----------- | -------------------------------------------------------- |
|
|
59
|
+
| `--config` | Path to config file with translations (default: `geistdocs.tsx`) |
|
|
60
|
+
| `--url` | Custom translation API URL (can also use `GEISTDOCS_TRANSLATE_URL` env var) |
|
|
61
|
+
|
|
62
|
+
Pass the glob pattern as the command argument. If you omit it, Geistdocs uses `content/docs/**/*.mdx`.
|
|
63
|
+
|
|
64
|
+
The CLI automatically excludes files that already have a locale suffix (e.g., `getting-started.cn.mdx`) to avoid translating already-translated content.
|
|
65
|
+
|
|
66
|
+
### Batch Processing
|
|
67
|
+
|
|
68
|
+
When translating multiple files, the CLI automatically batches them into groups of 10. Progress is displayed as each batch completes, and a 1-second delay is added between batches to avoid rate limiting.
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
Configure supported languages in `geistdocs.tsx`:
|
|
73
|
+
|
|
74
|
+
```typescript title="geistdocs.tsx"
|
|
75
|
+
export const translations = {
|
|
76
|
+
en: {
|
|
77
|
+
displayName: "English",
|
|
78
|
+
},
|
|
79
|
+
cn: {
|
|
80
|
+
displayName: "中文",
|
|
81
|
+
search: "搜尋文檔",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The first locale in the `translations` object is treated as your default/source language and is excluded from translation targets.
|
|
87
|
+
|
|
88
|
+
### Adding a New Language
|
|
89
|
+
|
|
90
|
+
To add a new language:
|
|
91
|
+
|
|
92
|
+
1. Add a new key to the `translations` object with the language code
|
|
93
|
+
2. Add translations for UI elements like `displayName` and `search`
|
|
94
|
+
3. Run `pnpm translate "content/**/*.mdx"` to generate translated content
|
|
95
|
+
|
|
96
|
+
The language selector will automatically include your new language.
|
|
97
|
+
|
|
98
|
+
## Content Organization
|
|
99
|
+
|
|
100
|
+
Translated files are saved alongside the original with a locale suffix:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
content/docs/
|
|
104
|
+
├── getting-started.mdx # English (default)
|
|
105
|
+
├── getting-started.cn.mdx # Chinese
|
|
106
|
+
├── getting-started.fr.mdx # French
|
|
107
|
+
└── getting-started.es.mdx # Spanish
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Fumadocs automatically serves the correct file based on the URL path.
|
|
111
|
+
|
|
112
|
+
## Translating UI Elements
|
|
113
|
+
|
|
114
|
+
The `translations` object in `geistdocs.tsx` controls UI text like search placeholders, navigation labels, and error messages. Add translations for each language you support.
|
|
115
|
+
|
|
116
|
+
If you don't provide a translation for a specific element, it falls back to English.
|
|
117
|
+
|
|
118
|
+
## Language Detection
|
|
119
|
+
|
|
120
|
+
The language is determined by the URL path. There's no automatic detection based on browser settings - users must explicitly choose their language using the language selector.
|
|
121
|
+
|
|
122
|
+
This approach gives users full control and ensures they see the language they expect.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: llms.txt
|
|
3
|
+
description: 一个包含您所有文档的纯文本单文件,供 AI 使用
|
|
4
|
+
type: conceptual
|
|
5
|
+
summary: 遵循 llms.txt 标准,将所有文档以纯 Markdown 文本形式返回的单一端点。
|
|
6
|
+
related:
|
|
7
|
+
- /docs/md
|
|
8
|
+
- /docs/ask-ai
|
|
9
|
+
- /docs/proxy
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Geistdocs 实现了 [llms.txt 标准](https://llmstxt.org/) —— 一种约定,将您所有的文档内容提供为单个、AI 可读的文本文件。这使得语言模型可以一次性轻松理解您的完整文档。
|
|
13
|
+
|
|
14
|
+
## 它是什么
|
|
15
|
+
|
|
16
|
+
`/llms.txt` 端点以单次响应返回您所有的文档页面,格式为纯 Markdown。每个页面之间用空行分隔,便于 AI 工具解析和理解您的完整文档。
|
|
17
|
+
|
|
18
|
+
### 访问
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
https://yourdomain.com/llms.txt
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
将所有文档页面串联为纯文本返回。
|
|
25
|
+
|
|
26
|
+
## 工作原理
|
|
27
|
+
|
|
28
|
+
该端点会:
|
|
29
|
+
|
|
30
|
+
1. 从您的文档中获取所有页面
|
|
31
|
+
2. 处理每个页面以提取干净的 Markdown
|
|
32
|
+
3. 将所有内容合并为单个文本文件
|
|
33
|
+
4. 以 `text/markdown` 返回
|
|
34
|
+
|
|
35
|
+
页面之间使用双换行符 (`\n\n`) 连接以便清晰分隔。
|
|
36
|
+
|
|
37
|
+
## 配置 sources
|
|
38
|
+
|
|
39
|
+
生成的项目使用一个文档 source:
|
|
40
|
+
|
|
41
|
+
```ts title="app/[lang]/llms.txt/route.ts"
|
|
42
|
+
import { createLlmsRoute } from "@vercel/geistdocs/routes/llms";
|
|
43
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
44
|
+
|
|
45
|
+
export const { GET, revalidate } = createLlmsRoute({
|
|
46
|
+
source: geistdocsSource,
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
有多个内容区或版本的站点可以传入 `sources`:
|
|
51
|
+
|
|
52
|
+
```ts title="app/[lang]/llms.txt/route.ts"
|
|
53
|
+
export const { GET, revalidate } = createLlmsRoute({
|
|
54
|
+
sources: [docsSource, cookbookSource],
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 使用场景
|
|
59
|
+
|
|
60
|
+
此功能可用于:
|
|
61
|
+
|
|
62
|
+
- **AI 训练** - 将您的文档作为 AI 助手的上下文
|
|
63
|
+
- **搜索索引** - 将您完整的文档提供给搜索系统
|
|
64
|
+
- **内容分析** - 分析跨文档的模式和内容
|
|
65
|
+
- **批量处理** - 一次处理所有文档
|
|
66
|
+
- **LLM 上下文** - 为语言模型提供完整的文档上下文
|
|
67
|
+
|
|
68
|
+
## llms.txt 标准
|
|
69
|
+
|
|
70
|
+
llms.txt 标准是一种简单的约定,使文档对 AI 工具更易访问。它在精神上类似于 `robots.txt`,但设计目标是面向语言模型而非搜索爬虫。
|
|
71
|
+
|
|
72
|
+
在 [llmstxt.org](https://llmstxt.org/) 了解更多。
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: llms.txt
|
|
3
|
+
description: A single file containing all your documentation in plain text for AI consumption
|
|
4
|
+
type: conceptual
|
|
5
|
+
summary: A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
|
|
6
|
+
related:
|
|
7
|
+
- /docs/agent-readiness
|
|
8
|
+
- /docs/md
|
|
9
|
+
- /docs/ask-ai
|
|
10
|
+
- /docs/proxy
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Geistdocs implements the [llms.txt standard](https://llmstxt.org/), a convention for exposing documentation as one AI-readable text file. Language models and coding agents can use `/llms.txt` to retrieve broad documentation context.
|
|
14
|
+
|
|
15
|
+
<CopyPrompt text="Help me verify this Geistdocs site's AI-readable docs. Check /llms.txt and a few .mdx page URLs, then explain whether an AI assistant can retrieve the full documentation context.">
|
|
16
|
+
Help me verify this Geistdocs site's AI-readable docs. Check `/llms.txt` and a few `.mdx` page URLs, then explain whether an AI assistant can retrieve the full documentation context.
|
|
17
|
+
</CopyPrompt>
|
|
18
|
+
|
|
19
|
+
## What it is
|
|
20
|
+
|
|
21
|
+
The `/llms.txt` endpoint returns all configured documentation pages as Markdown in a single response. Each page is separated by blank lines so AI tools can parse the complete documentation set.
|
|
22
|
+
|
|
23
|
+
### Access
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
https://yourdomain.com/llms.txt
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Returns all documentation pages concatenated together as Markdown.
|
|
30
|
+
|
|
31
|
+
## How it works
|
|
32
|
+
|
|
33
|
+
The package route helper:
|
|
34
|
+
|
|
35
|
+
1. Fetches pages from one or more source bundles.
|
|
36
|
+
2. Processes each page to extract clean Markdown.
|
|
37
|
+
3. Combines the pages into a single response.
|
|
38
|
+
4. Returns the response as `text/markdown`.
|
|
39
|
+
|
|
40
|
+
Pages are joined with double newlines (`\n\n`) for clear separation.
|
|
41
|
+
|
|
42
|
+
## Use cases
|
|
43
|
+
|
|
44
|
+
This feature enables:
|
|
45
|
+
|
|
46
|
+
- **AI Training** - Provide your docs as context for AI assistants
|
|
47
|
+
- **Search Indexing** - Feed your entire documentation to search systems
|
|
48
|
+
- **Content Analysis** - Analyze patterns and content across all docs
|
|
49
|
+
- **Bulk Processing** - Process all documentation at once
|
|
50
|
+
- **LLM Context** - Give language models complete documentation context
|
|
51
|
+
|
|
52
|
+
## Configure sources
|
|
53
|
+
|
|
54
|
+
Generated projects use one documentation source:
|
|
55
|
+
|
|
56
|
+
```ts title="app/[lang]/llms.txt/route.ts"
|
|
57
|
+
import { createLlmsRoute } from "@vercel/geistdocs/routes/llms";
|
|
58
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
59
|
+
|
|
60
|
+
export const { GET, revalidate } = createLlmsRoute({
|
|
61
|
+
source: geistdocsSource,
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Sites with multiple content sections or versions can pass `sources`:
|
|
66
|
+
|
|
67
|
+
```ts title="app/[lang]/llms.txt/route.ts"
|
|
68
|
+
export const { GET, revalidate } = createLlmsRoute({
|
|
69
|
+
sources: [docsSource, cookbookSource],
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Use `filterPage` to exclude pages from `/llms.txt`, such as internal or preview-only docs:
|
|
74
|
+
|
|
75
|
+
```ts title="app/[lang]/llms.txt/route.ts"
|
|
76
|
+
export const { GET, revalidate } = createLlmsRoute({
|
|
77
|
+
source: geistdocsSource,
|
|
78
|
+
filterPage: (page) => !page.url.includes("/internal"),
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## The llms.txt standard
|
|
83
|
+
|
|
84
|
+
The llms.txt standard is a simple convention that makes documentation more accessible to AI tools. It's similar in spirit to `robots.txt` but designed for language models instead of search crawlers.
|
|
85
|
+
|
|
86
|
+
Learn more at [llmstxt.org](https://llmstxt.org/)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: .md 扩展
|
|
3
|
+
description: 通过在任何 URL 后追加 .md 或 .mdx 来以原始 Markdown 访问文档页面
|
|
4
|
+
type: conceptual
|
|
5
|
+
summary: 通过在 URL 后追加 .md 或 .mdx 以原始 Markdown 格式访问任何文档页面,供 AI 工具使用。
|
|
6
|
+
related:
|
|
7
|
+
- /docs/llms-txt
|
|
8
|
+
- /docs/proxy
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Geistdocs 允许 AI 工具和语言模型以纯 Markdown 的形式访问文档页面。在文档 URL 后追加 `.md` 或 `.mdx`,即可获取该页面处理后的 Markdown 内容。
|
|
12
|
+
|
|
13
|
+
## 工作原理
|
|
14
|
+
|
|
15
|
+
当你在任何文档 URL 后添加 `.md` 或 `.mdx` 时,你将得到页面内容的纯文本 Markdown,而不是呈现的 HTML。这样可以方便 AI 工具读取并理解你的文档。
|
|
16
|
+
|
|
17
|
+
### 示例
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
# Normal page
|
|
21
|
+
https://yourdomain.com/docs/getting-started
|
|
22
|
+
|
|
23
|
+
# Markdown version
|
|
24
|
+
https://yourdomain.com/docs/getting-started.mdx
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`.mdx` 版本返回:
|
|
28
|
+
|
|
29
|
+
- 页面标题作为 H1 级标题
|
|
30
|
+
- 完整的处理后 Markdown 内容
|
|
31
|
+
- 无 HTML、样式或导航
|
|
32
|
+
|
|
33
|
+
## 使用场景
|
|
34
|
+
|
|
35
|
+
此功能特别适用于:
|
|
36
|
+
|
|
37
|
+
- **AI 聊天工具** - 像 ChatGPT、Claude 和 Cursor 这样的工具可以获取并读取你的文档
|
|
38
|
+
- **LLM 上下文** - 为语言模型提示提供干净的文本
|
|
39
|
+
- **文档分析** - 提取内容以便处理或分析
|
|
40
|
+
- **内容迁移** - 以干净的格式导出文档
|
|
41
|
+
|
|
42
|
+
## 实现
|
|
43
|
+
|
|
44
|
+
包内 proxy 会将 `.md` 和 `.mdx` 请求路由到返回 Markdown 的 route handler:
|
|
45
|
+
|
|
46
|
+
```ts title="proxy.ts"
|
|
47
|
+
const proxy = createProxy({
|
|
48
|
+
config: geistdocsConfig,
|
|
49
|
+
markdownRoutes: [
|
|
50
|
+
{ from: "/docs/*path", to: "/[lang]/llms.mdx/*path" },
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
目标 route 使用 `createDocsMarkdownRoute` 处理页面,并以 `text/markdown` 内容类型返回 Markdown。
|
|
56
|
+
|
|
57
|
+
## 响应格式
|
|
58
|
+
|
|
59
|
+
响应包含:
|
|
60
|
+
|
|
61
|
+
- Content-Type: `text/markdown`
|
|
62
|
+
- 页面标题作为一级标题
|
|
63
|
+
- 来自 Fumadocs 的处理后 Markdown 内容
|
|
64
|
+
|
|
65
|
+
所有 MDX 组件都会被处理并转换为等效的纯 Markdown。
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: .md Extension
|
|
3
|
+
description: Access documentation pages as raw Markdown by appending .md or .mdx to any URL
|
|
4
|
+
type: conceptual
|
|
5
|
+
summary: Access any documentation page as raw Markdown by appending .md or .mdx to the URL for AI tool consumption.
|
|
6
|
+
related:
|
|
7
|
+
- /docs/agent-readiness
|
|
8
|
+
- /docs/llms-txt
|
|
9
|
+
- /docs/proxy
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Geistdocs lets AI tools and language models access documentation pages as plain Markdown. Append `.md` or `.mdx` to a documentation URL to get the processed Markdown content for that page.
|
|
13
|
+
|
|
14
|
+
<CopyPrompt text="Help me test raw Markdown routes in this Geistdocs project. Fetch a docs page with .mdx appended, compare it to the rendered page, and explain how AI tools can use it.">
|
|
15
|
+
Help me test raw Markdown routes in this Geistdocs project. Fetch a docs page with `.mdx` appended, compare it to the rendered page, and explain how AI tools can use it.
|
|
16
|
+
</CopyPrompt>
|
|
17
|
+
|
|
18
|
+
## How it works
|
|
19
|
+
|
|
20
|
+
When you add `.md` or `.mdx` to a documentation URL, Geistdocs returns the page content as Markdown instead of rendered HTML. AI tools can use that response as focused context for one page.
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
# Normal page
|
|
26
|
+
https://yourdomain.com/docs/getting-started
|
|
27
|
+
|
|
28
|
+
# Markdown version
|
|
29
|
+
https://yourdomain.com/docs/getting-started.mdx
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The `.mdx` version returns:
|
|
33
|
+
|
|
34
|
+
- The page title as an H1 heading
|
|
35
|
+
- The full processed Markdown content
|
|
36
|
+
- No HTML, styling, or navigation
|
|
37
|
+
|
|
38
|
+
## Use cases
|
|
39
|
+
|
|
40
|
+
This feature is particularly useful for:
|
|
41
|
+
|
|
42
|
+
- **AI Chat Tools** - Tools like ChatGPT, Claude, and Cursor can fetch and read your docs
|
|
43
|
+
- **LLM Context** - Provides clean text for language model prompts
|
|
44
|
+
- **Documentation Analysis** - Extract content for processing or analysis
|
|
45
|
+
- **Content Migration** - Export documentation in a clean format
|
|
46
|
+
|
|
47
|
+
## Implementation
|
|
48
|
+
|
|
49
|
+
The package proxy routes `.md` and `.mdx` requests to the package-backed markdown route handler:
|
|
50
|
+
|
|
51
|
+
```ts title="proxy.ts"
|
|
52
|
+
const proxy = createProxy({
|
|
53
|
+
config: geistdocsConfig,
|
|
54
|
+
markdownRoutes: [
|
|
55
|
+
{ from: "/docs/*path", to: "/[lang]/llms.mdx/*path" },
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The destination route uses `createDocsMarkdownRoute` to process the page and return Markdown with a `text/markdown` content type:
|
|
61
|
+
|
|
62
|
+
```ts title="app/[lang]/llms.mdx/[[...slug]]/route.ts"
|
|
63
|
+
import { createDocsMarkdownRoute } from "@vercel/geistdocs/routes/llms";
|
|
64
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
65
|
+
|
|
66
|
+
export const { GET, generateStaticParams, revalidate } =
|
|
67
|
+
createDocsMarkdownRoute({
|
|
68
|
+
sources: [geistdocsSource],
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Read [Proxy and markdown routes](/docs/proxy) to configure additional route families such as `/cookbook` or `/v5/docs`.
|
|
73
|
+
|
|
74
|
+
## Response Format
|
|
75
|
+
|
|
76
|
+
The response includes:
|
|
77
|
+
|
|
78
|
+
- Content-Type: `text/markdown`
|
|
79
|
+
- The page title as a level 1 heading
|
|
80
|
+
- Processed Markdown content from Fumadocs
|
|
81
|
+
|
|
82
|
+
All MDX components are processed and converted to plain Markdown equivalents.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Geistdocs Documentation",
|
|
3
|
+
"description": "Learn how to use and customize Geistdocs",
|
|
4
|
+
"root": true,
|
|
5
|
+
"pages": [
|
|
6
|
+
"index",
|
|
7
|
+
"getting-started",
|
|
8
|
+
"env",
|
|
9
|
+
"deployment",
|
|
10
|
+
"migration",
|
|
11
|
+
"configuration",
|
|
12
|
+
"---Internals---",
|
|
13
|
+
"syntax",
|
|
14
|
+
"provider",
|
|
15
|
+
"versioned-docs",
|
|
16
|
+
"proxy",
|
|
17
|
+
"---Features---",
|
|
18
|
+
"...",
|
|
19
|
+
"---AI---",
|
|
20
|
+
"open-in-chat",
|
|
21
|
+
"agent-readiness",
|
|
22
|
+
"llms-txt",
|
|
23
|
+
"ask-ai"
|
|
24
|
+
]
|
|
25
|
+
}
|