@vercel/geistdocs 1.12.0 → 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 (53) 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.js +1 -1
  7. package/dist/internal/provider-client.d.ts.map +1 -1
  8. package/dist/internal/provider-client.js +1 -1
  9. package/dist/internal/sidebar-responsive.d.ts +3 -0
  10. package/dist/internal/sidebar-responsive.d.ts.map +1 -0
  11. package/dist/internal/sidebar-responsive.js +10 -0
  12. package/dist/internal/sidebar-tree.d.ts +23 -0
  13. package/dist/internal/sidebar-tree.d.ts.map +1 -0
  14. package/dist/internal/sidebar-tree.js +115 -0
  15. package/dist/internal/sidebar.d.ts +2 -5
  16. package/dist/internal/sidebar.d.ts.map +1 -1
  17. package/dist/internal/sidebar.js +282 -44
  18. package/dist/internal/table-of-contents.js +1 -1
  19. package/dist/internal/ui/sheet.d.ts.map +1 -1
  20. package/dist/internal/ui/sheet.js +2 -2
  21. package/dist/layout.d.ts.map +1 -1
  22. package/dist/layout.js +1 -6
  23. package/dist/mdx.d.ts +1 -0
  24. package/dist/mdx.d.ts.map +1 -1
  25. package/dist/mobile-docs-bar.d.ts.map +1 -1
  26. package/dist/mobile-docs-bar.js +3 -3
  27. package/dist/navbar.js +1 -1
  28. package/dist/pages/docs.js +1 -1
  29. package/dist/source-config.d.ts +1 -0
  30. package/dist/source-config.d.ts.map +1 -1
  31. package/dist/source-config.js +1 -0
  32. package/dist/source.d.ts +1 -0
  33. package/dist/source.d.ts.map +1 -1
  34. package/dist/source.js +21 -2
  35. package/dist/versions.d.ts.map +1 -1
  36. package/dist/versions.js +3 -3
  37. package/docs/agents.md +2 -2
  38. package/docs/llms.txt +197 -30
  39. package/docs/manifest.json +10 -9
  40. package/docs/pages/configuration.md +3 -0
  41. package/docs/pages/getting-started.md +2 -0
  42. package/docs/pages/guides/nested-navigation.md +174 -13
  43. package/docs/pages/syntax.md +2 -1
  44. package/docs/sitemap.md +1 -1
  45. package/package.json +1 -1
  46. package/source-config.js +1 -0
  47. package/template/app/styles/geistdocs.css +8 -6
  48. package/template/content/docs/configuration.mdx +3 -0
  49. package/template/content/docs/getting-started.mdx +2 -0
  50. package/template/content/docs/guides/nested-navigation.mdx +174 -12
  51. package/template/content/docs/syntax.mdx +2 -1
  52. package/template/package.json +1 -1
  53. package/theme.css +150 -0
@@ -17,18 +17,20 @@
17
17
  }
18
18
 
19
19
  /* Align docs content with navbar on mobile */
20
- #nd-page {
21
- @apply max-md:px-6;
22
- }
23
-
24
20
  /*
25
21
  * On mobile the sticky MobileDocsBar abuts the navbar via a negative top
26
22
  * margin, which would otherwise overlap and clip the page breadcrumb rendered
27
23
  * above it. Hide the breadcrumb on mobile so the bar sits flush under the
28
24
  * navbar; it stays visible on desktop, where the bar is hidden.
29
25
  */
30
- #nd-page > .text-fd-muted-foreground:first-child {
31
- @apply max-md:hidden;
26
+ @container (max-width: 960px) {
27
+ #nd-page {
28
+ @apply px-6;
29
+ }
30
+
31
+ #nd-page > .text-fd-muted-foreground:first-child {
32
+ @apply hidden;
33
+ }
32
34
  }
33
35
 
34
36
  /* TOC and footer links use gray-1000 */
@@ -9,6 +9,7 @@ related:
9
9
  - /docs/migration
10
10
  - /docs/provider
11
11
  - /docs/env
12
+ - /docs/guides/nested-navigation
12
13
  - /docs/versioned-docs
13
14
  - /docs/proxy
