@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,321 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Migration guide
|
|
3
|
+
description: Migrate a Fumadocs or custom Geist docs site to package-backed Geistdocs
|
|
4
|
+
type: guide
|
|
5
|
+
summary: Move an existing documentation site to @vercel/geistdocs while keeping local content, routing, middleware behavior, and AI-readable surfaces intact.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/configuration
|
|
8
|
+
- /docs/proxy
|
|
9
|
+
related:
|
|
10
|
+
- /docs/versioned-docs
|
|
11
|
+
- /docs/llms-txt
|
|
12
|
+
- /docs/agent-readiness
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Migrate an existing Fumadocs or custom Geist documentation site to `@vercel/geistdocs` by moving shared behavior into package APIs and keeping site-specific adapters local. The safest migration keeps content, routing decisions, and product-specific UI in your app while replacing copied runtime code with thin package-backed adapters.
|
|
16
|
+
|
|
17
|
+
<CopyPrompt text="Help me migrate this existing docs site to package-backed Geistdocs. Inspect source.config.ts, lib/geistdocs/source.ts, app route files, proxy.ts or middleware.ts, public/llms.txt, Open Graph routes, Tailwind CSS setup, and environment variables. Then produce a step-by-step migration plan using @vercel/geistdocs package APIs without copying package internals.">
|
|
18
|
+
Help me migrate this existing docs site to package-backed Geistdocs. Inspect `source.config.ts`, `lib/geistdocs/source.ts`, app route files, `proxy.ts` or `middleware.ts`, `public/llms.txt`, Open Graph routes, Tailwind CSS setup, and environment variables. Then produce a step-by-step migration plan using `@vercel/geistdocs` package APIs without copying package internals.
|
|
19
|
+
</CopyPrompt>
|
|
20
|
+
|
|
21
|
+
## Before you migrate
|
|
22
|
+
|
|
23
|
+
Create a working branch and inventory the current site before replacing code:
|
|
24
|
+
|
|
25
|
+
- Existing Fumadocs collections in `source.config.ts`.
|
|
26
|
+
- Public route families, such as `/docs`, `/api-reference`, `/guides`, or `/`.
|
|
27
|
+
- Existing `middleware.ts` or `proxy.ts` behavior.
|
|
28
|
+
- Static files that overlap package routes, such as `public/llms.txt`.
|
|
29
|
+
- Search, chat, `llms.txt`, page-level Markdown, `sitemap.md`, `agents.md`, RSS, and Open Graph routes.
|
|
30
|
+
- Tailwind CSS version and custom plugins.
|
|
31
|
+
- Environment variables required by the homepage, docs routes, or API routes.
|
|
32
|
+
|
|
33
|
+
Run the current project before changing it:
|
|
34
|
+
|
|
35
|
+
```bash title="Terminal"
|
|
36
|
+
pnpm install
|
|
37
|
+
pnpm build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Fix unrelated build failures first. A migration is safer when the starting point is reproducible.
|
|
41
|
+
|
|
42
|
+
## Install Geistdocs
|
|
43
|
+
|
|
44
|
+
Add `@vercel/geistdocs` and align the supported Fumadocs and Next.js dependencies for the package version you are adopting.
|
|
45
|
+
|
|
46
|
+
For an existing project, use your package manager directly:
|
|
47
|
+
|
|
48
|
+
```bash title="Terminal"
|
|
49
|
+
pnpm add @vercel/geistdocs
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If you are starting from a generated Geistdocs project and moving content into it, use the CLI:
|
|
53
|
+
|
|
54
|
+
```bash title="Terminal"
|
|
55
|
+
pnpm dlx @vercel/geistdocs init --name my-docs
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Update source config
|
|
59
|
+
|
|
60
|
+
Use the source-config-safe export from `@vercel/geistdocs/source-config` in `source.config.ts`. This file is evaluated by `fumadocs-mdx` during dependency installation and builds, so avoid importing runtime component entry points from it.
|
|
61
|
+
|
|
62
|
+
```ts title="source.config.ts"
|
|
63
|
+
import {
|
|
64
|
+
defineGeistdocsSourceConfig,
|
|
65
|
+
geistdocsFrontmatterSchema,
|
|
66
|
+
geistdocsMetaSchema,
|
|
67
|
+
} from "@vercel/geistdocs/source-config";
|
|
68
|
+
import { defineDocs } from "fumadocs-mdx/config";
|
|
69
|
+
|
|
70
|
+
export const docs = defineDocs({
|
|
71
|
+
dir: "content/docs",
|
|
72
|
+
docs: {
|
|
73
|
+
schema: geistdocsFrontmatterSchema,
|
|
74
|
+
postprocess: {
|
|
75
|
+
includeProcessedMarkdown: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
meta: {
|
|
79
|
+
schema: geistdocsMetaSchema,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export default defineGeistdocsSourceConfig();
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For multiple docs families, create one collection per directory and reuse `geistdocsFrontmatterSchema`.
|
|
87
|
+
|
|
88
|
+
## Create the package config
|
|
89
|
+
|
|
90
|
+
Use `@vercel/geistdocs/config` to centralize site metadata and route families in `lib/geistdocs/config.tsx`.
|
|
91
|
+
|
|
92
|
+
```tsx title="lib/geistdocs/config.tsx"
|
|
93
|
+
import { defineConfig } from "@vercel/geistdocs/config";
|
|
94
|
+
import { Logo, github, nav, prompt, suggestions, title } from "@/geistdocs";
|
|
95
|
+
|
|
96
|
+
export const config = defineConfig({
|
|
97
|
+
title,
|
|
98
|
+
defaultLanguage: "en",
|
|
99
|
+
logo: <Logo />,
|
|
100
|
+
github,
|
|
101
|
+
nav,
|
|
102
|
+
content: [{ id: "docs", label: "Docs", dir: "content/docs", route: "/docs" }],
|
|
103
|
+
ai: {
|
|
104
|
+
prompt,
|
|
105
|
+
suggestions,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Set `content` to every public documentation route family. `createProxy` uses this metadata to infer standard Markdown mappings for non-root sections.
|
|
111
|
+
|
|
112
|
+
## Connect Fumadocs sources
|
|
113
|
+
|
|
114
|
+
Wrap each Fumadocs collection with `createSource` in `lib/geistdocs/source.ts`.
|
|
115
|
+
|
|
116
|
+
```ts title="lib/geistdocs/source.ts"
|
|
117
|
+
import { createSource } from "@vercel/geistdocs/source";
|
|
118
|
+
import { docs } from "@/.source/server";
|
|
119
|
+
import { config } from "./config";
|
|
120
|
+
|
|
121
|
+
export const geistdocsSource = createSource({
|
|
122
|
+
docs,
|
|
123
|
+
config,
|
|
124
|
+
id: "docs",
|
|
125
|
+
label: "Docs",
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export const source = geistdocsSource.source;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For root-mounted docs, set `baseUrl: "/"` and use explicit `markdownRoutes` in `proxy.ts`:
|
|
132
|
+
|
|
133
|
+
```ts title="lib/geistdocs/source.ts"
|
|
134
|
+
export const geistdocsSource = createSource({
|
|
135
|
+
docs,
|
|
136
|
+
config,
|
|
137
|
+
baseUrl: "/",
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Add route adapters
|
|
142
|
+
|
|
143
|
+
Keep App Router files thin. Route files should call package helpers instead of copying package internals.
|
|
144
|
+
|
|
145
|
+
```tsx title="app/[lang]/docs/[[...slug]]/page.tsx"
|
|
146
|
+
import { createDocsPage } from "@vercel/geistdocs/pages/docs";
|
|
147
|
+
import { config } from "@/lib/geistdocs/config";
|
|
148
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
149
|
+
|
|
150
|
+
const docsPage = createDocsPage({
|
|
151
|
+
config,
|
|
152
|
+
source: geistdocsSource,
|
|
153
|
+
openGraph: {
|
|
154
|
+
images: true,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export default docsPage.Page;
|
|
159
|
+
export const generateStaticParams = docsPage.generateStaticParams;
|
|
160
|
+
export const generateMetadata = docsPage.generateMetadata;
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Set `openGraph.images` to `true` only when your app includes the Geistdocs OG route. If you do not add the OG route, omit `openGraph` or override metadata to avoid broken `/og/...` references.
|
|
164
|
+
|
|
165
|
+
## Add AI-readable routes
|
|
166
|
+
|
|
167
|
+
Add the package route helpers for machine-readable docs surfaces.
|
|
168
|
+
|
|
169
|
+
```ts title="app/[lang]/llms.txt/route.ts"
|
|
170
|
+
import { createLlmsRoute } from "@vercel/geistdocs/routes/llms";
|
|
171
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
172
|
+
|
|
173
|
+
export const { GET, revalidate } = createLlmsRoute({
|
|
174
|
+
sources: [geistdocsSource],
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```ts title="app/[lang]/llms.mdx/[[...slug]]/route.ts"
|
|
179
|
+
import { createDocsMarkdownRoute } from "@vercel/geistdocs/routes/llms";
|
|
180
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
181
|
+
|
|
182
|
+
export const { GET, generateStaticParams, revalidate } =
|
|
183
|
+
createDocsMarkdownRoute({
|
|
184
|
+
source: geistdocsSource,
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```ts title="app/[lang]/sitemap.md/route.ts"
|
|
189
|
+
import { createSitemapMarkdownRoute } from "@vercel/geistdocs/routes/sitemap";
|
|
190
|
+
import { config } from "@/lib/geistdocs/config";
|
|
191
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
192
|
+
|
|
193
|
+
export const { GET, generateStaticParams, revalidate, dynamic } =
|
|
194
|
+
createSitemapMarkdownRoute({
|
|
195
|
+
config,
|
|
196
|
+
sources: [{ source: geistdocsSource.source }],
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```ts title="app/[lang]/agents.md/route.ts"
|
|
201
|
+
import { createAgentsRoute } from "@vercel/geistdocs/routes/agents";
|
|
202
|
+
import { config } from "@/lib/geistdocs/config";
|
|
203
|
+
|
|
204
|
+
export const { GET, generateStaticParams, revalidate } = createAgentsRoute({
|
|
205
|
+
config,
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Delete `public/llms.txt` after adding `createLlmsRoute`. Static files in `public` can mask App Router route behavior.
|
|
210
|
+
|
|
211
|
+
## Migrate middleware behavior
|
|
212
|
+
|
|
213
|
+
Use `createProxy` in `proxy.ts`. Put existing `middleware.ts` behavior in `before` or `after` hooks instead of replacing Geistdocs markdown negotiation.
|
|
214
|
+
|
|
215
|
+
```ts title="proxy.ts"
|
|
216
|
+
import { createProxy } from "@vercel/geistdocs/proxy";
|
|
217
|
+
import { NextResponse } from "next/server";
|
|
218
|
+
import { config as geistdocsConfig } from "@/lib/geistdocs/config";
|
|
219
|
+
|
|
220
|
+
const proxy = createProxy({
|
|
221
|
+
config: geistdocsConfig,
|
|
222
|
+
before: async ({ request }) => {
|
|
223
|
+
if (request.nextUrl.pathname === "/legacy-docs") {
|
|
224
|
+
return NextResponse.redirect(new URL("/docs", request.url));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return null;
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
export const config = {
|
|
232
|
+
matcher: [
|
|
233
|
+
"/((?!api(?:/|$)|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)",
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export default proxy;
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Use `api(?:/|$)` in the matcher. A broad `api` exclusion also excludes routes such as `/api-reference`.
|
|
241
|
+
|
|
242
|
+
## Configure Markdown route mappings
|
|
243
|
+
|
|
244
|
+
For standard non-root sections, `createProxy` can infer Markdown routes from `config.content`.
|
|
245
|
+
|
|
246
|
+
Use explicit `markdownRoutes` when the public docs URL does not map directly to the Markdown route handler:
|
|
247
|
+
|
|
248
|
+
```ts title="proxy.ts"
|
|
249
|
+
const proxy = createProxy({
|
|
250
|
+
config: geistdocsConfig,
|
|
251
|
+
markdownRoutes: [
|
|
252
|
+
{ from: "/docs/*path", to: "/[lang]/llms.mdx/*path" },
|
|
253
|
+
{ from: "/api-reference/*path", to: "/[lang]/llms.mdx/api-reference/*path" },
|
|
254
|
+
],
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Root-mounted docs need explicit mappings. If a homepage or app routes also live at `/`, do not use a broad `/*path` mapping. Map each docs family separately:
|
|
259
|
+
|
|
260
|
+
```ts title="proxy.ts"
|
|
261
|
+
const proxy = createProxy({
|
|
262
|
+
config: geistdocsConfig,
|
|
263
|
+
markdownRoutes: [
|
|
264
|
+
{ from: "/guides/*path", to: "/[lang]/llms.mdx/guides/*path" },
|
|
265
|
+
{ from: "/api-reference/*path", to: "/[lang]/llms.mdx/api-reference/*path" },
|
|
266
|
+
],
|
|
267
|
+
});
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Configure Tailwind CSS
|
|
271
|
+
|
|
272
|
+
Tailwind CSS v4 requires `@source` entries for package components and related dependencies.
|
|
273
|
+
|
|
274
|
+
```css title="app/styles/geistdocs.css"
|
|
275
|
+
@import "tailwindcss";
|
|
276
|
+
@import "fumadocs-ui/css/shadcn.css";
|
|
277
|
+
@import "fumadocs-ui/css/preset.css";
|
|
278
|
+
@import "tw-animate-css";
|
|
279
|
+
|
|
280
|
+
@source "../../node_modules/@vercel/geistdocs/dist/**/*.js";
|
|
281
|
+
@source "../../node_modules/streamdown/dist/*.js";
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Move Tailwind CSS v3 plugin utilities into CSS-first v4 utilities or theme variables. Keep custom token names stable while you migrate components.
|
|
285
|
+
|
|
286
|
+
## Handle environment variables
|
|
287
|
+
|
|
288
|
+
Do not require production secrets for local migration builds. If a homepage or API route depends on a production-only secret, add a local fallback or disable that integration in development.
|
|
289
|
+
|
|
290
|
+
```ts title="lib/example-secret.ts"
|
|
291
|
+
export const flagsSecret =
|
|
292
|
+
process.env.FLAGS_SECRET ??
|
|
293
|
+
(process.env.NODE_ENV === "development" ? "local-development-secret" : undefined);
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Keep real secrets in `.env.local` and out of Git.
|
|
297
|
+
|
|
298
|
+
## Verify the migration
|
|
299
|
+
|
|
300
|
+
Run the same checks after each routing or source change:
|
|
301
|
+
|
|
302
|
+
```bash title="Terminal"
|
|
303
|
+
pnpm postinstall
|
|
304
|
+
pnpm build
|
|
305
|
+
pnpm dev
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Check these URLs locally:
|
|
309
|
+
|
|
310
|
+
- `/docs` or the migrated docs root.
|
|
311
|
+
- `/llms.txt`.
|
|
312
|
+
- `/sitemap.md`.
|
|
313
|
+
- `/agents.md`.
|
|
314
|
+
- A page-level Markdown URL such as `/docs/getting-started.mdx`.
|
|
315
|
+
- A non-docs route that should not be rewritten as Markdown, such as the homepage.
|
|
316
|
+
|
|
317
|
+
## Next steps
|
|
318
|
+
|
|
319
|
+
- Read [Configuration](/docs/configuration) to review package config options.
|
|
320
|
+
- Read [Proxy and markdown routes](/docs/proxy) to tune request handling.
|
|
321
|
+
- Read [Agent readiness](/docs/agent-readiness) to configure `/agents.md` for AI agents.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在聊天中打开
|
|
3
|
+
description: 允许用户通过一次点击在其偏好的 AI 聊天平台中继续对话
|
|
4
|
+
type: conceptual
|
|
5
|
+
summary: 一键将文档上下文传输到 ChatGPT、Claude、Cursor 和 v0 等 AI 聊天平台。
|
|
6
|
+
related:
|
|
7
|
+
- /docs/ask-ai
|
|
8
|
+
- /docs/env
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
"The "Open in Chat" feature enables users to seamlessly transfer documentation context to their preferred AI assistant. With a single click, users can open the current page in external AI chat platforms like ChatGPT, Claude, v0, Cursor, and more."
|
|
12
|
+
|
|
13
|
+
## 如何工作
|
|
14
|
+
|
|
15
|
+
在每个文档页面的目录侧边栏中,用户会看到一个 **在聊天中打开** 按钮。点击后,会出现一个菜单,列出可将页面在各类 AI 平台中打开的选项:
|
|
16
|
+
|
|
17
|
+
1. 用户点击 **在聊天中打开**
|
|
18
|
+
2. 下拉菜单显示可用平台
|
|
19
|
+
3. 用户选择其偏好的 AI 助手
|
|
20
|
+
4. 平台以预填充的提示打开,提示包含页面 URL 和上下文
|
|
21
|
+
|
|
22
|
+
该提示会自动包含:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Read this page, I want to ask questions about it. [URL]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
这允许 AI 助手在回答用户问题之前获取并理解页面内容。
|
|
29
|
+
|
|
30
|
+
## 支持的平台
|
|
31
|
+
|
|
32
|
+
该功能与多个流行的 AI 平台集成:
|
|
33
|
+
|
|
34
|
+
### 代码与开发工具
|
|
35
|
+
|
|
36
|
+
- **[Cursor](https://cursor.sh/)** - AI 驱动的代码编辑器
|
|
37
|
+
- **[v0](https://v0.dev/)** - Vercel 的 AI 界面设计工具
|
|
38
|
+
|
|
39
|
+
### 通用 AI 助手
|
|
40
|
+
|
|
41
|
+
- **[ChatGPT](https://chat.openai.com/)** - OpenAI 的对话式 AI
|
|
42
|
+
- **[Claude](https://claude.ai/)** - Anthropic 的 AI 助手
|
|
43
|
+
- **[T3](https://t3.gg/)** - T3 Stack 的 AI 助手
|
|
44
|
+
- **[Scira](https://scira.app/)** - AI 驱动的文档助手
|
|
45
|
+
|
|
46
|
+
## 配置
|
|
47
|
+
|
|
48
|
+
必须设置环境变量 `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL`,有关详细信息,请参阅 [环境变量](/docs/env) 一节。
|
|
49
|
+
|
|
50
|
+
## 用户体验
|
|
51
|
+
|
|
52
|
+
### 桌面体验
|
|
53
|
+
|
|
54
|
+
**在聊天中打开** 按钮出现在目录侧边栏中,带有外部链接图标。点击该按钮会显示包含所有可用平台的下拉菜单。
|
|
55
|
+
|
|
56
|
+
### 平台特定行为
|
|
57
|
+
|
|
58
|
+
每个平台有其各自的集成方式:
|
|
59
|
+
|
|
60
|
+
- **基于浏览器的平台**(ChatGPT、Claude、v0):在新浏览器标签页中打开,并预填充提示
|
|
61
|
+
- **桌面应用**(Cursor):使用自定义 URL 方案打开以启动该应用
|
|
62
|
+
- **专业工具**(T3、Scira):使用平台特定的参数和上下文打开
|
|
63
|
+
|
|
64
|
+
## 优势
|
|
65
|
+
|
|
66
|
+
### 对于用户
|
|
67
|
+
|
|
68
|
+
1. **无缝工作流程** - 无需手动复制 URL 或切换上下文
|
|
69
|
+
2. **一致的体验** - 无论偏好的 AI 平台如何,都有相同的起点
|
|
70
|
+
3. **节省时间** - 通过适当的上下文即时获取 AI 助手的帮助
|
|
71
|
+
4. **工具选择自由** - 使用他们最熟悉的 AI 平台
|
|
72
|
+
|
|
73
|
+
### 对于文档作者
|
|
74
|
+
|
|
75
|
+
1. **增强支持** - 用户可以获得超出文档内容的帮助
|
|
76
|
+
2. **减轻支持负担** - AI 助手可以处理常见问题
|
|
77
|
+
3. **更好的用户参与度** - 用户可以更深入地探索主题
|
|
78
|
+
4. **平台灵活性** - 支持用户多样的 AI 偏好
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Open in Chat
|
|
3
|
+
description: Allow users to continue conversations in their preferred AI chat platform with a single click
|
|
4
|
+
type: conceptual
|
|
5
|
+
summary: Transfer documentation context to AI chat platforms like ChatGPT, Claude, Cursor, and v0 with a single click.
|
|
6
|
+
related:
|
|
7
|
+
- /docs/ask-ai
|
|
8
|
+
- /docs/env
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
The "Open in Chat" feature enables users to seamlessly transfer documentation context to their preferred AI assistant. With a single click, users can open the current page in external AI chat platforms like ChatGPT, Claude, v0, Cursor, and more.
|
|
12
|
+
|
|
13
|
+
<CopyPrompt text="Help me test Open in Chat for this Geistdocs site. Verify that page URLs resolve correctly, markdown endpoints work, and each configured AI platform receives useful context.">
|
|
14
|
+
Help me test Open in Chat for this Geistdocs site. Verify that page URLs resolve correctly, markdown endpoints work, and each configured AI platform receives useful context.
|
|
15
|
+
</CopyPrompt>
|
|
16
|
+
|
|
17
|
+
## How it works
|
|
18
|
+
|
|
19
|
+
On every documentation page, users will find an "Open in chat" button in the table of contents sidebar. When clicked, a menu appears with options to open the page in various AI platforms:
|
|
20
|
+
|
|
21
|
+
1. User clicks "Open in chat"
|
|
22
|
+
2. A dropdown menu shows available platforms
|
|
23
|
+
3. User selects their preferred AI assistant
|
|
24
|
+
4. The platform opens with a pre-filled prompt containing the page URL and context
|
|
25
|
+
|
|
26
|
+
The prompt automatically includes:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Read this page, I want to ask questions about it. [URL]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This allows the AI assistant to fetch and understand the page content before answering user questions.
|
|
33
|
+
|
|
34
|
+
## Supported Platforms
|
|
35
|
+
|
|
36
|
+
The feature integrates with multiple popular AI platforms:
|
|
37
|
+
|
|
38
|
+
### Code & Development Tools
|
|
39
|
+
|
|
40
|
+
- **[Cursor](https://cursor.sh/)** - AI-powered code editor
|
|
41
|
+
- **[v0](https://v0.dev/)** - Vercel's AI interface design tool
|
|
42
|
+
|
|
43
|
+
### General AI Assistants
|
|
44
|
+
|
|
45
|
+
- **[ChatGPT](https://chat.openai.com/)** - OpenAI's conversational AI
|
|
46
|
+
- **[Claude](https://claude.ai/)** - Anthropic's AI assistant
|
|
47
|
+
- **[T3](https://t3.gg/)** - T3 Stack AI assistant
|
|
48
|
+
- **[Scira](https://scira.app/)** - AI-powered documentation assistant
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
The environment variable `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` must be set, which you can read more about in the [Environment Variables](/docs/env) section.
|
|
53
|
+
|
|
54
|
+
## User Experience
|
|
55
|
+
|
|
56
|
+
### Desktop Experience
|
|
57
|
+
|
|
58
|
+
The "Open in chat" button appears in the table of contents sidebar with an external link icon. Clicking it reveals a dropdown menu with all available platforms.
|
|
59
|
+
|
|
60
|
+
### Platform-Specific Behavior
|
|
61
|
+
|
|
62
|
+
Each platform has its own integration:
|
|
63
|
+
|
|
64
|
+
- **Browser-based platforms** (ChatGPT, Claude, v0): Open in a new browser tab with the prompt pre-filled
|
|
65
|
+
- **Desktop applications** (Cursor): Open using a custom URL scheme that launches the application
|
|
66
|
+
- **Specialized tools** (T3, Scira): Open with platform-specific parameters and context
|
|
67
|
+
|
|
68
|
+
## Outcomes
|
|
69
|
+
|
|
70
|
+
### For Users
|
|
71
|
+
|
|
72
|
+
1. **Context transfer**: Users do not need to manually copy URLs or switch contexts.
|
|
73
|
+
2. **Consistent starting point**: Each AI platform receives the same page context.
|
|
74
|
+
3. **Tool choice**: Users can open the AI platform they prefer.
|
|
75
|
+
|
|
76
|
+
### For Documentation Authors
|
|
77
|
+
|
|
78
|
+
1. **More support paths**: Users can ask follow-up questions about a page.
|
|
79
|
+
2. **Lower support load**: AI assistants can answer common documentation questions.
|
|
80
|
+
3. **Platform flexibility**: Teams can support different AI preferences.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Geistdocs 提供者
|
|
3
|
+
description: 处理通知、搜索和分析的根提供者组件
|
|
4
|
+
type: reference
|
|
5
|
+
summary: 包裹应用程序的根提供者组件,处理通知提示、搜索和分析功能。
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/configuration
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
`GeistdocsProvider` 位于应用根部,负责连接主题、搜索、AI chat、通知和可选分析功能。
|
|
13
|
+
|
|
14
|
+
## 它的作用
|
|
15
|
+
|
|
16
|
+
该提供者为您处理以下主要事项:
|
|
17
|
+
|
|
18
|
+
1. **Toast 通知**:提供全局通知系统,用于向用户反馈。
|
|
19
|
+
2. **分析**:当本地 adapter 引入 Vercel Analytics 和 Speed Insights 时,将它们连接到站点。
|
|
20
|
+
3. **搜索**:配置搜索对话框并连接到搜索 API。
|
|
21
|
+
4. **Ask AI**:提供 chat 侧边栏和页面操作所需的客户端状态。
|
|
22
|
+
|
|
23
|
+
## 用法
|
|
24
|
+
|
|
25
|
+
确保在根布局中使用该提供者包裹您的应用:
|
|
26
|
+
|
|
27
|
+
```tsx title="app/layout.tsx"
|
|
28
|
+
import { GeistdocsProvider } from "@/components/geistdocs/provider";
|
|
29
|
+
|
|
30
|
+
const Layout = ({ children }: LayoutProps) => (
|
|
31
|
+
<html lang="en">
|
|
32
|
+
<body>
|
|
33
|
+
<GeistdocsProvider>
|
|
34
|
+
<Navbar />
|
|
35
|
+
{children}
|
|
36
|
+
</GeistdocsProvider>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
就这些。提供者会自动处理所有事项。
|
|
43
|
+
|
|
44
|
+
## AI 侧边栏
|
|
45
|
+
|
|
46
|
+
当用户在桌面端打开 AI 聊天时,提供者会自动添加内边距,以防止内容被侧边栏遮挡。在移动端,聊天会以抽屉的形式打开,因此无需内边距。
|
|
47
|
+
|
|
48
|
+
您无需执行任何操作 —— 提供者会自动检测屏幕尺寸和聊天状态。
|
|
49
|
+
|
|
50
|
+
## Toast 通知
|
|
51
|
+
|
|
52
|
+
该提供者包含一个全局的 toast 通知系统。可在应用的任何位置使用:
|
|
53
|
+
|
|
54
|
+
```tsx title="page.tsx"
|
|
55
|
+
import { toast } from "sonner";
|
|
56
|
+
|
|
57
|
+
toast.success("Changes saved");
|
|
58
|
+
toast.error("Something went wrong");
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 分析
|
|
62
|
+
|
|
63
|
+
自动包含 Vercel Analytics,并跟踪:
|
|
64
|
+
|
|
65
|
+
- 页面浏览
|
|
66
|
+
- Web Vitals
|
|
67
|
+
- 用户交互
|
|
68
|
+
- 性能指标
|
|
69
|
+
|
|
70
|
+
无需配置 —— 部署到 Vercel 后会自动生效。
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Geistdocs Provider
|
|
3
|
+
description: The root provider component that handles notifications, search and analytics
|
|
4
|
+
type: reference
|
|
5
|
+
summary: The root provider component that wraps your application to handle toast notifications, search, and analytics.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/configuration
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
The `GeistdocsProvider` wraps the root of your application with package-managed UI state. It connects theme, search, AI chat, notifications, and optional analytics to the rest of your Geistdocs site.
|
|
13
|
+
|
|
14
|
+
<CopyPrompt text="Review my Geistdocs provider setup. Check that the root layout wraps the app with GeistdocsProvider, that config is passed correctly, and that analytics, search, theme, and Ask AI behavior are wired safely.">
|
|
15
|
+
Review my Geistdocs provider setup. Check that the root layout wraps the app with `GeistdocsProvider`, that config is passed correctly, and that analytics, search, theme, and Ask AI behavior are wired safely.
|
|
16
|
+
</CopyPrompt>
|
|
17
|
+
|
|
18
|
+
## What it does
|
|
19
|
+
|
|
20
|
+
The provider handles these behaviors:
|
|
21
|
+
|
|
22
|
+
1. **Toast notifications**: Provides a global notification system for user feedback.
|
|
23
|
+
2. **Analytics**: Integrates Vercel Analytics and Speed Insights when the local adapter includes them.
|
|
24
|
+
3. **Search**: Configures the search dialog and connects it to your search API.
|
|
25
|
+
4. **Ask AI**: Provides the client state used by the chat sidebar and page actions.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
Ensure your application is wrapped with the provider in your root layout:
|
|
30
|
+
|
|
31
|
+
```tsx title="app/layout.tsx"
|
|
32
|
+
import { GeistdocsProvider } from "@/components/geistdocs/provider";
|
|
33
|
+
|
|
34
|
+
const Layout = ({ children }: LayoutProps) => (
|
|
35
|
+
<html lang="en">
|
|
36
|
+
<body>
|
|
37
|
+
<GeistdocsProvider>
|
|
38
|
+
<Navbar />
|
|
39
|
+
{children}
|
|
40
|
+
</GeistdocsProvider>
|
|
41
|
+
</body>
|
|
42
|
+
</html>
|
|
43
|
+
);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The generated local adapter imports the package provider and passes your site config to it.
|
|
47
|
+
|
|
48
|
+
## AI Sidebar
|
|
49
|
+
|
|
50
|
+
When users open the AI chat on desktop, the provider automatically adds padding to prevent content from being hidden behind the sidebar. On mobile, the chat opens as a drawer instead, so no padding is needed.
|
|
51
|
+
|
|
52
|
+
The provider detects the screen size and chat state.
|
|
53
|
+
|
|
54
|
+
## Toast Notifications
|
|
55
|
+
|
|
56
|
+
The provider includes a global toast notification system. Use it anywhere in your app:
|
|
57
|
+
|
|
58
|
+
```tsx title="page.tsx"
|
|
59
|
+
import { toast } from "sonner";
|
|
60
|
+
|
|
61
|
+
toast.success("Changes saved");
|
|
62
|
+
toast.error("Something went wrong");
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Analytics
|
|
66
|
+
|
|
67
|
+
Vercel Analytics is automatically included and tracks:
|
|
68
|
+
|
|
69
|
+
- Page views
|
|
70
|
+
- Web Vitals
|
|
71
|
+
- User interactions
|
|
72
|
+
- Performance metrics
|
|
73
|
+
|
|
74
|
+
No configuration needed - it works automatically when deployed on Vercel.
|