@vercel/geistdocs 1.2.2 → 1.2.3-canary.a12a9c6

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.
Files changed (357) hide show
  1. package/dist/assets/icons/icon-arrow-up-right-small.d.ts +8 -0
  2. package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +1 -0
  3. package/dist/assets/icons/icon-arrow-up-right-small.js +4 -0
  4. package/dist/assets/icons/icon-arrow-up-right.d.ts +5 -0
  5. package/dist/assets/icons/icon-arrow-up-right.d.ts.map +1 -0
  6. package/dist/assets/icons/icon-arrow-up-right.js +4 -0
  7. package/dist/assets/icons/icon-check.d.ts +5 -0
  8. package/dist/assets/icons/icon-check.d.ts.map +1 -0
  9. package/dist/assets/icons/icon-check.js +4 -0
  10. package/dist/assets/icons/icon-chevron-down-small.d.ts +8 -0
  11. package/dist/assets/icons/icon-chevron-down-small.d.ts.map +1 -0
  12. package/dist/assets/icons/icon-chevron-down-small.js +7 -0
  13. package/dist/assets/icons/icon-chevron-right.d.ts +5 -0
  14. package/dist/assets/icons/icon-chevron-right.d.ts.map +1 -0
  15. package/dist/assets/icons/icon-chevron-right.js +4 -0
  16. package/dist/assets/icons/icon-copy.d.ts +5 -0
  17. package/dist/assets/icons/icon-copy.d.ts.map +1 -0
  18. package/dist/assets/icons/icon-copy.js +4 -0
  19. package/dist/assets/icons/icon-file-text.d.ts +5 -0
  20. package/dist/assets/icons/icon-file-text.d.ts.map +1 -0
  21. package/dist/assets/icons/icon-file-text.js +4 -0
  22. package/dist/assets/icons/icon-menu-alt.d.ts +5 -0
  23. package/dist/assets/icons/icon-menu-alt.d.ts.map +1 -0
  24. package/dist/assets/icons/icon-menu-alt.js +4 -0
  25. package/dist/assets/icons/icon-slash-forward.d.ts +8 -0
  26. package/dist/assets/icons/icon-slash-forward.d.ts.map +1 -0
  27. package/dist/assets/icons/icon-slash-forward.js +4 -0
  28. package/dist/assets/icons/index.d.ts +10 -0
  29. package/dist/assets/icons/index.d.ts.map +1 -0
  30. package/dist/assets/icons/index.js +10 -0
  31. package/dist/assets/logos/index.d.ts +13 -0
  32. package/dist/assets/logos/index.d.ts.map +1 -0
  33. package/dist/assets/logos/index.js +13 -0
  34. package/dist/assets/logos/logo-ai-elements.d.ts +8 -0
  35. package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -0
  36. package/dist/assets/logos/logo-ai-elements.js +8 -0
  37. package/dist/assets/logos/logo-ai-sdk.d.ts +8 -0
  38. package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -0
  39. package/dist/assets/logos/logo-ai-sdk.js +8 -0
  40. package/dist/assets/logos/logo-chat-sdk.d.ts +8 -0
  41. package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -0
  42. package/dist/assets/logos/logo-chat-sdk.js +8 -0
  43. package/dist/assets/logos/logo-flags-sdk.d.ts +8 -0
  44. package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -0
  45. package/dist/assets/logos/logo-flags-sdk.js +8 -0
  46. package/dist/assets/logos/logo-icon-vercel.d.ts +9 -0
  47. package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -0
  48. package/dist/assets/logos/logo-icon-vercel.js +8 -0
  49. package/dist/assets/logos/logo-streamdown.d.ts +8 -0
  50. package/dist/assets/logos/logo-streamdown.d.ts.map +1 -0
  51. package/dist/assets/logos/logo-streamdown.js +8 -0
  52. package/dist/assets/logos/logo-vercel-oss.d.ts +8 -0
  53. package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -0
  54. package/dist/assets/logos/logo-vercel-oss.js +7 -0
  55. package/dist/assets/logos/logo-workflow-sdk.d.ts +8 -0
  56. package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -0
  57. package/dist/assets/logos/logo-workflow-sdk.js +8 -0
  58. package/dist/cli/index.js +3 -0
  59. package/dist/components/callout.d.ts +12 -0
  60. package/dist/components/callout.d.ts.map +1 -0
  61. package/dist/components/callout.js +7 -0
  62. package/dist/components/code-block-tabs.d.ts +7 -0
  63. package/dist/components/code-block-tabs.d.ts.map +1 -0
  64. package/dist/components/code-block-tabs.js +7 -0
  65. package/dist/components/code-block.d.ts +14 -0
  66. package/dist/components/code-block.d.ts.map +1 -0
  67. package/dist/components/code-block.js +45 -0
  68. package/dist/components/copy-prompt.d.ts +11 -0
  69. package/dist/components/copy-prompt.d.ts.map +1 -0
  70. package/dist/components/copy-prompt.js +58 -0
  71. package/dist/components/mermaid.d.ts +4 -0
  72. package/dist/components/mermaid.d.ts.map +1 -0
  73. package/dist/components/mermaid.js +44 -0
  74. package/dist/components/theme-aware-image.d.ts +12 -0
  75. package/dist/components/theme-aware-image.d.ts.map +1 -0
  76. package/dist/components/theme-aware-image.js +8 -0
  77. package/dist/components/video.d.ts +6 -0
  78. package/dist/components/video.d.ts.map +1 -0
  79. package/dist/components/video.js +3 -0
  80. package/dist/config.d.ts +71 -0
  81. package/dist/config.d.ts.map +1 -0
  82. package/dist/config.js +1 -0
  83. package/dist/controls.d.ts +15 -0
  84. package/dist/controls.d.ts.map +1 -0
  85. package/dist/controls.js +52 -0
  86. package/dist/internal/chat/context.d.ts +19 -0
  87. package/dist/internal/chat/context.d.ts.map +1 -0
  88. package/dist/internal/chat/context.js +36 -0
  89. package/dist/internal/chat/conversation.d.ts +10 -0
  90. package/dist/internal/chat/conversation.d.ts.map +1 -0
  91. package/dist/internal/chat/conversation.js +16 -0
  92. package/dist/internal/chat/copy-chat.d.ts +5 -0
  93. package/dist/internal/chat/copy-chat.d.ts.map +1 -0
  94. package/dist/internal/chat/copy-chat.js +35 -0
  95. package/dist/internal/chat/db.d.ts +13 -0
  96. package/dist/internal/chat/db.d.ts.map +1 -0
  97. package/dist/internal/chat/db.js +19 -0
  98. package/dist/internal/chat/message-metadata.d.ts +8 -0
  99. package/dist/internal/chat/message-metadata.d.ts.map +1 -0
  100. package/dist/internal/chat/message-metadata.js +29 -0
  101. package/dist/internal/chat/message.d.ts +11 -0
  102. package/dist/internal/chat/message.d.ts.map +1 -0
  103. package/dist/internal/chat/message.js +11 -0
  104. package/dist/internal/chat/prompt-input.d.ts +13 -0
  105. package/dist/internal/chat/prompt-input.d.ts.map +1 -0
  106. package/dist/internal/chat/prompt-input.js +39 -0
  107. package/dist/internal/chat/shell.d.ts +2 -0
  108. package/dist/internal/chat/shell.d.ts.map +1 -0
  109. package/dist/internal/chat/shell.js +194 -0
  110. package/dist/internal/chat/shimmer.d.ts +11 -0
  111. package/dist/internal/chat/shimmer.d.ts.map +1 -0
  112. package/dist/internal/chat/shimmer.js +18 -0
  113. package/dist/internal/chat/sources.d.ts +13 -0
  114. package/dist/internal/chat/sources.d.ts.map +1 -0
  115. package/dist/internal/chat/sources.js +9 -0
  116. package/dist/internal/chat/suggestion.d.ts +11 -0
  117. package/dist/internal/chat/suggestion.d.ts.map +1 -0
  118. package/dist/internal/chat/suggestion.js +12 -0
  119. package/dist/internal/cn.d.ts +3 -0
  120. package/dist/internal/cn.d.ts.map +1 -0
  121. package/dist/internal/cn.js +3 -0
  122. package/dist/internal/feedback-action.d.ts +14 -0
  123. package/dist/internal/feedback-action.d.ts.map +1 -0
  124. package/dist/internal/feedback-action.js +34 -0
  125. package/dist/internal/i18n.d.ts +6 -0
  126. package/dist/internal/i18n.d.ts.map +1 -0
  127. package/dist/internal/i18n.js +18 -0
  128. package/dist/internal/languages.d.ts +7 -0
  129. package/dist/internal/languages.d.ts.map +1 -0
  130. package/dist/internal/languages.js +18 -0
  131. package/dist/internal/not-implemented.d.ts +2 -0
  132. package/dist/internal/not-implemented.d.ts.map +1 -0
  133. package/dist/internal/not-implemented.js +4 -0
  134. package/dist/internal/page-actions-client.d.ts +13 -0
  135. package/dist/internal/page-actions-client.d.ts.map +1 -0
  136. package/dist/internal/page-actions-client.js +160 -0
  137. package/dist/internal/page-actions.d.ts +18 -0
  138. package/dist/internal/page-actions.d.ts.map +1 -0
  139. package/dist/internal/page-actions.js +4 -0
  140. package/dist/internal/provider-client.d.ts +9 -0
  141. package/dist/internal/provider-client.d.ts.map +1 -0
  142. package/dist/internal/provider-client.js +23 -0
  143. package/dist/internal/search.d.ts +5 -0
  144. package/dist/internal/search.d.ts.map +1 -0
  145. package/dist/internal/search.js +14 -0
  146. package/dist/internal/sidebar.d.ts +9 -0
  147. package/dist/internal/sidebar.d.ts.map +1 -0
  148. package/dist/internal/sidebar.js +38 -0
  149. package/dist/internal/table-of-contents.d.ts +9 -0
  150. package/dist/internal/table-of-contents.d.ts.map +1 -0
  151. package/dist/internal/table-of-contents.js +5 -0
  152. package/dist/internal/ui/button-group.d.ts +13 -0
  153. package/dist/internal/ui/button-group.d.ts.map +1 -0
  154. package/dist/internal/ui/button-group.js +26 -0
  155. package/dist/internal/ui/button.d.ts +12 -0
  156. package/dist/internal/ui/button.d.ts.map +1 -0
  157. package/dist/internal/ui/button.js +33 -0
  158. package/dist/internal/ui/card.d.ts +6 -0
  159. package/dist/internal/ui/card.d.ts.map +1 -0
  160. package/dist/internal/ui/card.js +14 -0
  161. package/dist/internal/ui/collapsible.d.ts +6 -0
  162. package/dist/internal/ui/collapsible.d.ts.map +1 -0
  163. package/dist/internal/ui/collapsible.js +12 -0
  164. package/dist/internal/ui/drawer.d.ts +6 -0
  165. package/dist/internal/ui/drawer.d.ts.map +1 -0
  166. package/dist/internal/ui/drawer.js +13 -0
  167. package/dist/internal/ui/dropdown-menu.d.ts +22 -0
  168. package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
  169. package/dist/internal/ui/dropdown-menu.js +41 -0
  170. package/dist/internal/ui/input-group.d.ts +15 -0
  171. package/dist/internal/ui/input-group.d.ts.map +1 -0
  172. package/dist/internal/ui/input-group.js +44 -0
  173. package/dist/internal/ui/input.d.ts +3 -0
  174. package/dist/internal/ui/input.d.ts.map +1 -0
  175. package/dist/internal/ui/input.js +5 -0
  176. package/dist/internal/ui/kbd.d.ts +4 -0
  177. package/dist/internal/ui/kbd.d.ts.map +1 -0
  178. package/dist/internal/ui/kbd.js +8 -0
  179. package/dist/internal/ui/popover.d.ts +6 -0
  180. package/dist/internal/ui/popover.d.ts.map +1 -0
  181. package/dist/internal/ui/popover.js +13 -0
  182. package/dist/internal/ui/scroll-area.d.ts +5 -0
  183. package/dist/internal/ui/scroll-area.d.ts.map +1 -0
  184. package/dist/internal/ui/scroll-area.js +12 -0
  185. package/dist/internal/ui/separator.d.ts +4 -0
  186. package/dist/internal/ui/separator.d.ts.map +1 -0
  187. package/dist/internal/ui/separator.js +7 -0
  188. package/dist/internal/ui/sheet.d.ts +10 -0
  189. package/dist/internal/ui/sheet.d.ts.map +1 -0
  190. package/dist/internal/ui/sheet.js +24 -0
  191. package/dist/internal/ui/sonner.d.ts +3 -0
  192. package/dist/internal/ui/sonner.d.ts.map +1 -0
  193. package/dist/internal/ui/sonner.js +20 -0
  194. package/dist/internal/ui/spinner.d.ts +3 -0
  195. package/dist/internal/ui/spinner.d.ts.map +1 -0
  196. package/dist/internal/ui/spinner.js +6 -0
  197. package/dist/internal/ui/textarea.d.ts +3 -0
  198. package/dist/internal/ui/textarea.d.ts.map +1 -0
  199. package/dist/internal/ui/textarea.js +5 -0
  200. package/dist/internal/ui/tooltip.d.ts +7 -0
  201. package/dist/internal/ui/tooltip.d.ts.map +1 -0
  202. package/dist/internal/ui/tooltip.js +16 -0
  203. package/dist/internal/use-mobile.d.ts +2 -0
  204. package/dist/internal/use-mobile.d.ts.map +1 -0
  205. package/dist/internal/use-mobile.js +16 -0
  206. package/dist/layout.d.ts +14 -0
  207. package/dist/layout.d.ts.map +1 -0
  208. package/dist/layout.js +31 -0
  209. package/dist/mdx.d.ts +36 -0
  210. package/dist/mdx.d.ts.map +1 -0
  211. package/dist/mdx.js +80 -0
  212. package/dist/pages/docs.d.ts +77 -0
  213. package/dist/pages/docs.d.ts.map +1 -0
  214. package/dist/pages/docs.js +92 -0
  215. package/dist/proxy.d.ts +37 -0
  216. package/dist/proxy.d.ts.map +1 -0
  217. package/dist/proxy.js +162 -0
  218. package/dist/routes/chat.d.ts +14 -0
  219. package/dist/routes/chat.d.ts.map +1 -0
  220. package/dist/routes/chat.js +242 -0
  221. package/dist/routes/llms.d.ts +51 -0
  222. package/dist/routes/llms.d.ts.map +1 -0
  223. package/dist/routes/llms.js +59 -0
  224. package/dist/routes/search.d.ts +11 -0
  225. package/dist/routes/search.d.ts.map +1 -0
  226. package/dist/routes/search.js +74 -0
  227. package/dist/routes/sitemap.d.ts +44 -0
  228. package/dist/routes/sitemap.d.ts.map +1 -0
  229. package/dist/routes/sitemap.js +168 -0
  230. package/dist/shiki-theme.d.ts +20 -0
  231. package/dist/shiki-theme.d.ts.map +1 -0
  232. package/dist/shiki-theme.js +110 -0
  233. package/dist/sidebar.d.ts +11 -0
  234. package/dist/sidebar.d.ts.map +1 -0
  235. package/dist/sidebar.js +16 -0
  236. package/dist/source.d.ts +174 -0
  237. package/dist/source.d.ts.map +1 -0
  238. package/dist/source.js +129 -0
  239. package/dist/versions.d.ts +15 -0
  240. package/dist/versions.d.ts.map +1 -0
  241. package/dist/versions.js +52 -0
  242. package/package.json +161 -9
  243. package/styles.css +556 -0
  244. package/template/_gitignore +29 -0
  245. package/template/app/[lang]/(home)/components/centered-section.tsx +24 -0
  246. package/template/app/[lang]/(home)/components/cta.tsx +19 -0
  247. package/template/app/[lang]/(home)/components/hero.tsx +27 -0
  248. package/template/app/[lang]/(home)/components/one-two-section.tsx +23 -0
  249. package/template/app/[lang]/(home)/components/templates.tsx +48 -0
  250. package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
  251. package/template/app/[lang]/(home)/layout.tsx +14 -0
  252. package/template/app/[lang]/(home)/page.tsx +126 -0
  253. package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
  254. package/template/app/[lang]/docs/layout.tsx +14 -0
  255. package/template/app/[lang]/layout.tsx +29 -0
  256. package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
  257. package/template/app/[lang]/llms.txt/route.ts +6 -0
  258. package/template/app/[lang]/og/[...slug]/background.png +0 -0
  259. package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
  260. package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
  261. package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
  262. package/template/app/[lang]/rss.xml/route.ts +52 -0
  263. package/template/app/[lang]/sitemap.md/route.ts +9 -0
  264. package/template/app/actions/feedback/emotions.ts +18 -0
  265. package/template/app/actions/feedback/index.ts +45 -0
  266. package/template/app/api/chat/route.ts +8 -0
  267. package/template/app/api/search/route.ts +5 -0
  268. package/template/app/favicon.ico +0 -0
  269. package/template/app/global.css +2 -0
  270. package/template/app/robots.ts +14 -0
  271. package/template/app/sitemap.ts +36 -0
  272. package/template/app/styles/geistdocs.css +595 -0
  273. package/template/components/geistdocs/chat.tsx +24 -0
  274. package/template/components/geistdocs/desktop-menu.tsx +52 -0
  275. package/template/components/geistdocs/docs-layout.tsx +20 -0
  276. package/template/components/geistdocs/feedback.tsx +139 -0
  277. package/template/components/geistdocs/footer.tsx +30 -0
  278. package/template/components/geistdocs/github-button.tsx +19 -0
  279. package/template/components/geistdocs/home-layout.tsx +46 -0
  280. package/template/components/geistdocs/language-selector.tsx +3 -0
  281. package/template/components/geistdocs/mdx-components.tsx +5 -0
  282. package/template/components/geistdocs/mobile-docs-bar.tsx +77 -0
  283. package/template/components/geistdocs/mobile-menu.tsx +150 -0
  284. package/template/components/geistdocs/navbar-logo.tsx +124 -0
  285. package/template/components/geistdocs/navbar.tsx +22 -0
  286. package/template/components/geistdocs/provider.tsx +31 -0
  287. package/template/components/geistdocs/rss-button.tsx +10 -0
  288. package/template/components/geistdocs/search.tsx +17 -0
  289. package/template/components/geistdocs/sidebar.tsx +128 -0
  290. package/template/components/geistdocs/theme-aware-image.tsx +22 -0
  291. package/template/components/geistdocs/theme-toggle.tsx +3 -0
  292. package/template/components/ui/badge.tsx +46 -0
  293. package/template/components/ui/button.tsx +60 -0
  294. package/template/components/ui/card.tsx +92 -0
  295. package/template/components/ui/command-prompt.tsx +488 -0
  296. package/template/components/ui/dialog.tsx +143 -0
  297. package/template/components/ui/input-group.tsx +170 -0
  298. package/template/components/ui/input.tsx +21 -0
  299. package/template/components/ui/navigation-menu.tsx +192 -0
  300. package/template/components/ui/popover.tsx +48 -0
  301. package/template/components/ui/separator.tsx +28 -0
  302. package/template/components/ui/sheet.tsx +139 -0
  303. package/template/components/ui/textarea.tsx +18 -0
  304. package/template/components.json +22 -0
  305. package/template/content/docs/ask-ai.cn.mdx +85 -0
  306. package/template/content/docs/ask-ai.mdx +89 -0
  307. package/template/content/docs/configuration.cn.mdx +155 -0
  308. package/template/content/docs/configuration.mdx +200 -0
  309. package/template/content/docs/deployment.cn.mdx +34 -0
  310. package/template/content/docs/deployment.mdx +40 -0
  311. package/template/content/docs/edit-on-github.cn.mdx +47 -0
  312. package/template/content/docs/edit-on-github.mdx +51 -0
  313. package/template/content/docs/env.cn.mdx +25 -0
  314. package/template/content/docs/env.mdx +29 -0
  315. package/template/content/docs/feedback.cn.mdx +85 -0
  316. package/template/content/docs/feedback.mdx +89 -0
  317. package/template/content/docs/getting-started.cn.mdx +86 -0
  318. package/template/content/docs/getting-started.mdx +107 -0
  319. package/template/content/docs/index.cn.mdx +57 -0
  320. package/template/content/docs/index.mdx +92 -0
  321. package/template/content/docs/internationalization.cn.mdx +111 -0
  322. package/template/content/docs/internationalization.mdx +122 -0
  323. package/template/content/docs/llms-txt.cn.mdx +72 -0
  324. package/template/content/docs/llms-txt.mdx +85 -0
  325. package/template/content/docs/md.cn.mdx +65 -0
  326. package/template/content/docs/md.mdx +81 -0
  327. package/template/content/docs/meta.json +23 -0
  328. package/template/content/docs/open-in-chat.cn.mdx +78 -0
  329. package/template/content/docs/open-in-chat.mdx +80 -0
  330. package/template/content/docs/provider.cn.mdx +70 -0
  331. package/template/content/docs/provider.mdx +74 -0
  332. package/template/content/docs/proxy.cn.mdx +96 -0
  333. package/template/content/docs/proxy.mdx +124 -0
  334. package/template/content/docs/rss.cn.mdx +104 -0
  335. package/template/content/docs/rss.mdx +108 -0
  336. package/template/content/docs/syntax.cn.mdx +416 -0
  337. package/template/content/docs/syntax.mdx +411 -0
  338. package/template/content/docs/theme-aware-image.mdx +57 -0
  339. package/template/content/docs/versioned-docs.cn.mdx +117 -0
  340. package/template/content/docs/versioned-docs.mdx +181 -0
  341. package/template/geistdocs.tsx +51 -0
  342. package/template/hooks/geistdocs/use-sidebar.ts +13 -0
  343. package/template/hooks/use-mobile.ts +19 -0
  344. package/template/lib/geistdocs/config.tsx +27 -0
  345. package/template/lib/geistdocs/fonts.ts +18 -0
  346. package/template/lib/geistdocs/i18n.ts +13 -0
  347. package/template/lib/geistdocs/md-tracking.ts +56 -0
  348. package/template/lib/geistdocs/source.ts +12 -0
  349. package/template/lib/utils.ts +6 -0
  350. package/template/next.config.ts +22 -0
  351. package/template/package.json +63 -0
  352. package/template/postcss.config.mjs +5 -0
  353. package/template/proxy.ts +18 -0
  354. package/template/source.config.ts +179 -0
  355. package/template/tsconfig.json +37 -0
  356. package/dist/index.js +0 -2
  357. /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: 向 AI 提问