14
15
  ---
@@ -38,6 +39,8 @@ Configure Geistdocs through user-owned files in the generated project. Runtime f
38
39
  | `proxy.ts` | Configures markdown negotiation, AI-agent rewrites, request tracking, and custom request hooks. |
39
40
  | `content/docs/meta.json` | Controls sidebar order and section labels. |
40
41
 
42
+ Read [Configure sidebar navigation](/docs/guides/nested-navigation) for page ordering, titled separators, folder indexes, nested folders, and custom navigation links.
43
+
41
44
  ## `geistdocs.tsx`
42
45
 
43
46
  The root `geistdocs.tsx` file is the primary configuration surface:
@@ -88,6 +88,8 @@ Use `content/docs/meta.json` to control page order and groups:
88
88
  }
89
89
  ```
90
90
 
91
+ 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.
92
+
91
93
  ## Configure the site
92
94
 
93
95
  Use `geistdocs.tsx` to customize the site shell:
@@ -1,19 +1,181 @@
1
1
  ---
2
- title: Nested navigation
3
- description: How Geistdocs builds breadcrumbs from your page tree.
2
+ title: Configure sidebar navigation
3
+ description: Organize Geistdocs pages with ordered groups, separators, folder indexes, and nested navigation
4
+ badge: Beta
4
5
  type: guide
6
+ summary: Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
7
+ prerequisites:
8
+ - /docs/getting-started
9
+ related:
10
+ - /docs/configuration
11
+ - /docs/syntax
5
12
  ---
6
13
 
7
- Any page nested inside a folder shows a breadcrumb above its title, built
8
- automatically from the page tree. This page lives under the **Guides** folder,
9
- so the breadcrumb above reads _Guides_.
14
+ 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.
10
15
 
11
- ## How it works
16
+ ## Start with the content tree
12
17
 
13
- The breadcrumb lists the folder ancestors of the current page, in order. It is
14
- rendered on the server from the page's URL and the sidebar tree, so it is
15
- present in the initial HTML — the page title never shifts once the page
16
- hydrates.
18
+ Directories become sidebar folders, and `.mdx` files become pages. The examples on this page use the following content tree:
17
19
 
18
- Top-level pages (those not inside a folder) have no ancestors, so no breadcrumb
19
- is shown.
20
+ ```text
21
+ content/docs/
22
+ ├── index.mdx
23
+ ├── getting-started.mdx
24
+ ├── architecture.mdx
25
+ ├── api-reference.mdx
26
+ ├── changelog.mdx
27
+ ├── meta.json
28
+ └── guides/
29
+ ├── index.mdx
30
+ ├── quickstarts.mdx
31
+ ├── meta.json
32
+ └── integrations/
33
+ ├── nextjs.mdx
34
+ ├── sveltekit.mdx
35
+ ├── meta.json
36
+ └── advanced/
37
+ ├── index.mdx
38
+ ├── caching.mdx
39
+ ├── security.mdx
40
+ └── meta.json
41
+ ```
42
+
43
+ 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.
44
+
45
+ ## Order top-level pages and add separators
46
+
47
+ Add page and folder names to the root `pages` array without file extensions:
48
+
49
+ ```json title="content/docs/meta.json"
50
+ {
51
+ "title": "My Product Documentation",
52
+ "root": true,
53
+ "pages": [
54
+ "index",
55
+ "getting-started",
56
+ "---Guides---",
57
+ "guides",
58
+ "---Internals---",
59
+ "architecture",
60
+ "api-reference",
61
+ "---Resources---",
62
+ "..."
63
+ ]
64
+ }
65
+ ```
66
+
67
+ This configuration produces three labeled groups after the two introductory pages:
68
+
69
+ - `---Guides---` adds a non-clickable **Guides** separator before the `guides` folder.
70
+ - `---Internals---` adds an **Internals** separator before the architecture and API reference pages.
71
+ - `---Resources---` adds a **Resources** separator before pages inserted by `...`.
72
+
73
+ 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.
74
+
75
+ 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.
76
+
77
+ ## Add a folder landing page
78
+
79
+ Create `index.mdx` inside a nested directory when the folder needs its own landing page:
80
+
81
+ ```mdx title="content/docs/guides/index.mdx"
82
+ ---
83
+ title: Guides
84
+ description: Follow task-focused guides for My Product.
85
+ ---
86
+
87
+ Choose a guide based on the workflow you want to complete.
88
+ ```
89
+
90
+ Then order the folder's child pages in its `meta.json`:
91
+
92
+ ```json title="content/docs/guides/meta.json"
93
+ {
94
+ "title": "Guides",
95
+ "pages": ["quickstarts", "integrations"]
96
+ }
97
+ ```
98
+
99
+ 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.
100
+
101
+ If you include `index` explicitly in `pages`, Geistdocs treats it as a regular child page instead of the folder landing page.
102
+
103
+ ## Configure deeply nested folders
104
+
105
+ Add another `meta.json` inside each nested directory. For the `integrations` folder from the example tree, group framework pages separately from advanced topics:
106
+
107
+ ```json title="content/docs/guides/integrations/meta.json"
108
+ {
109
+ "title": "Integrations",
110
+ "defaultOpen": true,
111
+ "pages": [
112
+ "---Frameworks---",
113
+ "nextjs",
114
+ "sveltekit",
115
+ "---Advanced---",
116
+ "advanced"
117
+ ]
118
+ }
119
+ ```
120
+
121
+ The `advanced` directory can define another level:
122
+
123
+ ```json title="content/docs/guides/integrations/advanced/meta.json"
124
+ {
125
+ "title": "Advanced Integrations",
126
+ "pages": ["caching", "security"]
127
+ }
128
+ ```
129
+
130
+ Because `advanced/index.mdx` exists and is not listed in `pages`, **Advanced Integrations** links to `/docs/guides/integrations/advanced`. Its child pages resolve to:
131
+
132
+ - `/docs/guides/integrations/advanced/caching`
133
+ - `/docs/guides/integrations/advanced/security`
134
+
135
+ 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`.
136
+
137
+ ## Add a badge to a page
138
+
139
+ Add a short `badge` value to page frontmatter to show status or availability beside its sidebar label:
140
+
141
+ ```yaml title="content/docs/guides/new-api.mdx"
142
+ ---
143
+ title: New API
144
+ description: Use the new API in your application.
145
+ badge: Beta
146
+ ---
147
+ ```
148
+
149
+ 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.
150
+
151
+ ## Add links to the navigation
152
+
153
+ The `pages` array can include internal and external links alongside content files:
154
+
155
+ ```json title="content/docs/meta.json"
156
+ {
157
+ "pages": [
158
+ "index",
159
+ "[Status](/status)",
160
+ "external:[GitHub](https://github.com/my-org/my-repo)"
161
+ ]
162
+ }
163
+ ```
164
+
165
+ 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.
166
+
167
+ ## Check breadcrumbs for nested pages
168
+
169
+ 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.
170
+
171
+ 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.
172
+
173
+ ## Troubleshoot missing navigation items
174
+
175
+ Check these rules when a page or folder does not appear where expected:
176
+
177
+ - Match each `pages` entry to a file or directory name without its extension.
178
+ - Add a `meta.json` to every folder that needs custom ordering, separators, `defaultOpen` behavior, or a title override.
179
+ - Add `...` when unlisted files and folders should remain visible.
180
+ - Leave `index` out of a nested folder's `pages` array when it should act as the folder landing page.
181
+ - Keep separator labels between three hyphens on each side, such as `---Internals---`.
@@ -23,10 +23,11 @@ Every MDX file should include frontmatter at the top:
23
23
  ---
