@vercel/geistdocs 1.11.4 → 1.13.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 (63) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/controls.d.ts.map +1 -1
  3. package/dist/controls.js +7 -5
  4. package/dist/home-layout.d.ts.map +1 -1
  5. package/dist/home-layout.js +2 -7
  6. package/dist/internal/page-actions-client.d.ts +7 -3
  7. package/dist/internal/page-actions-client.d.ts.map +1 -1
  8. package/dist/internal/page-actions-client.js +82 -67
  9. package/dist/internal/provider-client.d.ts.map +1 -1
  10. package/dist/internal/provider-client.js +1 -1
  11. package/dist/internal/sidebar-responsive.d.ts +3 -0
  12. package/dist/internal/sidebar-responsive.d.ts.map +1 -0
  13. package/dist/internal/sidebar-responsive.js +10 -0
  14. package/dist/internal/sidebar-tree.d.ts +23 -0
  15. package/dist/internal/sidebar-tree.d.ts.map +1 -0
  16. package/dist/internal/sidebar-tree.js +115 -0
  17. package/dist/internal/sidebar.d.ts +2 -5
  18. package/dist/internal/sidebar.d.ts.map +1 -1
  19. package/dist/internal/sidebar.js +282 -44
  20. package/dist/internal/table-of-contents.d.ts +2 -1
  21. package/dist/internal/table-of-contents.d.ts.map +1 -1
  22. package/dist/internal/table-of-contents.js +1 -1
  23. package/dist/internal/ui/button.d.ts.map +1 -1
  24. package/dist/internal/ui/button.js +4 -4
  25. package/dist/internal/ui/dropdown-menu.js +4 -4
  26. package/dist/internal/ui/popover.js +1 -1
  27. package/dist/internal/ui/sheet.d.ts.map +1 -1
  28. package/dist/internal/ui/sheet.js +2 -2
  29. package/dist/layout.d.ts.map +1 -1
  30. package/dist/layout.js +1 -6
  31. package/dist/mdx.d.ts +1 -0
  32. package/dist/mdx.d.ts.map +1 -1
  33. package/dist/mobile-docs-bar.d.ts.map +1 -1
  34. package/dist/mobile-docs-bar.js +3 -3
  35. package/dist/navbar.js +1 -1
  36. package/dist/pages/docs.d.ts +3 -1
  37. package/dist/pages/docs.d.ts.map +1 -1
  38. package/dist/pages/docs.js +16 -10
  39. package/dist/source-config.d.ts +1 -0
  40. package/dist/source-config.d.ts.map +1 -1
  41. package/dist/source-config.js +1 -0
  42. package/dist/source.d.ts +1 -0
  43. package/dist/source.d.ts.map +1 -1
  44. package/dist/source.js +21 -2
  45. package/dist/versions.d.ts.map +1 -1
  46. package/dist/versions.js +3 -3
  47. package/docs/agents.md +2 -2
  48. package/docs/llms.txt +203 -32
  49. package/docs/manifest.json +10 -9
  50. package/docs/pages/configuration.md +9 -2
  51. package/docs/pages/getting-started.md +2 -0
  52. package/docs/pages/guides/nested-navigation.md +174 -13
  53. package/docs/pages/syntax.md +2 -1
  54. package/docs/sitemap.md +1 -1
  55. package/package.json +1 -1
  56. package/source-config.js +1 -0
  57. package/template/app/styles/geistdocs.css +8 -6
  58. package/template/content/docs/configuration.mdx +9 -2
  59. package/template/content/docs/getting-started.mdx +2 -0
  60. package/template/content/docs/guides/nested-navigation.mdx +174 -12
  61. package/template/content/docs/syntax.mdx +2 -1
  62. package/template/package.json +1 -1
  63. package/theme.css +150 -0
@@ -9,6 +9,7 @@ type SourceBundle = GeistdocsSourceBundle;
9
9
  type GeistdocsPage = NonNullable<ReturnType<SourceBundle["source"]["getPage"]>>;
10
10
  type PageActionsBundle = ReturnType<typeof createPageActions>;
11
11
  type DocsPageLink = MDXComponents["a"];
12
+ type TableOfContentOptions = NonNullable<ComponentProps<typeof FumadocsDocsPage>["tableOfContent"]>;
12
13
  interface DocsPageParams {
13
14
  lang: string;
14
15
  slug?: string[];
@@ -58,9 +59,10 @@ interface CreateDocsPageOptions {
58
59
  source: SourceBundle;
59
60
  }) => DocsPageLink;
60
61
  source: SourceBundle;
62
+ tableOfContent?: TableOfContentOptions;
61
63
  tableOfContentPopover?: ComponentProps<typeof FumadocsDocsPage>["tableOfContentPopover"];
62
64
  }