3
+ description: 一个由 AI 提供支持的聊天助手,通过上下文感知的回答帮助用户理解您的文档
4
+ type: conceptual
5
+ summary: 具有上下文感知搜索、持久历史记录和建议提示的 AI 聊天助手。
6
+ prerequisites:
7
+ - /docs/env
8
+ related:
9
+ - /docs/open-in-chat
10
+ - /docs/llms-txt
11
+ - /docs/configuration
12
+ ---
13
+
14
+ The Ask AI feature provides an intelligent chat assistant built directly into your documentation. Users can ask questions about your docs and get instant, context-aware answers powered by AI. The assistant can search through your documentation, understand context, and provide helpful responses.
15
+
16
+ ## 工作原理
17
+
18
+ The AI chat assistant is available in two ways:
19
+
20
+ ### 1. 每页快速访问
21
+
22
+ Each documentation page has an "Ask AI about this page" button in the table of contents sidebar. When clicked, it:
23
+
24
+ 1. Opens the chat interface
25
+ 2. Pre-fills a prompt asking the AI to read the current page
26
+ 3. Allows users to ask specific questions about that page
27
+
28
+ ### 2. 全局聊天界面
29
+
30
+ Users can open the chat interface at any time by:
31
+
32
+ - Clicking the "Ask AI" button in the navbar
33
+ - Using the keyboard shortcut: `⌘I` (Mac) or `Ctrl+I` (Windows/Linux)
34
+
35
+ Once open, users can:
36
+
37
+ - Ask questions about any part of your documentation
38
+ - Upload files or images for context
39
+ - View AI-powered search results from your docs
40
+ - Get step-by-step guidance on complex topics
41
+
42
+ ## 功能
43
+
44
+ ### 上下文感知搜索
45
+
46
+ The AI assistant includes a built-in `search_docs` tool that:
47
+
48
+ 1. Searches through your documentation content
49
+ 2. Finds relevant pages based on the user's question
50
+ 3. Shows source citations with links to the referenced pages
51
+ 4. Uses the content to provide accurate, contextual answers
52
+
53
+ ### 持久化聊天历史
54
+
55
+ Conversations are automatically saved to the browser's IndexedDB, providing:
56
+
57
+ - 聊天历史在页面重新加载后仍然保留
58
+ - 能够继续先前的对话
59
+ - 开始新聊天或清除历史的选项
60
+ - 离线访问过去的对话
61
+
62
+ ### 交互功能
63
+
64
+ - **建议**:首次使用的用户会看到建议的问题以便入门
65
+ - **文件上传**:用户可以附加文件或图像以提供上下文
66
+ - **支持 Markdown**:响应以正确的 Markdown 格式呈现
67
+ - **代码语法高亮**:响应中的代码块包含语法高亮
68
+ - **推理显示**:在开发模式下,可以查看 AI 的推理过程
69
+
70
+ ### 移动响应式
71
+
72
+ The chat interface adapts to different screen sizes:
73
+
74
+ - **桌面**:作为侧边栏面板从右侧滑入
75
+ - **移动端**:以底部抽屉的形式打开,便于访问
76
+
77
+ ## 配置
78
+
79
+ The environment variables `AI_GATEWAY_API_KEY` and `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` must be set, which you can read more about in the [环境变量](/docs/env) section.
80
+
81
+ The model used is `openai/gpt-4.1-mini` via the Vercel AI Gateway.
82
+
83
+ ## 建议的提示
84
+
85
+ You can customize the initial suggested prompts shown to users. These are configured in the Geistdocs configuration file, which you can read more about in the [配置](/docs/configuration) section.
@@ -0,0 +1,89 @@
1
+ ---
2
+ title: Ask AI
3
+ description: An AI-powered chat assistant that helps users understand your documentation with context-aware responses
4
+ type: conceptual
5
+ summary: An AI-powered chat assistant with context-aware search, persistent history, and suggested prompts for your documentation.
6
+ prerequisites:
7
+ - /docs/env
8
+ related:
9
+ - /docs/open-in-chat
10
+ - /docs/llms-txt
11
+ - /docs/configuration
12
+ ---
13
+
14
+ The Ask AI feature provides an intelligent chat assistant built directly into your documentation. Users can ask questions about your docs and get instant, context-aware answers powered by AI. The assistant can search through your documentation, understand context, and provide helpful responses.
15
+
16
+ <CopyPrompt text="Help me configure Ask AI for this Geistdocs site. Check my AI prompt, suggestions, environment variables, and search route, then recommend improvements for the assistant experience.">
17
+ Help me configure Ask AI for this Geistdocs site. Check my AI prompt, suggestions, environment variables, and search route, then recommend improvements for the assistant experience.
18
+ </CopyPrompt>
19
+
20
+ ## How it works
21
+
22
+ The AI chat assistant is available in two ways:
23
+
24
+ ### 1. Per-Page Quick Access
25
+
26
+ Each documentation page has an "Ask AI about this page" button in the table of contents sidebar. When clicked, it:
27
+
28
+ 1. Opens the chat interface
29
+ 2. Pre-fills a prompt asking the AI to read the current page
30
+ 3. Allows users to ask specific questions about that page
31
+
32
+ ### 2. Global Chat Interface
33
+
34
+ Users can open the chat interface at any time by:
35
+
36
+ - Clicking the "Ask AI" button in the navbar
37
+ - Using the keyboard shortcut: `⌘I` (Mac) or `Ctrl+I` (Windows/Linux)
38
+
39
+ Once open, users can:
40
+
41
+ - Ask questions about any part of your documentation
42
+ - Upload files or images for context
43
+ - View AI-powered search results from your docs
44
+ - Get step-by-step guidance on complex topics
45
+
46
+ ## Features
47
+
48
+ ### Context-Aware Search
49
+
50
+ The AI assistant includes a built-in `search_docs` tool that:
51
+
52
+ 1. Searches through your documentation content
53
+ 2. Finds relevant pages based on the user's question
54
+ 3. Shows source citations with links to the referenced pages
55
+ 4. Uses the content to provide accurate, contextual answers
56
+
57
+ ### Persistent Chat History
58
+
59
+ Conversations are automatically saved to the browser's IndexedDB, providing:
60
+
61
+ - Chat history that persists across page reloads
62
+ - Ability to continue previous conversations
63
+ - Option to start a new chat or clear history
64
+ - Offline access to past conversations
65
+
66
+ ### Interactive Features
67
+
68
+ - **Suggestions**: First-time users see suggested questions to get started
69
+ - **File Upload**: Users can attach files or images for context
70
+ - **Markdown Support**: Responses are formatted with proper Markdown rendering
71
+ - **Code Syntax Highlighting**: Code blocks in responses include syntax highlighting
72
+ - **Reasoning Display**: In development mode, view the AI's reasoning process
73
+
74
+ ### Mobile-Responsive
75
+
76
+ The chat interface adapts to different screen sizes:
77
+
78
+ - **Desktop**: Slides in from the right side as a sidebar panel
79
+ - **Mobile**: Opens as a bottom drawer.
80
+
81
+ ## Configuration
82
+
83
+ The environment variables `AI_GATEWAY_API_KEY` and `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` must be set, which you can read more about in the [Environment Variables](/docs/env) section.
84
+
85
+ The model used is `openai/gpt-4.1-mini` via the Vercel AI Gateway.
86
+
87
+ ## Suggested Prompts
88
+
89
+ You can customize the initial suggested prompts shown to users. These are configured in the Geistdocs configuration file, which you can read more about in the [Configuration](/docs/configuration) section.
@@ -0,0 +1,155 @@
1
+ ---
2
+ title: 配置
3
+ description: 通过本地 adapter 文件和包 API 配置 Geistdocs 站点
4
+ type: reference
5
+ summary: 配置站点 metadata、导航、AI 功能、页面操作、翻译和本地 adapters。
6
+ prerequisites:
7
+ - /docs/getting-started
8
+ related:
9
+ - /docs/provider
10
+ - /docs/env
11
+ - /docs/versioned-docs
12
+ - /docs/proxy
13
+ ---
14
+
15
+ 通过生成项目中你拥有的文件配置 Geistdocs。运行时功能来自 `@vercel/geistdocs`,本地文件控制内容、品牌、路由 adapters 和可选自定义。
16
+
17
+ ## 配置文件
18
+
19
+ | File | Purpose |
20
+ | --- | --- |
21
+ | `geistdocs.tsx` | 站点级设置,包括 logo、nav、GitHub 仓库、AI prompt、翻译和功能开关。 |
22
+ | `lib/geistdocs/config.tsx` | 使用 `defineConfig` 将 `geistdocs.tsx` exports 转换为包配置。 |
23
+ | `lib/geistdocs/source.ts` | 将 Fumadocs content collections 连接到包 source adapter。 |
24
+ | `components/geistdocs/mdx-components.tsx` | 添加或覆盖 MDX 组件。 |
25
+ | `app/[lang]/docs/[[...slug]]/page.tsx` | 配置包提供的 docs page renderer。 |
26
+ | `proxy.ts` | 配置 Markdown 协商、AI-agent 重写、请求追踪和自定义 request hooks。 |
27
+ | `content/docs/meta.json` | 控制侧边栏顺序和分组标签。 |
28
+
29
+ ## `geistdocs.tsx`
30
+
31
+ 项目根目录下的 `geistdocs.tsx` 文件包含主要自定义选项:
32
+
33
+ ```tsx title="geistdocs.tsx"
34
+ import { BookHeartIcon } from "lucide-react";
35
+
36
+ export const Logo = () => (
37
+ <div className="flex items-center gap-2">
38
+ <BookHeartIcon className="size-5" />
39
+ <p className="font-semibold text-xl tracking-tight">Geistdocs</p>
40
+ </div>
41
+ );
42
+
43
+ export const nav = [
44
+ {
45
+ label: "Docs",
46
+ href: "/docs",
47
+ },
48
+ ];
49
+
50
+ export const suggestions = [
51
+ "What is Vercel?",
52
+ "What can I deploy with Vercel?",
53
+ "What is Fluid Compute?",
54
+ "How much does Vercel cost?",
55
+ ];
56
+
57
+ export const title = "Geistdocs Documentation";
58
+
59
+ export const prompt =
60
+ "You are a helpful assistant specializing in answering questions about Geistdocs, a modern documentation template built with Next.js and Fumadocs.";
61
+ ```
62
+
63
+ ## 配置选项
64
+
65
+ ### `Logo`
66
+
67
+ 自定义显示在站点页眉中的徽标组件:
68
+
69
+ ```tsx title="geistdocs.tsx"
70
+ export const Logo = () => (
71
+ <div className="flex items-center gap-2">
72
+ <YourIcon className="size-5" />
73
+ <p className="font-semibold text-xl tracking-tight">Your Brand</p>
74
+ </div>
75
+ );
76
+ ```
77
+
78
+ ### `nav`
79
+
80
+ 定义显示在页眉中的导航链接:
81
+
82
+ ```tsx title="geistdocs.tsx"
83
+ export const nav = [
84
+ {
85
+ label: "Documentation",
86
+ href: "/docs",
87
+ },
88
+ {
89
+ label: "API Reference",
90
+ href: "/api",
91
+ },
92
+ {
93
+ label: "GitHub",
94
+ href: "https://github.com/your-org/your-repo",
95
+ },
96
+ ];
97
+ ```
98
+
99
+ ### `suggestions`
100
+
101
+ 为 AI 助手配置建议的问题:
102
+
103
+ ```tsx title="geistdocs.tsx"
104
+ export const suggestions = [
105
+ "How do I get started?",
106
+ "What are the key features?",
107
+ "How do I deploy my site?",
108
+ "Where can I get help?",
109
+ ];
110
+ ```
111
+
112
+ ### `title`
113
+
114
+ 设置文档站点的主标题:
115
+
116
+ ```tsx title="geistdocs.tsx"
117
+ export const title = "Your Product Documentation";
118
+ ```
119
+
120
+ ### `prompt`
121
+
122
+ 自定义 AI 助手的系统提示,以匹配您的文档上下文:
123
+
124
+ ```tsx title="geistdocs.tsx"
125
+ export const prompt =
126
+ "You are a helpful assistant specializing in answering questions about Your Product, a platform for building amazing applications.";
127
+ ```
128
+
129
+ ## 高级配置
130
+
131
+ `lib/geistdocs/config.tsx` 可以添加 `content` 和 `versions` metadata,让本地 adapters 和自定义 UI 共用同一个配置对象:
132
+
133
+ ```tsx title="lib/geistdocs/config.tsx"
134
+ export const config = defineConfig({
135
+ // ...
136
+ content: [
137
+ { id: "docs", label: "Docs", dir: "content/docs", route: "/docs" },
138
+ {
139
+ id: "cookbook",
140
+ label: "Cookbook",
141
+ dir: "content/cookbook",
142
+ route: "/cookbook",
143
+ },
144
+ ],
145
+ versions: {
146
+ current: "v6",
147
+ items: [
148
+ { id: "v6", label: "v6 latest" },
149
+ { id: "v5", label: "v5", href: "https://v5.example.com/:path*" },
150
+ ],
151
+ },
152
+ });
153
+ ```
154
+
155
+ 阅读 [版本化文档](/docs/versioned-docs) 配置 versioned sources,阅读 [Proxy 和 Markdown 路由](/docs/proxy) 配置 route mappings。
@@ -0,0 +1,200 @@
1
+ ---
2
+ title: Configuration
3
+ description: Configure a Geistdocs site through local adapter files and package APIs
4
+ type: reference
5
+ summary: Configure site metadata, navigation, AI features, page actions, translations, and local adapters.
6
+ prerequisites:
7
+ - /docs/getting-started
8
+ related:
9
+ - /docs/provider
10
+ - /docs/env
11
+ - /docs/versioned-docs
12
+ - /docs/proxy
13
+ ---
14
+
15
+ Configure Geistdocs through user-owned files in the generated project. Runtime features come from `@vercel/geistdocs`, while your local files control content, branding, routing adapters, and opt-in customization.
16
+
17
+ <CopyPrompt text="Review this Geistdocs project configuration. Explain what each export in geistdocs.tsx does, identify which features are enabled, and suggest safe customizations that do not require editing package internals.">
18
+ Review this Geistdocs project configuration. Explain what each export in `geistdocs.tsx` does, identify which features are enabled, and suggest safe customizations that do not require editing package internals.
19
+ </CopyPrompt>
20
+
21
+ ## Configuration files
22
+
23
+ | File | Purpose |
24
+ | --- | --- |
25
+ | `geistdocs.tsx` | Site-level settings, including logo, nav, GitHub repo, AI prompt, translations, and feature flags. |
26
+ | `lib/geistdocs/config.tsx` | Converts `geistdocs.tsx` exports into the package config using `defineConfig`. |
27
+ | `lib/geistdocs/source.ts` | Connects Fumadocs content collections to the package source adapter. |
28
+ | `components/geistdocs/mdx-components.tsx` | Adds or overrides MDX components. |
29
+ | `components/geistdocs/docs-layout.tsx` | Customizes the package-backed docs layout, including optional sidebar content. |
30
+ | `app/[lang]/docs/[[...slug]]/page.tsx` | Configures the package docs page renderer. |
31
+ | `app/[lang]/llms.txt/route.ts` | Configures the all-docs Markdown endpoint. |
32
+ | `app/[lang]/llms.mdx/[[...slug]]/route.ts` | Configures single-page Markdown responses. |
33
+ | `proxy.ts` | Configures markdown negotiation, AI-agent rewrites, request tracking, and custom request hooks. |
34
+ | `content/docs/meta.json` | Controls sidebar order and section labels. |
35
+
36
+ ## `geistdocs.tsx`
37
+
38
+ The root `geistdocs.tsx` file is the primary configuration surface:
39
+
40
+ ```tsx title="geistdocs.tsx"
41
+ export const Logo = () => <span>My Docs</span>;
42
+
43
+ export const github = {
44
+ owner: "my-org",
45
+ repo: "my-repo",
46
+ };
47
+
48
+ export const nav = [
49
+ { label: "Docs", href: "/docs" },
50
+ { label: "GitHub", href: "https://github.com/my-org/my-repo" },
51
+ ];
52
+
53
+ export const title = "My Documentation";
54
+
55
+ export const prompt =
56
+ "You are a helpful assistant that answers questions about My Documentation.";
57
+
58
+ export const suggestions = [
59
+ "How do I get started?",
60
+ "How do I deploy?",
61
+ ];
62
+
63
+ export const translations = {
64
+ en: { displayName: "English" },
65
+ };
66
+
67
+ export const basePath: string | undefined = undefined;
68
+ export const siteId: string | undefined = undefined;
69
+ ```
70
+
71
+ ## `defineConfig`
72
+
73
+ `lib/geistdocs/config.tsx` converts your root exports into a package config. Most projects only need the generated defaults:
74
+
75
+ ```tsx title="lib/geistdocs/config.tsx"
76
+ import { defineConfig } from "@vercel/geistdocs/config";
77
+ import {
78
+ basePath,
79
+ github,
80
+ Logo,
81
+ nav,
82
+ prompt,
83
+ siteId,
84
+ suggestions,
85
+ title,
86
+ translations,
87
+ } from "@/geistdocs";
88
+
89
+ export const config = defineConfig({
90
+ title,
91
+ defaultLanguage: "en",
92
+ logo: <Logo />,
93
+ github,
94
+ nav,
95
+ basePath,
96
+ siteId,
97
+ translations,
98
+ ai: {
99
+ prompt,
100
+ suggestions,
101
+ },
102
+ });
103
+ ```
104
+
105
+ Advanced sites can add `content` and `versions` metadata so local adapters and custom UI share one configuration object:
106
+
107
+ ```tsx title="lib/geistdocs/config.tsx"
108
+ export const config = defineConfig({
109
+ // ...
110
+ content: [
111
+ { id: "docs", label: "Docs", dir: "content/docs", route: "/docs" },
112
+ {
113
+ id: "cookbook",
114
+ label: "Cookbook",
115
+ dir: "content/cookbook",
116
+ route: "/cookbook",
117
+ },
118
+ ],
119
+ versions: {
120
+ current: "v6",
121
+ items: [
122
+ { id: "v6", label: "v6 latest" },
123
+ { id: "v5", label: "v5", href: "https://v5.example.com/:path*" },
124
+ ],
125
+ },
126
+ });
127
+ ```
128
+
129
+ Use [Versioned docs](/docs/versioned-docs) for versioned source setup and [Proxy and markdown routes](/docs/proxy) for route mappings.
130
+
131
+ ## Page actions
132
+
133
+ Page actions appear below the table of contents. They are enabled by default and can be disabled through `defineConfig` in `lib/geistdocs/config.tsx`:
134
+
135
+ ```tsx title="lib/geistdocs/config.tsx"
136
+ export const config = defineConfig({
137
+ // ...
138
+ pageActions: {
139
+ editSource: false,
140
+ scrollTop: true,
141
+ copyPage: true,
142
+ askAI: true,
143
+ openInChat: false,
144
+ },
145
+ feedback: {
146
+ enabled: false,
147
+ },
148
+ });
149
+ ```
150
+
151
+ ## User-owned adapters
152
+
153
+ Adapter files are safe to edit. Package updates do not overwrite them.
154
+
155
+ For example, add a custom MDX component:
156
+
157
+ ```tsx title="components/geistdocs/mdx-components.tsx"
158
+ import { createMdxComponents } from "@vercel/geistdocs/mdx";
159
+ import type { MDXComponents } from "mdx/types";
160
+
161
+ const ProductCard = ({ name }: { name: string }) => <div>{name}</div>;
162
+
163
+ export const getMDXComponents = (components?: MDXComponents): MDXComponents =>
164
+ createMdxComponents({
165
+ ProductCard,
166
+ ...components,
167
+ });
168
+ ```
169
+
170
+ Then use it in MDX:
171
+
172
+ ```mdx
173
+ <ProductCard name="My product" />
174
+ ```
175
+
176
+ ## Docs page adapter
177
+
178
+ `createDocsPage` accepts hooks for route-specific behavior:
179
+
180
+ ```tsx title="app/[lang]/docs/[[...slug]]/page.tsx"
181
+ const docsPage = createDocsPage({
182
+ config,
183
+ source: geistdocsSource,
184
+ getPageUrl: ({ page }) => page.url,
185
+ metadata: ({ metadata }) => metadata,
186
+ mdx: ({ link }) => getMDXComponents({ a: link }),
187
+ });
188
+ ```
189
+
190
+ Use `getPageUrl` when the public route differs from the source URL, such as `/v5/docs`. Use `metadata` to set canonical URLs, `robots`, or Open Graph fields for a specific route.
191
+
192
+ ## Package-owned runtime
193
+
194
+ Do not edit files inside `node_modules/@vercel/geistdocs`. Update the package instead:
195
+
196
+ ```bash title="Terminal"
197
+ pnpm exec geistdocs update
198
+ ```
199
+
200
+ If a release adds an optional prop or config field, opt into it by editing the relevant local adapter file. Existing adapters should keep compiling unless a release includes a breaking API change.
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: 部署到 Vercel
3
+ description: 学习如何将你的 Geistdocs 网站部署到 Vercel
4
+ type: guide
5
+ summary: 使用正确的项目设置从 Vercel 控制台部署您的 Geistdocs 站点。
6
+ prerequisites:
7
+ - /docs/getting-started
8
+ - /docs/env
9
+ related:
10
+ - /docs/configuration
11
+ ---
12
+
13
+ ## 先决条件
14
+
15
+ 在部署之前,你需要:
16
+
17
+ - 一个 [GitHub 帐户](https://github.com) 并包含你的 Geistdocs 仓库
18
+ - 一个 [Vercel 帐户](https://vercel.com)(在 [vercel.com](https://vercel.com) 注册)
19
+ - 你的 Vercel 帐户已连接到你的 GitHub 帐户
20
+ - 已准备好的环境变量(参见 [环境变量](/docs/env))
21
+
22
+ ## 部署到 Vercel
23
+
24
+ 要从 Vercel 控制面板部署:
25
+
26
+ 1. 前往 [vercel.com/new](https://vercel.com/new)
27
+ 2. 选择你的 Geistdocs 仓库
28
+ 3. 配置你的项目设置:
29
+ - **框架预设**: Next.js(自动检测)
30
+ - **构建命令**: `pnpm build` or `npm run build`
31
+ - **输出目录**: `.next` (默认)
32
+ - **安装命令**: `pnpm install` or `npm install`
33
+ 4. 添加你的环境变量(参见 [环境变量](/docs/env))
34
+ 5. 点击 "部署"
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Deploy to Vercel
3
+ description: Learn how to deploy your Geistdocs site to Vercel
4
+ type: guide
5
+ summary: Deploy your Geistdocs site to Vercel from the dashboard with the correct project settings.
6
+ prerequisites:
7
+ - /docs/getting-started
8
+ - /docs/env
9
+ related:
10
+ - /docs/configuration
11
+ ---
12
+
13
+ Deploy a Geistdocs site to Vercel as a Next.js app. Make sure your package dependency, environment variables, and production URL are configured before shipping.
14
+
15
+ <CopyPrompt text="Help me deploy this Geistdocs project to Vercel. Check the package scripts, required environment variables, and Vercel project settings, then give me a deploy checklist for production.">
16
+ Help me deploy this Geistdocs project to Vercel. Check the package scripts, required environment variables, and Vercel project settings, then give me a deploy checklist for production.
17
+ </CopyPrompt>
18
+
19
+ ## Prerequisites
20
+
21
+ Before deploying, you need:
22
+
23
+ - A [GitHub account](https://github.com) with your Geistdocs repository
24
+ - A [Vercel account](https://vercel.com) (sign up at [vercel.com](https://vercel.com))
25
+ - Your Vercel account connected to your GitHub account
26
+ - Environment variables ready (see [Environment Variables](/docs/env))
27
+
28
+ ## Deploy to Vercel
29
+
30
+ To deploy from the Vercel dashboard:
31
+
32
+ 1. Go to [vercel.com/new](https://vercel.com/new)
33
+ 2. Select your Geistdocs repository
34
+ 3. Configure your project settings:
35
+ - **Framework Preset**: Next.js (automatically detected)
36
+ - **Build Command**: `pnpm build` or `npm run build`
37
+ - **Output Directory**: `.next` (default)
38
+ - **Install Command**: `pnpm install` or `npm install`
39
+ 4. Add your environment variables (see [Environment Variables](/docs/env))
40
+ 5. Click "Deploy"
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: 在 GitHub 上编辑
3
+ description: 允许读者通过在 GitHub 上编辑文档页面直接贡献更改
4
+ type: integration
5
+ summary: 每个文档页面上的直接链接,让读者通过 GitHub 拉取请求提出更改。
6
+ related:
7
+ - /docs/configuration
8
+ ---
9
+
10
+ “在 GitHub 上编辑” 功能为读者提供了一个直接的链接,用于建议对您的文档进行更改。该链接出现在每个文档页面的目录侧栏中,方便用户提交修复、改进或更新。
11
+
12
+ ## 工作原理
13
+
14
+ 当用户点击 **“在 GitHub 上编辑此页”** 链接时,会直接跳转到您 GitHub 仓库中的源文件。在那里,他们可以:
15
+
16
+ 1. Fork 仓库(如果尚未 Fork)
17
+ 2. 在 GitHub 网页编辑器中进行编辑
18
+ 3. 提交包含其更改的 pull request
19
+
20
+ 此工作流程利用了 GitHub 内置的编辑功能,使技术用户和非技术用户都能方便地进行贡献。
21
+
22
+ ## 配置
23
+
24
+ "在 GitHub 上编辑" 链接基于 `geistdocs.tsx` 配置文件中的 `github` 对象自动生成。设置 `owner` 和 `repo` 属性以启用此功能:
25
+
26
+ ```tsx
27
+ export const github = {
28
+ owner: "your-username",
29
+ repo: "your-repo-name",
30
+ };
31
+ ```
32
+
33
+ 如果这些值未设置,该链接将不会出现在您的文档页面上。
34
+
35
+ ### 生成的 URL 格式
36
+
37
+ 链接遵循以下模式:
38
+
39
+ ```
40
+ https://github.com/{owner}/{repo}/edit/main/content/docs/{file-path}
41
+ ```
42
+
43
+ 例如,如果您的页面位于 `content/docs/getting-started.mdx`,则生成的链接为:
44
+
45
+ ```
46
+ https://github.com/your-username/your-repo-name/edit/main/content/docs/getting-started.mdx
47
+ ```