24
24
  title: Page Title
25
25
  description: A brief description of the page content
26
+ badge: Beta
26
27
  ---
27
28
  ```
28
29
 
29
- The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews.
30
+ 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.
30
31
 
31
32
  ## Basic Markdown
32
33
 
@@ -18,7 +18,7 @@
18
18
  "@streamdown/code": "^1.0.1",
19
19
  "@vercel/agent-readability": "^0.2.1",
20
20
  "@vercel/analytics": "^1.6.1",
21
- "@vercel/geistdocs": "1.12.0",
21
+ "@vercel/geistdocs": "1.13.0",
22
22
  "@vercel/speed-insights": "^1.3.1",
23
23
  "ai": "^6.0.132",
24
24
  "class-variance-authority": "^0.7.1",
package/theme.css CHANGED
@@ -32,6 +32,13 @@
32
32
  --radius-xl: 0.75rem; /* 12px */
33
33
  --radius-2xl: 1rem; /* 16px */
34
34
 
35
+ /* Geist responsive scale */
36
+ --breakpoint-sm: 401px;
37
+ --breakpoint-md: 601px;
38
+ --breakpoint-lg: 961px;
39
+ --breakpoint-xl: 1200px;
40
+ --breakpoint-2xl: 1400px;
41
+
35
42
  --shadow-2xs: var(--ds-shadow-2xs);
36
43
  --shadow-xs: var(--ds-shadow-xs);
37
44
  --shadow-sm: var(--ds-shadow-small);
@@ -288,6 +295,9 @@
288
295
  0px 8px 16px -4px rgba(0, 0, 0, 0.04),
289
296
  0px 24px 32px -8px rgba(0, 0, 0, 0.06), var(--ds-shadow-background-border);
290
297
 
298
+ --ds-focus-ring:
299
+ 0 0 0 2px var(--ds-background-100), 0 0 0 4px var(--ds-blue-700);
300
+
291
301
  --ds-shadow-fullscreen:
292
302
  var(--ds-shadow-border-base), 0px 1px 1px rgba(0, 0, 0, 0.02),
293
303
  0px 8px 16px -4px rgba(0, 0, 0, 0.04),
@@ -443,6 +453,9 @@
443
453
  var(--ds-shadow-border-base), 0px 1px 1px rgba(0, 0, 0, 0.08),
444
454
  0px 8px 16px -4px rgba(0, 0, 0, 0.16),
445
455
  0px 24px 32px -8px rgba(0, 0, 0, 0.24), var(--ds-shadow-background-border);
456
+
457
+ --ds-focus-ring:
458
+ 0 0 0 2px var(--ds-background-100), 0 0 0 4px var(--ds-blue-900);
446
459
  }
447
460
 
448
461
  @layer base {
@@ -746,6 +759,143 @@
746
759
  border-color: var(--ds-gray-alpha-400);
747
760
  }
748
761
 
762
+ @property --geistdocs-sidebar-fade-top {
763
+ syntax: "<length>";
764
+ inherits: false;
765
+ initial-value: 0px;
766
+ }
767
+
768
+ @property --geistdocs-sidebar-fade-bottom {
769
+ syntax: "<length>";
770
+ inherits: false;
771
+ initial-value: 0px;
772
+ }
773
+
774
+ .geistdocs-sidebar-scroll {
775
+ -ms-overflow-style: none;
776
+ scrollbar-width: none;
777
+ }
778
+
779
+ .geistdocs-sidebar-scroll::-webkit-scrollbar {
780
+ display: none;
781
+ }
782
+
783
+ .geistdocs-sidebar-pane {
784
+ transition:
785
+ transform 150ms cubic-bezier(0.175, 0.885, 0.32, 1.1),
786
+ opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
787
+ }
788
+
789
+ @media (min-width: 961px) {
790
+ .geistdocs-sidebar-scroll {
791
+ --geistdocs-sidebar-fade-size: 40px;
792
+ scroll-padding-block: var(--geistdocs-sidebar-fade-size);
793
+ mask-image: linear-gradient(
794
+ to bottom,
795
+ transparent 0,
796
+ black var(--geistdocs-sidebar-fade-top),
797
+ black calc(100% - var(--geistdocs-sidebar-fade-bottom)),
798
+ transparent 100%
799
+ );
800
+ transition:
801
+ --geistdocs-sidebar-fade-top 150ms ease,
802
+ --geistdocs-sidebar-fade-bottom 150ms ease;
803
+ }
804
+
805
+ .geistdocs-sidebar-scroll[data-fade-top="true"] {
806
+ --geistdocs-sidebar-fade-top: var(--geistdocs-sidebar-fade-size);
807
+ }
808
+
809
+ .geistdocs-sidebar-scroll[data-fade-bottom="true"] {
810
+ --geistdocs-sidebar-fade-bottom: var(--geistdocs-sidebar-fade-size);
811
+ }
812
+
813
+ @supports (animation-timeline: scroll()) {
814
+ .geistdocs-sidebar-scroll {
815
+ animation:
816
+ geistdocs-sidebar-fade-top linear both,
817
+ geistdocs-sidebar-fade-bottom linear both;
818
+ animation-range:
819
+ 0 var(--geistdocs-sidebar-fade-size),
820
+ calc(100% - var(--geistdocs-sidebar-fade-size)) 100%;
821
+ animation-timeline: scroll(self), scroll(self);
822
+ }
823
+
824
+ @keyframes geistdocs-sidebar-fade-top {
825
+ to {
826
+ --geistdocs-sidebar-fade-top: var(--geistdocs-sidebar-fade-size);
827
+ }
828
+ }
829
+
830
+ @keyframes geistdocs-sidebar-fade-bottom {
831
+ from {
832
+ --geistdocs-sidebar-fade-bottom: var(--geistdocs-sidebar-fade-size);
833
+ }
834
+ }
835
+ }
836
+ }
837
+
838
+ @container (max-width: 960px) {
839
+ #nd-page > .text-fd-muted-foreground:first-child {
840
+ display: none;
841
+ }
842
+ }
843
+
844
+ [data-geistdocs-mobile-sidebar] [data-slot="sheet-header"] {
845
+ height: calc(4rem + env(safe-area-inset-top));
846
+ padding-top: env(safe-area-inset-top);
847
+ padding-right: max(1rem, env(safe-area-inset-right));
848
+ padding-left: max(1rem, env(safe-area-inset-left));
849
+ }
850
+
851
+ [data-geistdocs-mobile-sidebar] nav {
852
+ padding-right: max(0.5rem, env(safe-area-inset-right));
853
+ padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
854
+ padding-left: max(0.5rem, env(safe-area-inset-left));
855
+ }
856
+
857
+ [data-geistdocs-mobile-sidebar] [data-slot="sheet-close"] {
858
+ top: calc(1rem + env(safe-area-inset-top));
859
+ right: max(1rem, env(safe-area-inset-right));
860
+ }
861
+
862
+ [data-geistdocs-mobile-toc] [data-slot="sheet-close"] {
863
+ top: calc(1rem + env(safe-area-inset-top));
864
+ right: max(1rem, env(safe-area-inset-right));
865
+ }
866
+
867
+ [data-geistdocs-mobile-toc] [data-slot="sheet-header"] {
868
+ padding-top: max(1rem, env(safe-area-inset-top));
869
+ padding-right: max(1rem, env(safe-area-inset-right));
870
+ padding-left: max(1rem, env(safe-area-inset-left));
871
+ }
872
+
873
+ [data-geistdocs-mobile-toc] nav {
874
+ padding-right: max(1rem, env(safe-area-inset-right));
875
+ padding-bottom: max(1rem, env(safe-area-inset-bottom));
876
+ padding-left: max(1rem, env(safe-area-inset-left));
877
+ }
878
+
879
+ [data-mobile-docs-bar] {
880
+ padding-right: max(1.5rem, env(safe-area-inset-right));
881
+ padding-left: max(1.5rem, env(safe-area-inset-left));
882
+ }
883
+
884
+ @media (prefers-reduced-motion: reduce) {
885
+ .geistdocs-sidebar-pane,
886
+ .geistdocs-sidebar-scroll,
887
+ body:has([data-home-route]) header {
888
+ transition: none;
889
+ animation: none;
890
+ }
891
+ }
892
+
893
+ @media (min-width: 1200px) {
894
+ [data-mobile-toc-trigger] {
895
+ display: none;
896
+ }
897
+ }
898
+
749
899
  /* On home routes (GeistdocsHomeLayout renders the [data-home-route] marker),
750
900
  the navbar starts borderless and fades its bottom border in only once the
751
901
  page is scrolled (ScrollState toggles [data-scrolled] on <html>). */