@vercel/geistdocs 1.22.0 → 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.
Files changed (65) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/config.d.ts +2 -0
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/footer.d.ts.map +1 -1
  5. package/dist/footer.js +5 -0
  6. package/dist/home-layout.d.ts +2 -2
  7. package/dist/home-layout.d.ts.map +1 -1
  8. package/dist/home-layout.js +52 -18
  9. package/dist/internal/localized-link.js +1 -1
  10. package/dist/internal/page-actions-client.d.ts.map +1 -1
  11. package/dist/internal/page-actions-client.js +18 -2
  12. package/dist/localize-href.d.ts +6 -0
  13. package/dist/localize-href.d.ts.map +1 -0
  14. package/dist/{internal/localize-href.js → localize-href.js} +2 -5
  15. package/dist/{internal/page-visibility.d.ts → page-visibility.d.ts} +1 -1
  16. package/dist/page-visibility.d.ts.map +1 -0
  17. package/dist/pages/docs.d.ts +2 -2
  18. package/dist/pages/docs.d.ts.map +1 -1
  19. package/dist/pages/docs.js +10 -5
  20. package/dist/proxy.d.ts +1 -1
  21. package/dist/proxy.d.ts.map +1 -1
  22. package/dist/proxy.js +13 -2
  23. package/dist/routes/agents.d.ts.map +1 -1
  24. package/dist/routes/agents.js +4 -4
  25. package/dist/routes/chat.js +1 -1
  26. package/dist/routes/llms.js +1 -1
  27. package/dist/routes/not-found.d.ts +14 -0
  28. package/dist/routes/not-found.d.ts.map +1 -0
  29. package/dist/routes/not-found.js +74 -0
  30. package/dist/routes/search.js +1 -1
  31. package/dist/routes/sitemap.d.ts +1 -1
  32. package/dist/routes/sitemap.d.ts.map +1 -1
  33. package/dist/routes/sitemap.js +1 -1
  34. package/docs/agents.md +1 -1
  35. package/docs/llms.txt +8 -4
  36. package/docs/manifest.json +1 -1
  37. package/docs/pages/agent-readiness.md +1 -1
  38. package/docs/pages/env.md +2 -2
  39. package/docs/pages/md.md +2 -0
  40. package/docs/pages/proxy.md +2 -0
  41. package/package.json +13 -1
  42. package/template/app/[lang]/(home)/components/text-grid-section.tsx +25 -11
  43. package/template/app/[lang]/(home)/opengraph-image.tsx +40 -0
  44. package/template/app/[lang]/(home)/page.tsx +143 -89
  45. package/template/app/[lang]/[...not-found]/route.ts +4 -0
  46. package/template/app/[lang]/layout.tsx +7 -0
  47. package/template/app/[lang]/not-found.tsx +37 -0
  48. package/template/app/[lang]/rss.xml/route.ts +3 -4
  49. package/template/app/robots.ts +4 -4
  50. package/template/app/sitemap.ts +11 -8
  51. package/template/content/docs/agent-readiness.mdx +1 -1
  52. package/template/content/docs/env.mdx +2 -2
  53. package/template/content/docs/md.mdx +2 -0
  54. package/template/content/docs/proxy.mdx +2 -0
  55. package/template/lib/geistdocs/config.tsx +2 -0
  56. package/template/lib/geistdocs/public-path.ts +14 -0
  57. package/template/lib/geistdocs/site-url-warning.ts +10 -0
  58. package/template/lib/geistdocs/site-url.ts +33 -0
  59. package/template/next.config.ts +0 -10
  60. package/template/package.json +1 -1
  61. package/dist/internal/localize-href.d.ts +0 -9
  62. package/dist/internal/localize-href.d.ts.map +0 -1
  63. package/dist/internal/page-visibility.d.ts.map +0 -1
  64. package/template/app/[lang]/(home)/components/templates.tsx +0 -48
  65. /package/dist/{internal/page-visibility.js → page-visibility.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/routes/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,WAAW,CAAC;AAChE,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,qBAAqB,EAA2B,MAAM,WAAW,CAAC;AAKhF,UAAU,WAAW;IACnB,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAA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MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;;;;;CA4DpD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { getPublicPath } from "../config";
2
- import { isPageVisibleForSurface, } from "../internal/page-visibility";
2
+ import { isPageVisibleForSurface, } from "../page-visibility";
3
3
  import { isGeistdocsSourceBundle } from "../source";
4
4
  const DOCS_PREFIX_PATTERN = /^\/docs\/?/;
5
5
  const WHITESPACE_PATTERN = /\s+/;
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.22.0 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.23.0 so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Documentation
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.22.0.
3
+ These docs are bundled with `@vercel/geistdocs` 1.23.0.
4
4
  They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
5
5
 
6
6
  ## Documentation Index
@@ -314,9 +314,9 @@ The Vertex deployment does not need a Geistdocs-specific environment variable. A
314
314
 
315
315
  ## `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL`
316
316
 
317
- The production URL of the Geistdocs site. This is automatically set when deploying to Vercel.
317
+ 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.
318
318
 
319
- It should be in the format `localhost:3000` (i.e. without the protocol prefix). This is how Vercel sets the environment variable when deploying to a project.
319
+ 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.
320
320
 
321
321
 
322
322
  ---
@@ -2099,6 +2099,8 @@ const proxy = createProxy({
2099
2099
 
2100
2100
  Define `content` sections in `lib/geistdocs/config.tsx` to infer standard Markdown route mappings from each section route. The package still serves `/llms.txt` and individual page Markdown through route helpers; the proxy uses these mappings for `.md`, `.mdx`, `Accept: text/markdown`, and AI-agent requests.
2101
2101
 
2102
+ When `agent` metadata is configured, a request to the homepage with `Accept: text/markdown` returns the generated `/agents.md` content. This gives agents a product overview and focused discovery links without treating every application route as documentation.
2103
+
2102
2104
  Geistdocs does not infer Markdown mappings for `content` sections with `route: "/"`. A root catch-all such as `/*path` can make a homepage or other application routes look like documentation. Use explicit `markdownRoutes` for root-mounted docs.
2103
2105
 
2104
2106
  ```tsx title="lib/geistdocs/config.tsx"
@@ -2304,6 +2306,8 @@ When a Markdown request does not match a page, Geistdocs returns an agent-readab
2304
2306
 
2305
2307
  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.
2306
2308
 
2309
+ Generated projects also include a catch-all route for unknown application paths outside configured documentation sections. It returns a concise Markdown 404 with links to the docs, `sitemap.md`, and `llms.txt` for agent or `Accept: text/markdown` requests. Browser requests receive the same recovery links as HTML.
2310
+
2307
2311
  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.
2308
2312
 
2309
2313
  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:
@@ -2343,7 +2347,7 @@ Geistdocs can generate `/agents.md` and `/.well-known/mcp.json` discovery files
2343
2347
 
2344
2348
  ## What it provides
2345
2349
 
2346
- 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.
2350
+ 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.
2347
2351
 
2348
2352
  It can include:
2349
2353
 
@@ -208,5 +208,5 @@
208
208
  }
209
209
  ],
210
210
  "source": "apps/template/content/docs",
211
- "version": "1.22.0"
211
+ "version": "1.23.0"
212
212
  }
@@ -19,7 +19,7 @@ Geistdocs can generate `/agents.md` and `/.well-known/mcp.json` discovery files
19
19
 
20
20
  ## What it provides
21
21
 
22
- 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.
22
+ 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.
23
23
 
24
24
  It can include:
25
25
 
package/docs/pages/env.md CHANGED
@@ -57,6 +57,6 @@ The Vertex deployment does not need a Geistdocs-specific environment variable. A
57
57
 
58
58
  ## `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL`
59
59
 
60
- The production URL of the Geistdocs site. This is automatically set when deploying to Vercel.
60
+ 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.
61
61
 
62
- It should be in the format `localhost:3000` (i.e. without the protocol prefix). This is how Vercel sets the environment variable when deploying to a project.
62
+ 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.
package/docs/pages/md.md CHANGED
@@ -95,6 +95,8 @@ When a Markdown request does not match a page, Geistdocs returns an agent-readab
95
95
 
96
96
  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.
97
97
 
98
+ Generated projects also include a catch-all route for unknown application paths outside configured documentation sections. It returns a concise Markdown 404 with links to the docs, `sitemap.md`, and `llms.txt` for agent or `Accept: text/markdown` requests. Browser requests receive the same recovery links as HTML.
99
+
98
100
  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.
99
101
 
100
102
  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:
@@ -89,6 +89,8 @@ const proxy = createProxy({
89
89
 
90
90
  Define `content` sections in `lib/geistdocs/config.tsx` to infer standard Markdown route mappings from each section route. The package still serves `/llms.txt` and individual page Markdown through route helpers; the proxy uses these mappings for `.md`, `.mdx`, `Accept: text/markdown`, and AI-agent requests.
91
91
 
92
+ When `agent` metadata is configured, a request to the homepage with `Accept: text/markdown` returns the generated `/agents.md` content. This gives agents a product overview and focused discovery links without treating every application route as documentation.
93
+
92
94
  Geistdocs does not infer Markdown mappings for `content` sections with `route: "/"`. A root catch-all such as `/*path` can make a homepage or other application routes look like documentation. Use explicit `markdownRoutes` for root-mounted docs.
93
95
 
94
96
  ```tsx title="lib/geistdocs/config.tsx"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/geistdocs",
3
3
  "description": "Runtime and CLI for Geistdocs projects.",
4
- "version": "1.22.0",
4
+ "version": "1.23.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -34,10 +34,18 @@
34
34
  "types": "./dist/layout.d.ts",
35
35
  "default": "./dist/layout.js"
36
36
  },
37
+ "./localize-href": {
38
+ "types": "./dist/localize-href.d.ts",
39
+ "default": "./dist/localize-href.js"
40
+ },
37
41
  "./navbar": {
38
42
  "types": "./dist/navbar.d.ts",
39
43
  "default": "./dist/navbar.js"
40
44
  },
45
+ "./page-visibility": {
46
+ "types": "./dist/page-visibility.d.ts",
47
+ "default": "./dist/page-visibility.js"
48
+ },
41
49
  "./footer": {
42
50
  "types": "./dist/footer.d.ts",
43
51
  "default": "./dist/footer.js"
@@ -94,6 +102,10 @@
94
102
  "types": "./dist/routes/mcp.d.ts",
95
103
  "default": "./dist/routes/mcp.js"
96
104
  },
105
+ "./routes/not-found": {
106
+ "types": "./dist/routes/not-found.d.ts",
107
+ "default": "./dist/routes/not-found.js"
108
+ },
97
109
  "./proxy": {
98
110
  "types": "./dist/proxy.d.ts",
99
111
  "default": "./dist/proxy.js"
@@ -4,17 +4,31 @@ interface TextGridSectionProps {
4
4
  title: string;
5
5
  description: string;
6
6
  }[];
7
+ description: string;
8
+ title: string;
7
9
  }
8
10
 
9
- export const TextGridSection = ({ data }: TextGridSectionProps) => (
10
- <div className="grid @min-[768px]:grid-cols-4 gap-8 @min-[640px]:py-12 py-8">
11
- {data.map((item) => (
12
- <div key={item.id}>
13
- <h3 className="mb-2 font-[450] text-gray-1000 text-heading-20 tracking-tight">
14
- {item.title}
15
- </h3>
16
- <p className="text-copy-16 text-gray-900">{item.description}</p>
17
- </div>
18
- ))}
19
- </div>
11
+ export const TextGridSection = ({
12
+ data,
13
+ description,
14
+ title,
15
+ }: TextGridSectionProps) => (
16
+ <section className="grid gap-8 @min-[640px]:py-12 py-8">
17
+ <div className="grid max-w-3xl gap-2 text-balance">
18
+ <h2 className="font-[450]! @min-[1024px]:text-[40px] @min-[640px]:text-2xl @min-[768px]:text-3xl text-gray-1000 text-xl tracking-tighter">
19
+ {title}
20
+ </h2>
21
+ <p className="text-gray-900 text-lg">{description}</p>
22
+ </div>
23
+ <div className="grid @min-[768px]:grid-cols-4 gap-8">
24
+ {data.map((item) => (
25
+ <div key={item.id}>
26
+ <h3 className="mb-2 font-[450] text-gray-1000 text-heading-20 tracking-tight">
27
+ {item.title}
28
+ </h3>
29
+ <p className="text-copy-16 text-gray-900">{item.description}</p>
30
+ </div>
31
+ ))}
32
+ </div>
33
+ </section>
20
34
  );
@@ -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 metadata: Metadata = {
25
- title,
26
- description,
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
- const templates = [
30
- {
31
- title: "Template 1",
32
- description: "Description of template 1",
33
- link: "https://example.com/template-1",
34
- image: "https://placehold.co/600x400.png",
35
- },
36
- {
37
- title: "Template 2",
38
- description: "Description of template 2",
39
- link: "https://example.com/template-2",
40
- image: "https://placehold.co/600x400.png",
41
- },
42
- {
43
- title: "Template 3",
44
- description: "Description of template 3",
45
- link: "https://example.com/template-3",
46
- image: "https://placehold.co/600x400.png",
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: "1",
53
- title: "Text Grid Section",
54
- description: "Description of text grid section",
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: "2",
58
- title: "Text Grid Section",
59
- description: "Description of text grid section",
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: "3",
63
- title: "Text Grid Section",
64
- description: "Description of text grid section",
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: "4",
68
- title: "Text Grid Section",
69
- description: "Description of text grid section",
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
- <div className="mx-auto w-full max-w-[1448px] px-4 sm:px-6">
78
- <Hero
79
- badge="Geistdocs is now in beta"
80
- description={description}
81
- title={title}
82
- >
83
- <CommandPromptRoot defaultValue="humans">
84
- <CommandPromptList>
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
- <div className="aspect-video rounded-lg border bg-background-100" />
120
- </OneTwoSection>
121
- <Templates
122
- data={templates}
123
- description="See Geistdocs in action with one of our templates."
124
- title="Get started quickly"
125
- />
126
- <CTA cta="Get started" href="/docs" title="Start your docs today" />
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
- </div>
129
- );
182
+ );
183
+ };
130
184
 
131
185
  export default HomePage;
@@ -0,0 +1,4 @@
1
+ import { createNotFoundRoute } from "@vercel/geistdocs/routes/not-found";
2
+ import { config } from "@/lib/geistdocs/config";
3
+
4
+ export const { GET } = createNotFoundRoute({ config });
@@ -1,16 +1,23 @@
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";
7
9
  import { i18n } from "@/lib/geistdocs/i18n";
8
10
  import { getRootLang } from "@/lib/geistdocs/root-params";
11
+ import { isSiteUrlConfigured, siteUrl } from "@/lib/geistdocs/site-url";
9
12
  import { cn } from "@/lib/utils";
10
13
 
11
14
  export const generateStaticParams = () =>
12
15
  i18n.languages.map((lang) => ({ lang }));
13
16
 
17
+ export const metadata: Metadata = {
18
+ metadataBase: isSiteUrlConfigured ? siteUrl : undefined,
19
+ };
20
+
14
21
  const Layout = async ({ children }: LayoutProps<"/[lang]">) => {
15
22
  const lang = await getRootLang();
16
23
 
@@ -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;
@@ -4,12 +4,11 @@ import { cacheLife } from "next/cache";
4
4
  import type { NextRequest } from "next/server";
5
5
  import { title } from "@/geistdocs";
6
6
  import { config } from "@/lib/geistdocs/config";
7
+ import { absoluteUrl } from "@/lib/geistdocs/site-url";
7
8
  import { source } from "@/lib/geistdocs/source";
8
9
 
9
- const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
10
- const baseUrl = `${protocol}://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`;
11
10
  const sitePath = getPublicPath("/", config.basePath);
12
- const siteUrl = sitePath === "/" ? baseUrl : `${baseUrl}${sitePath}`;
11
+ const siteUrl = absoluteUrl(sitePath);
13
12
 
14
13
  // biome-ignore lint/suspicious/useAwait: Next.js requires cached functions to be async.
15
14
  const getFeed = async (lang: string) => {
@@ -35,7 +34,7 @@ const getFeed = async (lang: string) => {
35
34
  id: page.url,
36
35
  title: data.title ?? page.url,
37
36
  description: data.description,
38
- link: `${baseUrl}${getPublicPath(page.url, config.basePath)}`,
37
+ link: absoluteUrl(getPublicPath(page.url, config.basePath)),
39
38
  date: new Date(data.lastModified ?? new Date()),
40
39
  author: [
41
40
  {
@@ -1,7 +1,7 @@
1
+ import { getPublicPath } from "@vercel/geistdocs/config";
1
2
  import type { MetadataRoute } from "next";
2
-
3
- const protocol = process.env.NODE_ENV === "production" ? "https" : "http";
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: `${baseUrl}/sitemap.xml`,
12
+ sitemap: absoluteUrl(getPublicPath("/sitemap.xml", config.basePath)),
13
13
  };
14
14
  }