@vercel/geistdocs 1.21.1 → 1.23.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/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/footer.d.ts.map +1 -1
- package/dist/footer.js +5 -0
- package/dist/home-layout.d.ts +2 -2
- package/dist/home-layout.d.ts.map +1 -1
- package/dist/home-layout.js +52 -18
- 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 +2 -2
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-logo.js +2 -2
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +18 -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/localize-href.d.ts +6 -0
- package/dist/localize-href.d.ts.map +1 -0
- package/dist/{internal/localize-href.js → localize-href.js} +2 -5
- package/dist/{internal/page-visibility.d.ts → page-visibility.d.ts} +1 -1
- package/dist/page-visibility.d.ts.map +1 -0
- package/dist/pages/docs.d.ts +3 -3
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +16 -7
- package/dist/proxy.d.ts +1 -1
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +15 -10
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/agents.js +4 -4
- package/dist/routes/chat.js +1 -1
- package/dist/routes/llms.d.ts +5 -2
- package/dist/routes/llms.d.ts.map +1 -1
- package/dist/routes/llms.js +9 -11
- package/dist/routes/not-found.d.ts +14 -0
- package/dist/routes/not-found.d.ts.map +1 -0
- package/dist/routes/not-found.js +74 -0
- package/dist/routes/search.js +1 -1
- package/dist/routes/sitemap.d.ts +1 -1
- package/dist/routes/sitemap.d.ts.map +1 -1
- package/dist/routes/sitemap.js +1 -1
- package/docs/agents.md +1 -1
- package/docs/llms.txt +76 -19
- package/docs/manifest.json +1 -1
- package/docs/pages/agent-readiness.md +3 -3
- package/docs/pages/configuration.md +6 -0
- package/docs/pages/env.md +2 -2
- package/docs/pages/llms-txt.md +3 -3
- package/docs/pages/md.md +5 -3
- package/docs/pages/migration.md +49 -5
- package/docs/pages/provider.md +2 -0
- package/docs/pages/proxy.md +2 -0
- package/docs/pages/versioned-docs.md +3 -2
- package/package.json +14 -2
- package/template/AGENTS.md +3 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +25 -11
- package/template/app/[lang]/(home)/layout.tsx +3 -2
- package/template/app/[lang]/(home)/opengraph-image.tsx +40 -0
- package/template/app/[lang]/(home)/page.tsx +143 -89
- package/template/app/[lang]/.well-known/mcp.json/route.ts +3 -5
- package/template/app/[lang]/[...not-found]/route.ts +4 -0
- 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 +14 -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]/not-found.tsx +37 -0
- package/template/app/[lang]/rss.xml/route.ts +17 -11
- package/template/app/[lang]/sitemap.md/route.ts +4 -5
- package/template/app/robots.ts +4 -4
- package/template/app/sitemap.ts +16 -10
- package/template/content/docs/agent-readiness.mdx +3 -3
- package/template/content/docs/configuration.mdx +6 -0
- package/template/content/docs/env.mdx +2 -2
- 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 +5 -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/proxy.mdx +2 -0
- package/template/content/docs/versioned-docs.mdx +3 -2
- package/template/lib/geistdocs/config.tsx +2 -0
- package/template/lib/geistdocs/public-path.ts +14 -0
- package/template/lib/geistdocs/root-params.ts +5 -0
- package/template/lib/geistdocs/site-url-warning.ts +10 -0
- package/template/lib/geistdocs/site-url.ts +33 -0
- package/template/next.config.ts +2 -10
- package/template/package.json +2 -2
- package/dist/internal/localize-href.d.ts +0 -9
- package/dist/internal/localize-href.d.ts.map +0 -1
- package/dist/internal/page-visibility.d.ts.map +0 -1
- package/template/app/[lang]/(home)/components/templates.tsx +0 -48
- /package/dist/{internal/page-visibility.js → page-visibility.js} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ImageResponse } from "next/og";
|
|
2
|
+
|
|
3
|
+
export const alt = "Geistdocs documentation platform";
|
|
4
|
+
export const contentType = "image/png";
|
|
5
|
+
export const size = {
|
|
6
|
+
height: 630,
|
|
7
|
+
width: 1200,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const OpenGraphImage = () =>
|
|
11
|
+
new ImageResponse(
|
|
12
|
+
<div
|
|
13
|
+
style={{
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
background: "#000",
|
|
16
|
+
color: "#fff",
|
|
17
|
+
display: "flex",
|
|
18
|
+
height: "100%",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
width: "100%",
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
style={{
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: 24,
|
|
28
|
+
maxWidth: 920,
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
<div style={{ fontSize: 76, fontWeight: 600 }}>Geistdocs</div>
|
|
32
|
+
<div style={{ color: "#a1a1a1", fontSize: 36, lineHeight: 1.25 }}>
|
|
33
|
+
Package-backed documentation sites for people and agents
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>,
|
|
37
|
+
size
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export default OpenGraphImage;
|
|
@@ -9,123 +9,177 @@ import {
|
|
|
9
9
|
CommandPromptTriggerDivider,
|
|
10
10
|
CommandPromptViewport,
|
|
11
11
|
} from "@vercel/geistdocs/components/command-prompt";
|
|
12
|
+
import type { GeistdocsAgentReadinessConfig } from "@vercel/geistdocs/config";
|
|
12
13
|
import type { Metadata } from "next";
|
|
14
|
+
import { config } from "@/lib/geistdocs/config";
|
|
15
|
+
import { getLocalizedPath } from "@/lib/geistdocs/public-path";
|
|
13
16
|
import { CenteredSection } from "./components/centered-section";
|
|
14
17
|
import { CTA } from "./components/cta";
|
|
15
18
|
import { Hero } from "./components/hero";
|
|
16
19
|
import { OneTwoSection } from "./components/one-two-section";
|
|
17
|
-
import { Templates } from "./components/templates";
|
|
18
20
|
import { TextGridSection } from "./components/text-grid-section";
|
|
19
21
|
|
|
20
22
|
const title = "Geistdocs";
|
|
21
23
|
const description =
|
|
22
24
|
"A Vercel documentation template built with Next.js and Fumadocs. Designed for spinning up documentation sites quickly and consistently.";
|
|
23
25
|
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
26
|
+
export const generateMetadata = async ({
|
|
27
|
+
params,
|
|
28
|
+
}: PageProps<"/[lang]">): Promise<Metadata> => {
|
|
29
|
+
const { lang } = await params;
|
|
30
|
+
const agentConfig = config.agent as GeistdocsAgentReadinessConfig | undefined;
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
return {
|
|
33
|
+
title,
|
|
34
|
+
description,
|
|
35
|
+
alternates: {
|
|
36
|
+
...(config.siteUrl
|
|
37
|
+
? {
|
|
38
|
+
canonical: getLocalizedPath(lang, "/"),
|
|
39
|
+
...(agentConfig && agentConfig.enabled !== false
|
|
40
|
+
? {
|
|
41
|
+
types: {
|
|
42
|
+
"text/markdown": getLocalizedPath(lang, "/agents.md"),
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
: {}),
|
|
46
|
+
}
|
|
47
|
+
: {}),
|
|
48
|
+
},
|
|
49
|
+
openGraph: {
|
|
50
|
+
title,
|
|
51
|
+
description,
|
|
52
|
+
type: "website",
|
|
53
|
+
...(config.siteUrl ? { url: getLocalizedPath(lang, "/") } : {}),
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
};
|
|
49
57
|
|
|
50
58
|
const textGridSection = [
|
|
51
59
|
{
|
|
52
|
-
id: "
|
|
53
|
-
title: "
|
|
54
|
-
description:
|
|
60
|
+
id: "runtime",
|
|
61
|
+
title: "Package-backed runtime",
|
|
62
|
+
description:
|
|
63
|
+
"Share navigation, search, Ask AI, page actions, and rendering behavior through one versioned package.",
|
|
55
64
|
},
|
|
56
65
|
{
|
|
57
|
-
id: "
|
|
58
|
-
title: "
|
|
59
|
-
description:
|
|
66
|
+
id: "content",
|
|
67
|
+
title: "Project-owned content",
|
|
68
|
+
description:
|
|
69
|
+
"Keep documentation, configuration, and thin adapters in the product repository where teams already work.",
|
|
60
70
|
},
|
|
61
71
|
{
|
|
62
|
-
id: "
|
|
63
|
-
title: "
|
|
64
|
-
description:
|
|
72
|
+
id: "agents",
|
|
73
|
+
title: "Agent-readable by default",
|
|
74
|
+
description:
|
|
75
|
+
"Publish llms.txt, agents.md, a semantic sitemap, and focused Markdown versions of documentation pages.",
|
|
65
76
|
},
|
|
66
77
|
{
|
|
67
|
-
id: "
|
|
68
|
-
title: "
|
|
69
|
-
description:
|
|
78
|
+
id: "shapes",
|
|
79
|
+
title: "Flexible site shapes",
|
|
80
|
+
description:
|
|
81
|
+
"Support localized, versioned, multi-section, base-path, and root-mounted documentation without forking the runtime.",
|
|
70
82
|
},
|
|
71
83
|
];
|
|
72
84
|
|
|
73
85
|
const COMMAND_FOR_HUMANS = "npx @vercel/geistdocs init";
|
|
74
86
|
const COMMAND_FOR_AGENTS = "npx @vercel/geistdocs init --agent";
|
|
75
87
|
|
|
76
|
-
const HomePage = () =>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<CommandPromptTrigger className="min-w-[90px]" value="humans">
|
|
86
|
-
For humans
|
|
87
|
-
</CommandPromptTrigger>
|
|
88
|
-
<CommandPromptTriggerDivider />
|
|
89
|
-
<CommandPromptTrigger className="min-w-[84px]" value="agents">
|
|
90
|
-
For agents
|
|
91
|
-
</CommandPromptTrigger>
|
|
92
|
-
</CommandPromptList>
|
|
93
|
-
<CommandPromptSurface>
|
|
94
|
-
<CommandPromptPrefix>$</CommandPromptPrefix>
|
|
95
|
-
<CommandPromptViewport>
|
|
96
|
-
<CommandPromptContent copyValue={COMMAND_FOR_HUMANS} value="humans">
|
|
97
|
-
{COMMAND_FOR_HUMANS}
|
|
98
|
-
</CommandPromptContent>
|
|
99
|
-
<CommandPromptContent copyValue={COMMAND_FOR_AGENTS} value="agents">
|
|
100
|
-
{COMMAND_FOR_AGENTS}
|
|
101
|
-
</CommandPromptContent>
|
|
102
|
-
</CommandPromptViewport>
|
|
103
|
-
<CommandPromptCopy />
|
|
104
|
-
</CommandPromptSurface>
|
|
105
|
-
</CommandPromptRoot>
|
|
106
|
-
</Hero>
|
|
107
|
-
<div className="flex flex-col">
|
|
108
|
-
<TextGridSection data={textGridSection} />
|
|
109
|
-
<CenteredSection
|
|
110
|
-
description="Description of centered section"
|
|
111
|
-
title="Centered Section"
|
|
112
|
-
>
|
|
113
|
-
<div className="aspect-video rounded-lg border bg-background-100" />
|
|
114
|
-
</CenteredSection>
|
|
115
|
-
<OneTwoSection
|
|
116
|
-
description="Description of one/two section"
|
|
117
|
-
title="One/Two Section"
|
|
88
|
+
const HomePage = async ({ params }: PageProps<"/[lang]">) => {
|
|
89
|
+
const { lang } = await params;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div className="mx-auto w-full max-w-[1448px] px-4 sm:px-6">
|
|
93
|
+
<Hero
|
|
94
|
+
badge="Geistdocs is now in beta"
|
|
95
|
+
description={description}
|
|
96
|
+
title={title}
|
|
118
97
|
>
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
<CommandPromptRoot defaultValue="humans">
|
|
99
|
+
<CommandPromptList>
|
|
100
|
+
<CommandPromptTrigger className="min-w-[90px]" value="humans">
|
|
101
|
+
For humans
|
|
102
|
+
</CommandPromptTrigger>
|
|
103
|
+
<CommandPromptTriggerDivider />
|
|
104
|
+
<CommandPromptTrigger className="min-w-[84px]" value="agents">
|
|
105
|
+
For agents
|
|
106
|
+
</CommandPromptTrigger>
|
|
107
|
+
</CommandPromptList>
|
|
108
|
+
<CommandPromptSurface>
|
|
109
|
+
<CommandPromptPrefix>$</CommandPromptPrefix>
|
|
110
|
+
<CommandPromptViewport>
|
|
111
|
+
<CommandPromptContent
|
|
112
|
+
copyValue={COMMAND_FOR_HUMANS}
|
|
113
|
+
value="humans"
|
|
114
|
+
>
|
|
115
|
+
{COMMAND_FOR_HUMANS}
|
|
116
|
+
</CommandPromptContent>
|
|
117
|
+
<CommandPromptContent
|
|
118
|
+
copyValue={COMMAND_FOR_AGENTS}
|
|
119
|
+
value="agents"
|
|
120
|
+
>
|
|
121
|
+
{COMMAND_FOR_AGENTS}
|
|
122
|
+
</CommandPromptContent>
|
|
123
|
+
</CommandPromptViewport>
|
|
124
|
+
<CommandPromptCopy />
|
|
125
|
+
</CommandPromptSurface>
|
|
126
|
+
</CommandPromptRoot>
|
|
127
|
+
</Hero>
|
|
128
|
+
<div className="flex flex-col">
|
|
129
|
+
<TextGridSection
|
|
130
|
+
data={textGridSection}
|
|
131
|
+
description="Geistdocs combines a shared runtime with local ownership, so documentation teams can standardize behavior without centralizing every page."
|
|
132
|
+
title="A complete foundation for product documentation"
|
|
133
|
+
/>
|
|
134
|
+
<CenteredSection
|
|
135
|
+
description="Every generated project starts as a normal Next.js application. Write MDX locally, configure the shared shell, and deploy with the same workflow as the product it documents."
|
|
136
|
+
title="Keep documentation close to the product"
|
|
137
|
+
>
|
|
138
|
+
<div className="grid gap-3 rounded-lg border bg-background-100 p-6 font-mono text-sm">
|
|
139
|
+
<p>content/docs/ stores the documentation source.</p>
|
|
140
|
+
<p>geistdocs.tsx defines product and agent metadata.</p>
|
|
141
|
+
<p>@vercel/geistdocs provides the shared runtime.</p>
|
|
142
|
+
</div>
|
|
143
|
+
</CenteredSection>
|
|
144
|
+
<OneTwoSection
|
|
145
|
+
description="Agents can discover the documentation corpus, choose a focused page, and recover from stale links without parsing the interactive application shell."
|
|
146
|
+
title="Give agents a direct path through the docs"
|
|
147
|
+
>
|
|
148
|
+
<ul className="grid gap-4 rounded-lg border bg-background-100 p-6 text-gray-900">
|
|
149
|
+
<li>
|
|
150
|
+
<a
|
|
151
|
+
className="underline"
|
|
152
|
+
href={getLocalizedPath(lang, "/agents.md")}
|
|
153
|
+
>
|
|
154
|
+
/agents.md
|
|
155
|
+
</a>{" "}
|
|
156
|
+
explains when to use the product and where to find authoritative
|
|
157
|
+
context.
|
|
158
|
+
</li>
|
|
159
|
+
<li>
|
|
160
|
+
<a
|
|
161
|
+
className="underline"
|
|
162
|
+
href={getLocalizedPath(lang, "/sitemap.md")}
|
|
163
|
+
>
|
|
164
|
+
/sitemap.md
|
|
165
|
+
</a>{" "}
|
|
166
|
+
maps documentation pages by purpose, summary, and prerequisites.
|
|
167
|
+
</li>
|
|
168
|
+
<li>
|
|
169
|
+
<a
|
|
170
|
+
className="underline"
|
|
171
|
+
href={getLocalizedPath(lang, "/llms.txt")}
|
|
172
|
+
>
|
|
173
|
+
/llms.txt
|
|
174
|
+
</a>{" "}
|
|
175
|
+
provides the complete documentation corpus as Markdown.
|
|
176
|
+
</li>
|
|
177
|
+
</ul>
|
|
178
|
+
</OneTwoSection>
|
|
179
|
+
<CTA cta="Get started" href="/docs" title="Start your docs today" />
|
|
180
|
+
</div>
|
|
127
181
|
</div>
|
|
128
|
-
|
|
129
|
-
|
|
182
|
+
);
|
|
183
|
+
};
|
|
130
184
|
|
|
131
185
|
export default HomePage;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { createMcpManifestRoute } from "@vercel/geistdocs/routes/mcp";
|
|
2
2
|
import { config } from "@/lib/geistdocs/config";
|
|
3
3
|
|
|
4
|
-
export const { GET, generateStaticParams
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
);
|
|
4
|
+
export const { GET, generateStaticParams } = createMcpManifestRoute({
|
|
5
|
+
config,
|
|
6
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAgentsRoute } from "@vercel/geistdocs/routes/agents";
|
|
2
2
|
import { config } from "@/lib/geistdocs/config";
|
|
3
3
|
|
|
4
|
-
export const { GET, generateStaticParams
|
|
4
|
+
export const { GET, generateStaticParams } = createAgentsRoute({
|
|
5
5
|
config,
|
|
6
6
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DocsLayout } from "@/components/geistdocs/docs-layout";
|
|
2
|
+
import { getRootLang } from "@/lib/geistdocs/root-params";
|
|
2
3
|
import { source } from "@/lib/geistdocs/source";
|
|
3
4
|
|
|
4
|
-
const Layout = async ({ children
|
|
5
|
-
const
|
|
5
|
+
const Layout = async ({ children }: LayoutProps<"/[lang]/docs">) => {
|
|
6
|
+
const lang = await getRootLang();
|
|
6
7
|
|
|
7
8
|
return (
|
|
8
9
|
<div className="bg-background-200">
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import "../global.css";
|
|
2
|
+
import "@/lib/geistdocs/site-url-warning";
|
|
2
3
|
import { Footer } from "@vercel/geistdocs/footer";
|
|
3
4
|
import { Navbar } from "@vercel/geistdocs/navbar";
|
|
5
|
+
import type { Metadata } from "next";
|
|
4
6
|
import { GeistdocsProvider } from "@/components/geistdocs/provider";
|
|
5
7
|
import { config } from "@/lib/geistdocs/config";
|
|
6
8
|
import { mono, sans } from "@/lib/geistdocs/fonts";
|
|
9
|
+
import { i18n } from "@/lib/geistdocs/i18n";
|
|
10
|
+
import { getRootLang } from "@/lib/geistdocs/root-params";
|
|
11
|
+
import { isSiteUrlConfigured, siteUrl } from "@/lib/geistdocs/site-url";
|
|
7
12
|
import { cn } from "@/lib/utils";
|
|
8
13
|
|
|
9
|
-
const
|
|
10
|
-
|
|
14
|
+
export const generateStaticParams = () =>
|
|
15
|
+
i18n.languages.map((lang) => ({ lang }));
|
|
16
|
+
|
|
17
|
+
export const metadata: Metadata = {
|
|
18
|
+
metadataBase: isSiteUrlConfigured ? siteUrl : undefined,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const Layout = async ({ children }: LayoutProps<"/[lang]">) => {
|
|
22
|
+
const lang = await getRootLang();
|
|
11
23
|
|
|
12
24
|
return (
|
|
13
25
|
<html
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createDocsMarkdownRoute } from "@vercel/geistdocs/routes/llms";
|
|
2
2
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
3
3
|
|
|
4
|
-
export const { GET, generateStaticParams
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
4
|
+
export const { GET, generateStaticParams } = createDocsMarkdownRoute({
|
|
5
|
+
notFound: {},
|
|
6
|
+
sources: [geistdocsSource],
|
|
7
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { lang } from "next/root-params";
|
|
2
|
+
import { getLocalizedPath } from "@/lib/geistdocs/public-path";
|
|
3
|
+
|
|
4
|
+
const NotFound = async () => {
|
|
5
|
+
const currentLang = await lang();
|
|
6
|
+
const path = (value: string) => getLocalizedPath(currentLang, value);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<main className="mx-auto grid min-h-[60vh] w-full max-w-2xl content-center gap-5 px-6 py-20">
|
|
10
|
+
<p className="font-mono text-gray-900 text-sm">404</p>
|
|
11
|
+
<h1 className="font-[450] text-4xl tracking-tight">Page not found</h1>
|
|
12
|
+
<p className="text-gray-900 text-lg">
|
|
13
|
+
The requested page does not exist. Browse the documentation or use a
|
|
14
|
+
machine-readable index to find the closest current page.
|
|
15
|
+
</p>
|
|
16
|
+
<ul className="grid gap-2">
|
|
17
|
+
<li>
|
|
18
|
+
<a className="underline" href={path("/docs")}>
|
|
19
|
+
Browse the documentation
|
|
20
|
+
</a>
|
|
21
|
+
</li>
|
|
22
|
+
<li>
|
|
23
|
+
<a className="underline" href={path("/sitemap.md")}>
|
|
24
|
+
Open the semantic sitemap
|
|
25
|
+
</a>
|
|
26
|
+
</li>
|
|
27
|
+
<li>
|
|
28
|
+
<a className="underline" href={path("/llms.txt")}>
|
|
29
|
+
Open the complete Markdown corpus
|
|
30
|
+
</a>
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</main>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default NotFound;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { getPublicPath } from "@vercel/geistdocs/config";
|
|
2
2
|
import { Feed } from "feed";
|
|
3
|
+
import { cacheLife } from "next/cache";
|
|
3
4
|
import type { NextRequest } from "next/server";
|
|
4
5
|
import { title } from "@/geistdocs";
|
|
5
6
|
import { config } from "@/lib/geistdocs/config";
|
|
7
|
+
import { absoluteUrl } from "@/lib/geistdocs/site-url";
|
|
6
8
|
import { source } from "@/lib/geistdocs/source";
|
|
7
9
|
|
|
8
|
-
const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
|
|
9
|
-
const baseUrl = `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
10
10
|
const sitePath = getPublicPath("/", config.basePath);
|
|
11
|
-
const siteUrl = sitePath
|
|
11
|
+
const siteUrl = absoluteUrl(sitePath);
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// biome-ignore lint/suspicious/useAwait: Next.js requires cached functions to be async.
|
|
14
|
+
const getFeed = async (lang: string) => {
|
|
15
|
+
"use cache";
|
|
16
|
+
cacheLife("max");
|
|
14
17
|
|
|
15
|
-
export const GET = async (
|
|
16
|
-
_req: NextRequest,
|
|
17
|
-
{ params }: RouteContext<"/[lang]/rss.xml">
|
|
18
|
-
) => {
|
|
19
|
-
const { lang } = await params;
|
|
20
18
|
const feed = new Feed({
|
|
21
19
|
title,
|
|
22
20
|
id: siteUrl,
|
|
@@ -36,7 +34,7 @@ export const GET = async (
|
|
|
36
34
|
id: page.url,
|
|
37
35
|
title: data.title ?? page.url,
|
|
38
36
|
description: data.description,
|
|
39
|
-
link:
|
|
37
|
+
link: absoluteUrl(getPublicPath(page.url, config.basePath)),
|
|
40
38
|
date: new Date(data.lastModified ?? new Date()),
|
|
41
39
|
author: [
|
|
42
40
|
{
|
|
@@ -46,7 +44,15 @@ export const GET = async (
|
|
|
46
44
|
});
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
|
|
47
|
+
return feed.rss2();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const GET = async (
|
|
51
|
+
_req: NextRequest,
|
|
52
|
+
{ params }: RouteContext<"/[lang]/rss.xml">
|
|
53
|
+
) => {
|
|
54
|
+
const { lang } = await params;
|
|
55
|
+
const rss = await getFeed(lang);
|
|
50
56
|
|
|
51
57
|
return new Response(rss, {
|
|
52
58
|
headers: {
|
|
@@ -2,8 +2,7 @@ import { createSitemapMarkdownRoute } from "@vercel/geistdocs/routes/sitemap";
|
|
|
2
2
|
import { config } from "@/lib/geistdocs/config";
|
|
3
3
|
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
4
4
|
|
|
5
|
-
export const { GET, generateStaticParams
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
5
|
+
export const { GET, generateStaticParams } = createSitemapMarkdownRoute({
|
|
6
|
+
config,
|
|
7
|
+
sources: [{ source: geistdocsSource }],
|
|
8
|
+
});
|
package/template/app/robots.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { getPublicPath } from "@vercel/geistdocs/config";
|
|
1
2
|
import type { MetadataRoute } from "next";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const baseUrl = `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
3
|
+
import { config } from "@/lib/geistdocs/config";
|
|
4
|
+
import { absoluteUrl } from "@/lib/geistdocs/site-url";
|
|
5
5
|
|
|
6
6
|
export default function robots(): MetadataRoute.Robots {
|
|
7
7
|
return {
|
|
@@ -9,6 +9,6 @@ export default function robots(): MetadataRoute.Robots {
|
|
|
9
9
|
userAgent: "*",
|
|
10
10
|
allow: "/",
|
|
11
11
|
},
|
|
12
|
-
sitemap:
|
|
12
|
+
sitemap: absoluteUrl(getPublicPath("/sitemap.xml", config.basePath)),
|
|
13
13
|
};
|
|
14
14
|
}
|
package/template/app/sitemap.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
import { getPublicPath } from "@vercel/geistdocs/config";
|
|
2
|
+
import { isPageVisibleForSurface } from "@vercel/geistdocs/page-visibility";
|
|
1
3
|
import type { MetadataRoute } from "next";
|
|
2
|
-
|
|
4
|
+
import { cacheLife } from "next/cache";
|
|
5
|
+
import { config } from "@/lib/geistdocs/config";
|
|
6
|
+
import { absoluteUrl } from "@/lib/geistdocs/site-url";
|
|
3
7
|
import { source } from "@/lib/geistdocs/source";
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
// biome-ignore lint/suspicious/useAwait: Next.js requires cached functions to be async.
|
|
10
|
+
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
11
|
+
"use cache";
|
|
12
|
+
cacheLife("max");
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
const url = (path: string) =>
|
|
15
|
+
absoluteUrl(getPublicPath(path, config.basePath));
|
|
12
16
|
|
|
13
17
|
const pages: MetadataRoute.Sitemap = [];
|
|
14
18
|
|
|
15
19
|
for (const page of source.getPages()) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
20
|
+
if (!isPageVisibleForSurface(page, "sitemap")) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const data = page.data as { lastModified?: Date };
|
|
19
25
|
|
|
20
26
|
pages.push({
|
|
21
27
|
changeFrequency: "weekly" as const,
|
|
@@ -17,7 +17,7 @@ Geistdocs can generate `/agents.md` and `/.well-known/mcp.json` discovery files
|
|
|
17
17
|
|
|
18
18
|
## What it provides
|
|
19
19
|
|
|
20
|
-
The generated `/agents.md` file gives agents a stable starting point before they crawl the rest of your documentation. The optional `/.well-known/mcp.json` route advertises configured MCP servers without running an MCP server inside Geistdocs.
|
|
20
|
+
The generated `/agents.md` file gives agents a stable starting point before they crawl the rest of your documentation. Its product section states when to use the documented product, and the homepage serves the same guidance when an agent requests `text/markdown`. The optional `/.well-known/mcp.json` route advertises configured MCP servers without running an MCP server inside Geistdocs.
|
|
21
21
|
|
|
22
22
|
It can include:
|
|
23
23
|
|
|
@@ -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:
|
|
@@ -55,6 +55,6 @@ The Vertex deployment does not need a Geistdocs-specific environment variable. A
|
|
|
55
55
|
|
|
56
56
|
## `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL`
|
|
57
57
|
|
|
58
|
-
The production URL of the Geistdocs site.
|
|
58
|
+
The production URL of the Geistdocs site. Geistdocs uses it for canonical and Open Graph metadata, product JSON-LD, `sitemap.xml`, `robots.txt`, and RSS links. Vercel sets this variable automatically.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Set this variable explicitly when deploying outside Vercel. Use a hostname such as `docs.example.com` or a full `http` or `https` URL. Local development falls back to `http://localhost:3000`. A production build with a missing or malformed value emits a warning and omits default canonical and product JSON-LD URLs. Its `sitemap.xml`, `robots.txt` sitemap directive, RSS links, and generated Open Graph image URLs continue to use the localhost fallback, so treat the warning as a deployment blocker. Geistdocs does not use the deployment-specific `VERCEL_URL` for canonical surfaces.
|
|
@@ -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
|
```
|