63
- export declare const createDocsPage: ({ config, source, mdx, pageActions, filterStaticParams, getPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContentPopover, }: CreateDocsPageOptions) => {
65
+ export declare const createDocsPage: ({ config, source, mdx, pageActions, filterStaticParams, getPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContent, tableOfContentPopover, }: CreateDocsPageOptions) => {
64
66
  Page: ({ params, }: {
65
67
  params: Promise<{
66
68
  lang: string;
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/pages/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,IAAI,gBAAgB,EAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAMjD,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAC1C,KAAK,aAAa,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAChF,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,KAAK,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACvC,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,KAAK,WAAW,GACZ,aAAa,GACb,CAAC,CAAC,OAAO,EAAE;IACT,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,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AC;KACpD;;oCAiJE;QACD,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAC;KACpD,KAAG,OAAO,CAAC,QAAQ,CAAC;CA2CtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAA4B,CAAC"}
@@ -1,19 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DocsBody as FumadocsDocsBody, DocsDescription as FumadocsDocsDescription, DocsPage as FumadocsDocsPage, DocsTitle as FumadocsDocsTitle, } from "fumadocs-ui/layouts/docs/page";
3
3
  import { createRelativeLink } from "fumadocs-ui/mdx";
4
4
  import { notFound } from "next/navigation";
5
5
  import { cn } from "../internal/cn";
6
6
  import { createPageActions as createInternalPageActions } from "../internal/page-actions";
7
- import { GeistdocsPageActions } from "../internal/page-actions-client";
7
+ import { GeistdocsPageActions, GeistdocsTableOfContentsActions, } from "../internal/page-actions-client";
8
8
  import { PageBreadcrumb } from "../internal/page-breadcrumb";
9
9
  import { getPageFooterItems, PageFooter } from "../internal/page-footer";
10
10
  import { getPageRobots, } from "../internal/page-visibility";
11
11
  import { GeistdocsTableOfContents } from "../internal/table-of-contents";
12
12
  import { createMdxComponents } from "../mdx";
13
- const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-4xl tracking-tight", className), ...props }));
13
+ const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-balance text-4xl tracking-tight", className), ...props }));
14
14
  const DocsDescription = (props) => _jsx(FumadocsDocsDescription, { ...props });
15
15
  const DocsBody = ({ className, ...props }) => (_jsx(FumadocsDocsBody, { className: cn("mx-auto w-full", className), ...props }));
16
- export const createDocsPage = ({ config, source, mdx, pageActions = createInternalPageActions({ config }), filterStaticParams, getPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContentPopover, }) => {
16
+ const hasTableOfContentsActions = (config, extraActions) => config.pageActions?.scrollTop !== false ||
17
+ config.feedback?.enabled !== false ||
18
+ extraActions.length > 0;
19
+ export const createDocsPage = ({ config, source, mdx, pageActions = createInternalPageActions({ config }), filterStaticParams, getPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContent, tableOfContentPopover, }) => {
17
20
  const Page = async ({ params, }) => {
18
21
  const resolvedParams = await params;
19
22
  const { slug, lang } = resolvedParams;
@@ -65,17 +68,20 @@ export const createDocsPage = ({ config, source, mdx, pageActions = createIntern
65
68
  },
66
69
  }) ?? [])
67
70
  : [];
68
- const tocFooter = (_jsx("div", { className: "mt-3 border-gray-alpha-400 border-t pt-3", children: _jsx("nav", { "aria-label": "Page actions", className: "flex min-w-0 flex-col gap-1", children: _jsx(GeistdocsPageActions, { config: pageActions.config, extraActions: footerActions, page: {
69
- path: page.path,
70
- url: pageUrl,
71
- } }) }) }));
71
+ const hasTocActions = hasTableOfContentsActions(pageActions.config, footerActions);
72
+ const tocFooter = (_jsxs(_Fragment, { children: [tableOfContent?.footer, hasTocActions ? (_jsx("div", { className: "mt-4 border-gray-alpha-400 border-t pt-4", children: _jsx("nav", { "aria-label": "Page actions", className: "flex min-w-0 flex-col gap-1", children: _jsx(GeistdocsTableOfContentsActions, { config: pageActions.config, extraActions: footerActions }) }) })) : null] }));
73
+ const tocComponent = tableOfContent?.component ?? (_jsx(GeistdocsTableOfContents, { footer: tocFooter, header: tableOfContent?.header, toc: data.toc ?? [] }));
72
74
  return (_jsxs(FumadocsDocsPage, { breadcrumb: {
73
75
  component: (_jsx(PageBreadcrumb, { tree: source.source.getPageTree(lang), url: page.url })),
74
76
  }, footer: { component: _jsx(PageFooter, { ...resolvedFooterItems }) }, full: data.full, tableOfContent: {
75
77
  enabled: true,
76
78
  single: true,
77
- component: (_jsx(GeistdocsTableOfContents, { footer: tocFooter, toc: data.toc ?? [] })),
78
- }, tableOfContentPopover: tableOfContentPopover, toc: data.toc, children: [renderTop?.({ data, markdown: markdown ?? "", page, pageUrl }), _jsx(DocsTitle, { children: data.title }), _jsx(DocsDescription, { children: data.description }), _jsx(DocsBody, { children: _jsx(MDX, { components: {
79
+ ...tableOfContent,
80
+ component: tocComponent,
81
+ }, tableOfContentPopover: tableOfContentPopover, toc: data.toc, children: [renderTop?.({ data, markdown: markdown ?? "", page, pageUrl }), _jsxs("div", { className: "flex flex-col-reverse gap-4 sm:flex-row sm:items-end sm:justify-between", children: [_jsx(DocsTitle, { className: "mb-0 min-w-0", children: data.title }), _jsx(GeistdocsPageActions, { config: pageActions.config, page: {
82
+ path: page.path,
83
+ url: pageUrl,
84
+ } })] }), _jsx(DocsDescription, { children: data.description }), _jsx(DocsBody, { children: _jsx(MDX, { components: {
79
85
  ...createMdxComponents({ a: link }),
80
86
  ...resolvedMdx,
81
87
  } }) })] }));
@@ -30,6 +30,7 @@ export declare const geistdocsFrontmatterSchema: z.ZodObject<{
30
30
  icon: z.ZodOptional<z.ZodString>;
31
31
  full: z.ZodOptional<z.ZodBoolean>;
32
32
  _openapi: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
33
+ badge: z.ZodOptional<z.ZodString>;
33
34
  product: z.ZodOptional<z.ZodString>;
34
35
  url: z.ZodOptional<z.ZodString>;
35
36
  type: z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CAoB1C,CAAC"}
1
+ {"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CAoB1C,CAAC"}
@@ -106,6 +106,7 @@ export const geistShikiTheme = {
106
106
  ],
107
107
  };
108
108
  export const geistdocsFrontmatterSchema = frontmatterSchema.extend({
109
+ badge: z.string().optional(),
109
110
  product: z.string().optional(),
110
111
  url: z
111
112
  .string()
package/dist/source.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface FumadocsCollection {
5
5
  toFumadocsSource(): LoaderOptions["source"];
6
6
  }
7
7
  export interface GeistdocsSourcePageData {
8
+ badge?: string;
8
9
  canonical?: string;
9
10
  description?: string;
10
11
  excludeFrom?: GeistdocsPageSurface[];
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEtE,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACrC,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,uBAA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CACf,SAAQ,yBAAyB;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,EAAE,yBAAyB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kCAAkC,EAAE,CAAC;CAChD;AAgCD,eAAO,MAAM,YAAY,GAAI,iDAO1B,mBAAmB;;;;;;;;yBAkBQ,aAAa;;;OAAe;;;;4BAWnB,aAAa;;;OAAe;CAiFlE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAEpE,eAAO,MAAM,uBAAuB,GAClC,QAAQ,OAAO,KACd,MAAM,IAAI,qBAKC,CAAC;AAEf,eAAO,MAAM,aAAa,GAAI,qBAAqB,oBAAoB;;;;;;;;;;;;iCAzGzC,aAAa;;;eAAe;;;;oCAWnB,aAAa;;;eAAe;;;UAkH1D,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC;CAE7C,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,gCAIpC,6BAA6B;;;;;;;;;;;;;;;iCArIF,aAAa;;;eAAe;;;;oCAWnB,aAAa;;;eAAe;;;;;;;;;;;6BAXrC,aAAa;;;WAAe;;;;gCAWnB,aAAa;;;WAAe;;;;;;;;;;6BAXrC,aAAa;;;WAAe;;;;gCAWnB,aAAa;;;WAAe;;;CA6JlE,CAAC"}
package/dist/source.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineI18n } from "fumadocs-core/i18n";
2
- import { loader } from "fumadocs-core/source";
2
+ import { loader, } from "fumadocs-core/source";
3
3
  import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
4
4
  const getLanguages = (config) => {
5
5
  const defaultLanguage = config.defaultLanguage ?? "en";
@@ -9,6 +9,21 @@ const getLanguages = (config) => {
9
9
  languages: Array.from(new Set([defaultLanguage, ...languages])),
10
10
  };
11
11
  };
12
+ const badgePageTreeTransformer = {
13
+ file(node, filePath) {
14
+ if (!filePath) {
15
+ return node;
16
+ }
17
+ const file = this.storage.read(filePath);
18
+ if (file?.format !== "page") {
19
+ return node;
20
+ }
21
+ const badge = file.data.badge;
22
+ return typeof badge === "string" && badge.length > 0
23
+ ? { ...node, badge }
24
+ : node;
25
+ },
26
+ };
12
27
  export const createSource = ({ docs, config, baseUrl = "/docs", id, label, markdown, }) => {
13
28
  const { defaultLanguage, languages } = getLanguages(config);
14
29
  const i18n = defineI18n({
@@ -19,6 +34,9 @@ export const createSource = ({ docs, config, baseUrl = "/docs", id, label, markd
19
34
  const source = loader({
20
35
  i18n,
21
36
  baseUrl,
37
+ pageTree: {
38
+ transformers: [badgePageTreeTransformer],
39
+ },
22
40
  source: docs.toFumadocsSource(),
23
41
  plugins: [lucideIconsPlugin()],
24
42
  });
@@ -34,11 +52,12 @@ export const createSource = ({ docs, config, baseUrl = "/docs", id, label, markd
34
52
  const getPageMarkdown = async (page) => {
35
53
  const data = page.data;
36
54
  const processed = await data.getText("processed");
37
- const { title, description, product, type, summary, prerequisites, related, internal, noindex, canonical, tags, keywords, excludeFrom, } = data;
55
+ const { title, description, badge, product, type, summary, prerequisites, related, internal, noindex, canonical, tags, keywords, excludeFrom, } = data;
38
56
  const frontmatter = [
39
57
  "---",
40
58
  `title: ${title}`,
41
59
  description && `description: ${description}`,
60
+ badge && `badge: ${JSON.stringify(badge)}`,
42
61
  product && `product: ${product}`,
43
62
  type && `type: ${type}`,
44
63
  summary && `summary: ${summary}`,
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.tsx"],"names":[],"mappings":"AAIA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,OAAO,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,KAAK,SAAS,CAAC;IACzE,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,KAAK,SAAS,CAAC;CACtE;AAED,UAAU,2BAA2B;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,sBAAsB,EAAE,GAAG,uBAAuB,CAAC;CAC9D;AA0ED,eAAO,MAAM,gBAAgB,GAAI,IAAI,SAAS,wBAAwB,EAAE,kCAIrE,uBAAuB,CAAC,IAAI,CAAC,WAmB/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,wCAIhC,yBAAyB,WACgD,CAAC;AAE7E,eAAO,MAAM,oBAAoB,GAAI,IAAI,SAAS,wBAAwB,EAAE,uEAOzE,yBAAyB,CAAC,IAAI,CAAC,mDA0FjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,mCAIpC,2BAA2B,4CAuB7B,CAAC"}
package/dist/versions.js CHANGED
@@ -17,7 +17,7 @@ const removeRoutePrefix = (pathname, item) => {
17
17
  : pathname;
18
18
  };
19
19
  const getVersionDescription = ({ current, version, }) => version.description ?? (current ? "Current version" : "Previous version");
20
- const SelectIcon = ({ active, children, }) => (_jsx("span", { className: cn("flex size-9 shrink-0 items-center justify-center rounded-lg border", active
20
+ const SelectIcon = ({ active, children, }) => (_jsx("span", { className: cn("flex size-9 shrink-0 items-center justify-center rounded-md border", active
21
21
  ? "border-blue-500 bg-blue-100 text-blue-900"
22
22
  : "border-gray-alpha-400 bg-gray-100 text-gray-800"), children: children }));
23
23
  const VersionIcon = ({ active }) => {
@@ -66,10 +66,10 @@ export const GeistdocsRouteSelect = ({ ariaLabel = "Select route", className, cu
66
66
  const currentDescription = currentItem
67
67
  ? getDescription({ active: true, item: currentItem })
68
68
  : null;
69
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { "aria-label": ariaLabel, className: cn("group flex w-full items-center gap-3 rounded-xl px-2 py-2 text-left outline-none transition-colors hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-blue-700", className), type: "button", children: [currentItem ? renderIcon({ active: true, item: currentItem }) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium text-gray-1000 text-sm leading-5", children: currentItem?.label ?? currentId }), currentDescription ? (_jsx("span", { className: "block truncate text-gray-800 text-sm leading-5", children: currentDescription })) : null] }), _jsx(ChevronDownIcon, { className: "size-4 shrink-0 text-gray-900 transition-transform group-data-[state=open]:rotate-180" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-(--radix-dropdown-menu-trigger-width) min-w-64 rounded-xl bg-background-100 p-1 shadow-(--ds-shadow-menu)", children: items.map((item) => {
69
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { "aria-label": ariaLabel, className: cn("group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left outline-none transition-colors duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] active:bg-gray-alpha-300 data-[state=open]:bg-gray-alpha-100 motion-reduce:transition-none", className), type: "button", children: [currentItem ? renderIcon({ active: true, item: currentItem }) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-button-14 text-gray-1000", children: currentItem?.label ?? currentId }), currentDescription ? (_jsx("span", { className: "block truncate text-gray-900 text-label-13", children: currentDescription })) : null] }), _jsx(ChevronDownIcon, { className: "size-4 shrink-0 text-gray-900 transition-transform duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] group-data-[state=open]:rotate-180 motion-reduce:transition-none" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-(--radix-dropdown-menu-trigger-width) min-w-64 rounded-xl bg-background-100 p-1 shadow-(--ds-shadow-menu)", children: items.map((item) => {
70
70
  const active = item.id === currentId;
71
71
  const description = getDescription({ active, item });
72
- return (_jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-3 rounded-lg px-2 py-2", onSelect: () => navigateToItem(item), children: [renderIcon({ active, item }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium text-gray-1000 text-sm leading-5", children: item.label }), description ? (_jsx("span", { className: "block truncate text-gray-800 text-sm leading-5", children: description })) : null] }), active ? _jsx(CheckIcon, { className: "size-4 text-blue-900" }) : null] }, item.id));
72
+ return (_jsxs(DropdownMenuItem, { "aria-current": active ? "page" : undefined, className: "flex cursor-pointer items-center gap-2 rounded-md px-2 py-2", onSelect: () => navigateToItem(item), children: [renderIcon({ active, item }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-button-14 text-gray-1000", children: item.label }), description ? (_jsx("span", { className: "block truncate text-gray-900 text-label-13", children: description })) : null] }), active ? _jsx(CheckIcon, { className: "size-4 text-blue-900" }) : null] }, item.id));
73
73
  }) })] }));
74
74
  };
75
75
  export const GeistdocsVersionSelect = ({ className, current, versions, }) => {
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.11.4 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.13.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
@@ -35,11 +35,11 @@ They are generated from `apps/template/content/docs` during the package build.
35
35
  - [.md Extension](pages/md.md): Access any documentation page as raw Markdown by appending .md or .mdx to the URL for AI tool consumption.
36
36
  - [Agent readiness](pages/agent-readiness.md): Generate /agents.md and /.well-known/mcp.json from Geistdocs config so agents can find docs, Markdown surfaces, API specs, and MCP endpoints.
37
37
  - [Ask AI](pages/ask-ai.md): An AI-powered chat assistant with context-aware search, persistent history, and suggested prompts for your documentation.
38
+ - [Configure sidebar navigation](pages/guides/nested-navigation.md): Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
38
39
  - [Edit on GitHub](pages/edit-on-github.md): A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
39
40
  - [Feedback](pages/feedback.md): An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
40
41
  - [Internationalization](pages/internationalization.md): Serve documentation in multiple languages with automatic translation via the Geistdocs CLI and Fumadocs routing.
41
42
  - [llms.txt](pages/llms-txt.md): A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
42
- - [Nested navigation](pages/guides/nested-navigation.md): How Geistdocs builds breadcrumbs from your page tree.
43
43
  - [Open in Chat](pages/open-in-chat.md): Transfer documentation context to AI chat platforms like ChatGPT, Claude, Cursor, and v0 with a single click.
44
44
  - [RSS](pages/rss.md): An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
45
45
  - [Theme-Aware Image](pages/theme-aware-image.md): A component that swaps images based on the active theme, built on top of Next.js Image.
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.11.4.
3
+ These docs are bundled with `@vercel/geistdocs` 1.13.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
@@ -18,11 +18,11 @@ They describe how to build package-backed Geistdocs sites and how to use the pac
18
18
  - [.md Extension](pages/md.md): Access any documentation page as raw Markdown by appending .md or .mdx to the URL for AI tool consumption.
19
19
  - [Agent readiness](pages/agent-readiness.md): Generate /agents.md and /.well-known/mcp.json from Geistdocs config so agents can find docs, Markdown surfaces, API specs, and MCP endpoints.
20
20
  - [Ask AI](pages/ask-ai.md): An AI-powered chat assistant with context-aware search, persistent history, and suggested prompts for your documentation.
21
+ - [Configure sidebar navigation](pages/guides/nested-navigation.md): Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
21
22
  - [Edit on GitHub](pages/edit-on-github.md): A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
22
23
  - [Feedback](pages/feedback.md): An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
23
24
  - [Internationalization](pages/internationalization.md): Serve documentation in multiple languages with automatic translation via the Geistdocs CLI and Fumadocs routing.
24
25
  - [llms.txt](pages/llms-txt.md): A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
25
- - [Nested navigation](pages/guides/nested-navigation.md): How Geistdocs builds breadcrumbs from your page tree.
26
26
  - [Open in Chat](pages/open-in-chat.md): Transfer documentation context to AI chat platforms like ChatGPT, Claude, Cursor, and v0 with a single click.
27
27
  - [RSS](pages/rss.md): An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
28
28
  - [Theme-Aware Image](pages/theme-aware-image.md): A component that swaps images based on the active theme, built on top of Next.js Image.
@@ -224,6 +224,8 @@ Use `content/docs/meta.json` to control page order and groups:
224
224
  }
225
225
  ```
226
226
 
227
+ Page and folder entries use names without extensions. A value such as `---Guides---` creates a non-clickable separator label. Read [Configure sidebar navigation](/docs/guides/nested-navigation) to add folder landing pages, deeply nested folders, custom links, and `defaultOpen` behavior.
228
+
227
229
  ## Configure the site
228
230
 
229
231
  Use `geistdocs.tsx` to customize the site shell:
@@ -768,6 +770,7 @@ related:
768
770
  - /docs/migration
769
771
  - /docs/provider
770
772
  - /docs/env
773
+ - /docs/guides/nested-navigation
771
774
  - /docs/versioned-docs
772
775
  - /docs/proxy
773
776
  ---
@@ -797,6 +800,8 @@ Configure Geistdocs through user-owned files in the generated project. Runtime f
797
800
  | `proxy.ts` | Configures markdown negotiation, AI-agent rewrites, request tracking, and custom request hooks. |
798
801
  | `content/docs/meta.json` | Controls sidebar order and section labels. |
799
802
 
803
+ Read [Configure sidebar navigation](/docs/guides/nested-navigation) for page ordering, titled separators, folder indexes, nested folders, and custom navigation links.
804
+
800
805
  ## `geistdocs.tsx`
801
806
 
802
807
  The root `geistdocs.tsx` file is the primary configuration surface:
@@ -935,7 +940,7 @@ To serve docs from the site root, use `route: "/"` in `content` and `baseUrl: "/
935
940
 
936
941
  ## Page actions
937
942
 
938
- Page actions appear below the table of contents. They are enabled by default and can be disabled through `defineConfig` in `lib/geistdocs/config.tsx`:
943
+ Content actions appear in the **Copy page** menu beside the page title. **Scroll to top** and **Give feedback** remain below the table of contents so they stay available while you read. These actions are enabled by default and can be disabled through `defineConfig` in `lib/geistdocs/config.tsx`:
939
944
 
940
945
  ```tsx title="lib/geistdocs/config.tsx"
941
946
  export const config = defineConfig({
@@ -1019,10 +1024,14 @@ const docsPage = createDocsPage({
1019
1024
  },
1020
1025
  metadata: ({ metadata }) => metadata,
1021
1026
  mdx: ({ link }) => getMDXComponents({ a: link }),
1027
+ tableOfContent: {
1028
+ header: <div className="mb-3">Above the table of contents</div>,
1029
+ footer: <div className="mt-3">Below the table of contents</div>,
1030
+ },
1022
1031
  });
1023
1032
  ```
1024
1033
 
1025
- Use `getPageUrl` when the public route differs from the source URL, such as `/v5/docs`. Set `openGraph.images` to `true` only when your site includes the Geistdocs OG route. Use `metadata` to set canonical URLs, `robots`, or custom Open Graph fields for a specific route.
1034
+ Use `getPageUrl` when the public route differs from the source URL, such as `/v5/docs`. Set `openGraph.images` to `true` only when your site includes the Geistdocs OG route. Use `metadata` to set canonical URLs, `robots`, or custom Open Graph fields for a specific route. The `tableOfContent.header` and `tableOfContent.footer` slots render immediately above and below the table of contents.
1026
1035
 
1027
1036
  ## Package-owned runtime
1028
1037
 
@@ -1064,10 +1073,11 @@ Every MDX file should include frontmatter at the top:
1064
1073
  ---
1065
1074
  title: Page Title
1066
1075
  description: A brief description of the page content
1076
+ badge: Beta
1067
1077
  ---
1068
1078
  ```
1069
1079
 
1070
- The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews.
1080
+ The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews. The optional `badge` appears beside the page label in desktop and mobile sidebar navigation.
1071
1081
 
1072
1082
  ## Basic Markdown
1073
1083
 
@@ -2374,6 +2384,194 @@ In default AI Gateway mode, Geistdocs uses `openai/gpt-4.1-mini` via the Vercel
2374
2384
  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.
2375
2385
 
2376
2386
 
2387
+ ---
2388
+
2389
+ ---
2390
+ title: Configure sidebar navigation
2391
+ description: Organize Geistdocs pages with ordered groups, separators, folder indexes, and nested navigation
2392
+ type: guide
2393
+ summary: Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
2394
+ url: /docs/guides/nested-navigation
2395
+ source: apps/template/content/docs/guides/nested-navigation.mdx
2396
+ prerequisites:
2397
+ - /docs/getting-started
2398
+ related:
2399
+ - /docs/configuration
2400
+ - /docs/syntax
2401
+ ---
2402
+
2403
+ # Configure sidebar navigation
2404
+
2405
+ Use `meta.json` files to organize the Geistdocs sidebar without changing layout components. Each `meta.json` controls the pages and folders in its own directory, so the same pattern works at every nesting level.
2406
+
2407
+ ## Start with the content tree
2408
+
2409
+ Directories become sidebar folders, and `.mdx` files become pages. The examples on this page use the following content tree:
2410
+
2411
+ ```text
2412
+ content/docs/
2413
+ ├── index.mdx
2414
+ ├── getting-started.mdx
2415
+ ├── architecture.mdx
2416
+ ├── api-reference.mdx
2417
+ ├── changelog.mdx
2418
+ ├── meta.json
2419
+ └── guides/
2420
+ ├── index.mdx
2421
+ ├── quickstarts.mdx
2422
+ ├── meta.json
2423
+ └── integrations/
2424
+ ├── nextjs.mdx
2425
+ ├── sveltekit.mdx
2426
+ ├── meta.json
2427
+ └── advanced/
2428
+ ├── index.mdx
2429
+ ├── caching.mdx
2430
+ ├── security.mdx
2431
+ └── meta.json
2432
+ ```
2433
+
2434
+ Every page needs a frontmatter `title`. Add a `description` to summarize the page. For a regular page, the frontmatter title becomes its sidebar label. Folder landing pages use the folder behavior described below.
2435
+
2436
+ ## Order top-level pages and add separators
2437
+
2438
+ Add page and folder names to the root `pages` array without file extensions:
2439
+
2440
+ ```json title="content/docs/meta.json"
2441
+ {
2442
+ "title": "My Product Documentation",
2443
+ "root": true,
2444
+ "pages": [
2445
+ "index",
2446
+ "getting-started",
2447
+ "---Guides---",
2448
+ "guides",
2449
+ "---Internals---",
2450
+ "architecture",
2451
+ "api-reference",
2452
+ "---Resources---",
2453
+ "..."
2454
+ ]
2455
+ }
2456
+ ```
2457
+
2458
+ This configuration produces three labeled groups after the two introductory pages:
2459
+
2460
+ - `---Guides---` adds a non-clickable **Guides** separator before the `guides` folder.
2461
+ - `---Internals---` adds an **Internals** separator before the architecture and API reference pages.
2462
+ - `---Resources---` adds a **Resources** separator before pages inserted by `...`.
2463
+
2464
+ The `...` entry inserts every page or folder that is not named elsewhere in the array. Place it where the remaining items should appear. Without `...`, unnamed items do not appear in that folder's sidebar navigation.
2465
+
2466
+ On desktop, top-level folders open as dedicated sidebar sections. On mobile, Geistdocs renders the same page tree as expandable nested navigation. Both layouts use the same `meta.json` files.
2467
+
2468
+ ## Add a folder landing page
2469
+
2470
+ Create `index.mdx` inside a nested directory when the folder needs its own landing page:
2471
+
2472
+ ```mdx title="content/docs/guides/index.mdx"
2473
+ ---
2474
+ title: Guides
2475
+ description: Follow task-focused guides for My Product.
2476
+ ---
2477
+
2478
+ Choose a guide based on the workflow you want to complete.
2479
+ ```
2480
+
2481
+ Then order the folder's child pages in its `meta.json`:
2482
+
2483
+ ```json title="content/docs/guides/meta.json"
2484
+ {
2485
+ "title": "Guides",
2486
+ "pages": ["quickstarts", "integrations"]
2487
+ }
2488
+ ```
2489
+
2490
+ Leave `index` out of a nested folder's `pages` array to use `index.mdx` as the folder landing page. In the desktop section view, Geistdocs exposes a top-level folder index as **Overview**. For a nested folder, the folder label links to its index while the disclosure control expands its children.
2491
+
2492
+ If you include `index` explicitly in `pages`, Geistdocs treats it as a regular child page instead of the folder landing page.
2493
+
2494
+ ## Configure deeply nested folders
2495
+
2496
+ Add another `meta.json` inside each nested directory. For the `integrations` folder from the example tree, group framework pages separately from advanced topics:
2497
+
2498
+ ```json title="content/docs/guides/integrations/meta.json"
2499
+ {
2500
+ "title": "Integrations",
2501
+ "defaultOpen": true,
2502
+ "pages": [
2503
+ "---Frameworks---",
2504
+ "nextjs",
2505
+ "sveltekit",
2506
+ "---Advanced---",
2507
+ "advanced"
2508
+ ]
2509
+ }
2510
+ ```
2511
+
2512
+ The `advanced` directory can define another level:
2513
+
2514
+ ```json title="content/docs/guides/integrations/advanced/meta.json"
2515
+ {
2516
+ "title": "Advanced Integrations",
2517
+ "pages": ["caching", "security"]
2518
+ }
2519
+ ```
2520
+
2521
+ Because `advanced/index.mdx` exists and is not listed in `pages`, **Advanced Integrations** links to `/docs/guides/integrations/advanced`. Its child pages resolve to:
2522
+
2523
+ - `/docs/guides/integrations/advanced/caching`
2524
+ - `/docs/guides/integrations/advanced/security`
2525
+
2526
+ Set `defaultOpen` to `true` when a folder should start expanded. Geistdocs also opens the folders that contain the active page, unless a folder explicitly sets `defaultOpen` to `false`.
2527
+
2528
+ ## Add a badge to a page
2529
+
2530
+ Add a short `badge` value to page frontmatter to show status or availability beside its sidebar label:
2531
+
2532
+ ```yaml title="content/docs/guides/new-api.mdx"
2533
+ ---
2534
+ title: New API
2535
+ description: Use the new API in your application.
2536
+ badge: Beta
2537
+ ---
2538
+ ```
2539
+
2540
+ Geistdocs renders the badge in desktop and mobile navigation. Badges also appear on folder landing pages because their sidebar items use the folder's `index.mdx` frontmatter. Keep badge text short so the page label has enough room to remain readable.
2541
+
2542
+ ## Add links to the navigation
2543
+
2544
+ The `pages` array can include internal and external links alongside content files:
2545
+
2546
+ ```json title="content/docs/meta.json"
2547
+ {
2548
+ "pages": [
2549
+ "index",
2550
+ "[Status](/status)",
2551
+ "external:[GitHub](https://github.com/my-org/my-repo)"
2552
+ ]
2553
+ }
2554
+ ```
2555
+
2556
+ Use `[Label](/path)` for an internal link. Prefix an external link with `external:` so Geistdocs opens it in a new tab and shows the external-link indicator.
2557
+
2558
+ ## Check breadcrumbs for nested pages
2559
+
2560
+ Geistdocs builds breadcrumbs from the same page tree. A page at `content/docs/guides/integrations/advanced/caching.mdx` receives the folder path **Guides**, **Integrations**, and **Advanced Integrations** before its page title.
2561
+
2562
+ Breadcrumbs render on the server from the page URL and sidebar tree, so they are present in the initial HTML. Top-level pages have no folder ancestors and do not render a breadcrumb.
2563
+
2564
+ ## Troubleshoot missing navigation items
2565
+
2566
+ Check these rules when a page or folder does not appear where expected:
2567
+
2568
+ - Match each `pages` entry to a file or directory name without its extension.
2569
+ - Add a `meta.json` to every folder that needs custom ordering, separators, `defaultOpen` behavior, or a title override.
2570
+ - Add `...` when unlisted files and folders should remain visible.
2571
+ - Leave `index` out of a nested folder's `pages` array when it should act as the folder landing page.
2572
+ - Keep separator labels between three hyphens on each side, such as `---Internals---`.
2573
+
2574
+
2377
2575
  ---
2378
2576
 
2379
2577
  ---
@@ -2746,33 +2944,6 @@ The llms.txt standard is a simple convention that makes documentation more acces
2746
2944
  Learn more at [llmstxt.org](https://llmstxt.org/)
2747
2945
 
2748
2946
 
2749
- ---
2750
-
2751
- ---
2752
- title: Nested navigation
2753
- description: How Geistdocs builds breadcrumbs from your page tree.
2754
- type: guide
2755
- url: /docs/guides/nested-navigation
2756
- source: apps/template/content/docs/guides/nested-navigation.mdx
2757
- ---
2758
-
2759
- # Nested navigation
2760
-
2761
- Any page nested inside a folder shows a breadcrumb above its title, built
2762
- automatically from the page tree. This page lives under the **Guides** folder,
2763
- so the breadcrumb above reads _Guides_.
2764
-
2765
- ## How it works
2766
-
2767
- The breadcrumb lists the folder ancestors of the current page, in order. It is
2768
- rendered on the server from the page's URL and the sidebar tree, so it is
2769
- present in the initial HTML — the page title never shifts once the page
2770
- hydrates.
2771
-
2772
- Top-level pages (those not inside a folder) have no ancestors, so no breadcrumb
2773
- is shown.
2774
-
2775
-
2776
2947
  ---
2777
2948
 
2778
2949
  ---
@@ -125,6 +125,15 @@
125
125
  "type": "conceptual",
126
126
  "url": "/docs/ask-ai"
127
127
  },
128
+ {
129
+ "description": "Organize Geistdocs pages with ordered groups, separators, folder indexes, and nested navigation",
130
+ "path": "pages/guides/nested-navigation.md",
131
+ "source": "apps/template/content/docs/guides/nested-navigation.mdx",
132
+ "summary": "Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.",
133
+ "title": "Configure sidebar navigation",
134
+ "type": "guide",
135
+ "url": "/docs/guides/nested-navigation"
136
+ },
128
137
  {
129
138
  "description": "Allow readers to contribute directly by editing documentation pages on GitHub",
130
139
  "path": "pages/edit-on-github.md",
@@ -161,14 +170,6 @@
161
170
  "type": "conceptual",
162
171
  "url": "/docs/llms-txt"
163
172
  },
164
- {
165
- "description": "How Geistdocs builds breadcrumbs from your page tree.",
166
- "path": "pages/guides/nested-navigation.md",
167
- "source": "apps/template/content/docs/guides/nested-navigation.mdx",
168
- "title": "Nested navigation",
169
- "type": "guide",
170
- "url": "/docs/guides/nested-navigation"
171
- },
172
173
  {
173
174
  "description": "Allow users to continue conversations in their preferred AI chat platform with a single click",
174
175
  "path": "pages/open-in-chat.md",
@@ -198,5 +199,5 @@
198
199
  }
199
200
  ],
200
201
  "source": "apps/template/content/docs",
201
- "version": "1.11.4"
202
+ "version": "1.13.0"
202
203
  }