@vercel/geistdocs 1.21.0 → 1.22.0
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/cli/index.js +1 -1
- package/dist/footer.js +1 -1
- package/dist/internal/chat/copy-chat.d.ts.map +1 -1
- package/dist/internal/chat/copy-chat.js +1 -1
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +8 -3
- package/dist/internal/docs-page-error-boundary.d.ts +10 -0
- package/dist/internal/docs-page-error-boundary.d.ts.map +1 -0
- package/dist/internal/docs-page-error-boundary.js +7 -0
- package/dist/internal/localized-link.js +1 -1
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-logo.js +2 -2
- package/dist/internal/page-breadcrumb.d.ts.map +1 -1
- package/dist/internal/page-breadcrumb.js +1 -1
- package/dist/internal/page-footer.d.ts.map +1 -1
- package/dist/internal/page-footer.js +2 -2
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +14 -8
- package/dist/pages/docs.d.ts +1 -1
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +6 -2
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +2 -8
- package/dist/routes/llms.d.ts +5 -2
- package/dist/routes/llms.d.ts.map +1 -1
- package/dist/routes/llms.js +8 -10
- package/docs/agents.md +1 -1
- package/docs/llms.txt +69 -16
- package/docs/manifest.json +1 -1
- package/docs/pages/agent-readiness.md +2 -2
- package/docs/pages/configuration.md +6 -0
- package/docs/pages/llms-txt.md +3 -3
- package/docs/pages/md.md +3 -3
- package/docs/pages/migration.md +49 -5
- package/docs/pages/provider.md +2 -0
- package/docs/pages/versioned-docs.md +3 -2
- package/package.json +4 -4
- package/template/AGENTS.md +3 -0
- package/template/app/[lang]/(home)/layout.tsx +3 -2
- package/template/app/[lang]/.well-known/mcp.json/route.ts +3 -5
- package/template/app/[lang]/agents.md/route.ts +1 -1
- package/template/app/[lang]/docs/layout.tsx +3 -2
- package/template/app/[lang]/layout.tsx +7 -2
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +4 -5
- package/template/app/[lang]/llms.txt/route.ts +1 -1
- package/template/app/[lang]/rss.xml/route.ts +14 -7
- package/template/app/[lang]/sitemap.md/route.ts +4 -5
- package/template/app/sitemap.ts +5 -2
- package/template/content/docs/agent-readiness.mdx +2 -2
- package/template/content/docs/configuration.mdx +6 -0
- package/template/content/docs/llms-txt.cn.mdx +2 -2
- package/template/content/docs/llms-txt.mdx +3 -3
- package/template/content/docs/md.mdx +3 -3
- package/template/content/docs/migration.mdx +49 -5
- package/template/content/docs/provider.cn.mdx +2 -0
- package/template/content/docs/provider.mdx +2 -0
- package/template/content/docs/versioned-docs.mdx +3 -2
- package/template/lib/geistdocs/root-params.ts +5 -0
- package/template/next.config.ts +2 -4
- package/template/package.json +3 -3
|
@@ -38,7 +38,7 @@ Generated projects include a thin App Router adapter:
|
|
|
38
38
|
import { createAgentsRoute } from "@vercel/geistdocs/routes/agents";
|
|
39
39
|
import { config } from "@/lib/geistdocs/config";
|
|
40
40
|
|
|
41
|
-
export const { GET, generateStaticParams
|
|
41
|
+
export const { GET, generateStaticParams } = createAgentsRoute({
|
|
42
42
|
config,
|
|
43
43
|
});
|
|
44
44
|
```
|
|
@@ -51,7 +51,7 @@ Generated projects also include a thin adapter for MCP discovery:
|
|
|
51
51
|
import { createMcpManifestRoute } from "@vercel/geistdocs/routes/mcp";
|
|
52
52
|
import { config } from "@/lib/geistdocs/config";
|
|
53
53
|
|
|
54
|
-
export const { GET, generateStaticParams
|
|
54
|
+
export const { GET, generateStaticParams } = createMcpManifestRoute({
|
|
55
55
|
config,
|
|
56
56
|
});
|
|
57
57
|
```
|
|
@@ -216,6 +216,8 @@ When Next.js mounts the application below a path, set the same value in `next.co
|
|
|
216
216
|
```ts title="next.config.ts"
|
|
217
217
|
const config: NextConfig = {
|
|
218
218
|
basePath: "/docs",
|
|
219
|
+
cacheComponents: true,
|
|
220
|
+
partialPrefetching: true,
|
|
219
221
|
};
|
|
220
222
|
```
|
|
221
223
|
|
|
@@ -348,6 +350,10 @@ Set `openGraph.images` to `true` only when your site includes the Geistdocs OG r
|
|
|
348
350
|
|
|
349
351
|
Section landing pages that use `title: Overview` produce a distinct document `<title>` automatically: Geistdocs substitutes the parent section label (for example, `Channels`) so browser tabs and search results stay meaningful instead of repeating "Overview". The visible page heading and breadcrumb are unchanged, and other pages keep their own title. Use the `metadata` callback to override the resolved title for a specific route.
|
|
350
352
|
|
|
353
|
+
Geistdocs wraps resolved documentation pages in a Next.js error boundary. Unexpected rendering failures show a generic **Try again** action while the navbar and sidebar remain available. Framework signals such as `notFound()` and `redirect()` continue to use their standard Next.js behavior.
|
|
354
|
+
|
|
355
|
+
Package-owned links fully prefetch documentation destinations. Pages returned by `generateStaticParams` therefore navigate directly to their complete static content without showing transient fallback UI.
|
|
356
|
+
|
|
351
357
|
## Package-owned runtime
|
|
352
358
|
|
|
353
359
|
Do not edit files inside `node_modules/@vercel/geistdocs`. Update the package instead:
|
|
@@ -42,7 +42,7 @@ https://yourdomain.com/llms.txt
|
|
|
42
42
|
import { createLlmsRoute } from "@vercel/geistdocs/routes/llms";
|
|
43
43
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
44
44
|
|
|
45
|
-
export const { GET
|
|
45
|
+
export const { GET } = createLlmsRoute({
|
|
46
46
|
source: geistdocsSource,
|
|
47
47
|
});
|
|
48
48
|
```
|
|
@@ -50,7 +50,7 @@ export const { GET, revalidate } = createLlmsRoute({
|
|
|
50
50
|
有多个内容区或版本的站点可以传入 `sources`:
|
|
51
51
|
|
|
52
52
|
```ts title="app/[lang]/llms.txt/route.ts"
|
|
53
|
-
export const { GET
|
|
53
|
+
export const { GET } = createLlmsRoute({
|
|
54
54
|
sources: [docsSource, cookbookSource],
|
|
55
55
|
});
|
|
56
56
|
```
|
|
@@ -57,7 +57,7 @@ Generated projects use one documentation source:
|
|
|
57
57
|
import { createLlmsRoute } from "@vercel/geistdocs/routes/llms";
|
|
58
58
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
59
59
|
|
|
60
|
-
export const { GET
|
|
60
|
+
export const { GET } = createLlmsRoute({
|
|
61
61
|
source: geistdocsSource,
|
|
62
62
|
});
|
|
63
63
|
```
|
|
@@ -65,7 +65,7 @@ export const { GET, revalidate } = createLlmsRoute({
|
|
|
65
65
|
Sites with multiple content sections or versions can pass `sources`:
|
|
66
66
|
|
|
67
67
|
```ts title="app/[lang]/llms.txt/route.ts"
|
|
68
|
-
export const { GET
|
|
68
|
+
export const { GET } = createLlmsRoute({
|
|
69
69
|
sources: [docsSource, cookbookSource],
|
|
70
70
|
});
|
|
71
71
|
```
|
|
@@ -73,7 +73,7 @@ export const { GET, revalidate } = createLlmsRoute({
|
|
|
73
73
|
Use `filterPage` to exclude pages from `/llms.txt`, such as internal or preview-only docs:
|
|
74
74
|
|
|
75
75
|
```ts title="app/[lang]/llms.txt/route.ts"
|
|
76
|
-
export const { GET
|
|
76
|
+
export const { GET } = createLlmsRoute({
|
|
77
77
|
source: geistdocsSource,
|
|
78
78
|
filterPage: (page) => !page.url.includes("/internal"),
|
|
79
79
|
});
|
|
@@ -67,7 +67,7 @@ The destination route uses `createDocsMarkdownRoute` to process the page and ret
|
|
|
67
67
|
import { createDocsMarkdownRoute } from "@vercel/geistdocs/routes/llms";
|
|
68
68
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
69
69
|
|
|
70
|
-
export const { GET, generateStaticParams
|
|
70
|
+
export const { GET, generateStaticParams } =
|
|
71
71
|
createDocsMarkdownRoute({
|
|
72
72
|
notFound: {},
|
|
73
73
|
sources: [geistdocsSource],
|
|
@@ -91,9 +91,9 @@ All MDX components are processed and converted to plain Markdown equivalents.
|
|
|
91
91
|
|
|
92
92
|
When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
|
|
93
93
|
|
|
94
|
-
For example, a request for `/docs/env-vars` can suggest `/docs/environment-variables.md`. The response uses a short cache lifetime and a
|
|
94
|
+
For example, a request for `/docs/env-vars` can suggest `/docs/environment-variables.md`. The response uses a short cache lifetime and returns a real `404` status. It also sends `X-Robots-Tag: noindex` and no canonical link because the requested page does not exist. Regular HTML requests keep the app's standard not-found behavior.
|
|
95
95
|
|
|
96
|
-
Enable this behavior with `notFound: {}`. Pass `notFound: { status:
|
|
96
|
+
Enable this behavior with `notFound: {}`. Pass `notFound: { status: 410 }` for permanently removed pages. Legacy `status: 200` values are treated as `404` so missing pages always return a real error status. Without `notFound`, Markdown requests use the standard Next.js not-found response.
|
|
97
97
|
|
|
98
98
|
If a custom `markdownRoutes` mapping changes the public path shape, set `notFound.getRequestedPath` to reconstruct the app-local public pathname. This also keeps page lookup and suggestions within the right source when a flattened route serves multiple sources:
|
|
99
99
|
|
|
@@ -56,6 +56,50 @@ If you are starting from a generated Geistdocs project and moving content into i
|
|
|
56
56
|
pnpm dlx @vercel/geistdocs init --name my-docs
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
## Enable Cache Components
|
|
60
|
+
|
|
61
|
+
Geistdocs uses Next.js Cache Components to prerender static application shells while dynamic content streams from the server. Enable Cache Components in `next.config.ts`:
|
|
62
|
+
|
|
63
|
+
```ts title="next.config.ts"
|
|
64
|
+
import { createMDX } from "fumadocs-mdx/next";
|
|
65
|
+
import type { NextConfig } from "next";
|
|
66
|
+
|
|
67
|
+
const withMDX = createMDX();
|
|
68
|
+
|
|
69
|
+
const config: NextConfig = {
|
|
70
|
+
cacheComponents: true,
|
|
71
|
+
partialPrefetching: true,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default withMDX(config);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Every root dynamic parameter needs at least one value from `generateStaticParams`. For a site with a `[lang]` root segment, return every configured language from the root layout:
|
|
78
|
+
|
|
79
|
+
```tsx title="app/[lang]/layout.tsx"
|
|
80
|
+
export const generateStaticParams = () => [{ lang: "en" }];
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Server Components can read the active language without passing `params` through each layout:
|
|
84
|
+
|
|
85
|
+
```tsx title="app/[lang]/docs/layout.tsx"
|
|
86
|
+
import * as root from "next/root-params";
|
|
87
|
+
|
|
88
|
+
export default async function DocsLayout({ children }) {
|
|
89
|
+
const language = await root.lang();
|
|
90
|
+
// Use language to select the page tree.
|
|
91
|
+
return children;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Keep using route context `params` in Route Handlers and Server Actions. Next.js does not support `next/root-params` in those contexts.
|
|
96
|
+
|
|
97
|
+
Remove `dynamic`, `revalidate`, and `fetchCache` exports from App Router pages and route handlers. Cache Components replaces those route segment options with `use cache` and `cacheLife`.
|
|
98
|
+
|
|
99
|
+
Keep `partialPrefetching` enabled so links reuse each route's static and cached content instead of prefetching every destination page separately.
|
|
100
|
+
|
|
101
|
+
For unknown HTML pages, browsers can receive the docs loading shell with a `200` response before the page resolves to the not-found UI. Crawlers wait for the complete response and receive `404`. Machine-readable Markdown routes keep their configured status behavior.
|
|
102
|
+
|
|
59
103
|
## Align Ask AI dependencies
|
|
60
104
|
|
|
61
105
|
Geistdocs Ask AI uses AI SDK v6. Generated projects install `ai` v6 and `@ai-sdk/react` v3 so package-owned chat components and route helpers use the supported AI SDK APIs.
|
|
@@ -179,7 +223,7 @@ Add the package route helpers for machine-readable docs surfaces.
|
|
|
179
223
|
import { createLlmsRoute } from "@vercel/geistdocs/routes/llms";
|
|
180
224
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
181
225
|
|
|
182
|
-
export const { GET
|
|
226
|
+
export const { GET } = createLlmsRoute({
|
|
183
227
|
sources: [geistdocsSource],
|
|
184
228
|
});
|
|
185
229
|
```
|
|
@@ -188,7 +232,7 @@ export const { GET, revalidate } = createLlmsRoute({
|
|
|
188
232
|
import { createDocsMarkdownRoute } from "@vercel/geistdocs/routes/llms";
|
|
189
233
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
190
234
|
|
|
191
|
-
export const { GET, generateStaticParams
|
|
235
|
+
export const { GET, generateStaticParams } =
|
|
192
236
|
createDocsMarkdownRoute({
|
|
193
237
|
notFound: {},
|
|
194
238
|
source: geistdocsSource,
|
|
@@ -200,7 +244,7 @@ import { createSitemapMarkdownRoute } from "@vercel/geistdocs/routes/sitemap";
|
|
|
200
244
|
import { config } from "@/lib/geistdocs/config";
|
|
201
245
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
202
246
|
|
|
203
|
-
export const { GET, generateStaticParams
|
|
247
|
+
export const { GET, generateStaticParams } =
|
|
204
248
|
createSitemapMarkdownRoute({
|
|
205
249
|
config,
|
|
206
250
|
sources: [{ source: geistdocsSource.source }],
|
|
@@ -211,7 +255,7 @@ export const { GET, generateStaticParams, revalidate, dynamic } =
|
|
|
211
255
|
import { createAgentsRoute } from "@vercel/geistdocs/routes/agents";
|
|
212
256
|
import { config } from "@/lib/geistdocs/config";
|
|
213
257
|
|
|
214
|
-
export const { GET, generateStaticParams
|
|
258
|
+
export const { GET, generateStaticParams } = createAgentsRoute({
|
|
215
259
|
config,
|
|
216
260
|
});
|
|
217
261
|
```
|
|
@@ -220,7 +264,7 @@ export const { GET, generateStaticParams, revalidate } = createAgentsRoute({
|
|
|
220
264
|
import { createMcpManifestRoute } from "@vercel/geistdocs/routes/mcp";
|
|
221
265
|
import { config } from "@/lib/geistdocs/config";
|
|
222
266
|
|
|
223
|
-
export const { GET, generateStaticParams
|
|
267
|
+
export const { GET, generateStaticParams } = createMcpManifestRoute({
|
|
224
268
|
config,
|
|
225
269
|
});
|
|
226
270
|
```
|
|
@@ -51,6 +51,8 @@ When users open the AI chat on desktop, the provider automatically adds padding
|
|
|
51
51
|
|
|
52
52
|
The provider detects the screen size and chat state.
|
|
53
53
|
|
|
54
|
+
If Ask AI fails while rendering, its panel shows **Try again** and **Close** actions. The error remains scoped to the chat panel, so the documentation page and navigation stay available.
|
|
55
|
+
|
|
54
56
|
## Toast Notifications
|
|
55
57
|
|
|
56
58
|
The provider includes a global toast notification system. Use it anywhere in your app:
|
|
@@ -229,11 +229,12 @@ docs root) instead:
|
|
|
229
229
|
```tsx title="app/[lang]/docs/layout.tsx"
|
|
230
230
|
import { collectVersionSwitchPaths } from "@vercel/geistdocs/source";
|
|
231
231
|
import { GeistdocsVersionSelect } from "@vercel/geistdocs/versions";
|
|
232
|
+
import * as root from "next/root-params";
|
|
232
233
|
import { config } from "@/lib/geistdocs/config";
|
|
233
234
|
import { versions } from "@/lib/geistdocs/source";
|
|
234
235
|
|
|
235
|
-
const DocsLayout = async ({ children
|
|
236
|
-
const
|
|
236
|
+
const DocsLayout = async ({ children }) => {
|
|
237
|
+
const lang = await root.lang();
|
|
237
238
|
|
|
238
239
|
return (
|
|
239
240
|
<GeistdocsDocsLayout
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { notFound } from "next/navigation";
|
|
2
|
+
// biome-ignore lint/performance/noNamespaceImport: Next.js generates root parameter getters on this module.
|
|
3
|
+
import * as root from "next/root-params";
|
|
4
|
+
|
|
5
|
+
export const getRootLang = async () => (await root.lang()) ?? notFound();
|
package/template/next.config.ts
CHANGED
|
@@ -25,10 +25,8 @@ const envFavicon = ENV_FAVICONS[environment as keyof typeof ENV_FAVICONS];
|
|
|
25
25
|
|
|
26
26
|
const config: NextConfig = {
|
|
27
27
|
...(inMonorepo ? { transpilePackages: ["@vercel/geistdocs"] } : {}),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
turbopackFileSystemCacheForDev: true,
|
|
31
|
-
},
|
|
28
|
+
cacheComponents: true,
|
|
29
|
+
partialPrefetching: true,
|
|
32
30
|
|
|
33
31
|
images: {
|
|
34
32
|
formats: ["image/avif", "image/webp"],
|
package/template/package.json
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@orama/tokenizers": "^3.1.16",
|
|
17
17
|
"@streamdown/cjk": "^1.0.1",
|
|
18
18
|
"@streamdown/code": "^1.0.1",
|
|
19
|
-
"@vercel/agent-readability": "^0.
|
|
19
|
+
"@vercel/agent-readability": "^0.6.0",
|
|
20
20
|
"@vercel/analytics": "^1.6.1",
|
|
21
|
-
"@vercel/geistdocs": "1.
|
|
21
|
+
"@vercel/geistdocs": "1.22.0",
|
|
22
22
|
"@vercel/speed-insights": "^1.3.1",
|
|
23
23
|
"ai": "^6.0.132",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"mermaid": "^11.12.2",
|
|
37
37
|
"motion": "^12.23.25",
|
|
38
38
|
"nanoid": "^5.1.6",
|
|
39
|
-
"next": "16.
|
|
39
|
+
"next": "16.3.1",
|
|
40
40
|
"next-themes": "^0.4.6",
|
|
41
41
|
"radix-ui": "1.6.4",
|
|
42
42
|
"react": "^19.2.3",
|