@vercel/geistdocs 1.15.3 → 1.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/internal/navbar/mobile-menu.d.ts +4 -1
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
- package/dist/internal/navbar/mobile-menu.js +11 -6
- package/dist/internal/navbar/navbar-logo.d.ts +8 -0
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
- package/dist/internal/navbar/navbar-logo.js +86 -14
- package/dist/internal/page-actions-client.d.ts +7 -1
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +35 -16
- package/dist/internal/search.d.ts.map +1 -1
- package/dist/internal/search.js +1 -1
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +1 -1
- package/dist/internal/table-of-contents.d.ts.map +1 -1
- package/dist/internal/table-of-contents.js +1 -1
- package/dist/internal/toc-items.d.ts +3 -0
- package/dist/internal/toc-items.d.ts.map +1 -0
- package/dist/internal/toc-items.js +86 -0
- package/dist/internal/ui/drawer.js +1 -1
- package/dist/internal/ui/sheet.d.ts +4 -1
- package/dist/internal/ui/sheet.d.ts.map +1 -1
- package/dist/internal/ui/sheet.js +2 -2
- package/dist/mobile-docs-bar.d.ts.map +1 -1
- package/dist/mobile-docs-bar.js +22 -3
- package/dist/navbar.d.ts +1 -1
- package/dist/navbar.d.ts.map +1 -1
- package/dist/navbar.js +7 -5
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +6 -2
- package/docs/agents.md +2 -1
- package/docs/llms.txt +67 -1
- package/docs/manifest.json +10 -1
- package/docs/pages/table-of-contents.md +61 -0
- package/docs/sitemap.md +1 -0
- package/package.json +4 -3
- package/template/content/docs/table-of-contents.mdx +57 -0
- package/template/next.config.ts +34 -0
- package/template/package.json +2 -2
- package/template/public/favicon.development.ico +0 -0
- package/template/public/favicon.preview.ico +0 -0
- package/theme.css +20 -17
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { TOCItem as TOCItemLink, useActiveAnchors, } from "fumadocs-core/toc";
|
|
4
|
+
import { useTOCItems } from "fumadocs-ui/components/toc/index";
|
|
5
|
+
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
6
|
+
import { cn } from "./cn";
|
|
7
|
+
// Text indentation per heading depth; the guide rail stays straight.
|
|
8
|
+
const getItemOffset = (depth) => {
|
|
9
|
+
if (depth <= 2) {
|
|
10
|
+
return 14;
|
|
11
|
+
}
|
|
12
|
+
if (depth === 3) {
|
|
13
|
+
return 26;
|
|
14
|
+
}
|
|
15
|
+
return 36;
|
|
16
|
+
};
|
|
17
|
+
// Ignore programmatic scrolling this long after a click/deep-link so the jump
|
|
18
|
+
// to the anchor does not immediately release the selection.
|
|
19
|
+
const ANCHOR_SCROLL_MS = 600;
|
|
20
|
+
const TOCItem = ({ item, active, onSelect, }) => (_jsx(TOCItemLink, { className: "prose wrap-anywhere border-fd-foreground/10 border-s py-1.5 text-fd-muted-foreground text-sm transition-colors first:pt-0 last:pb-0 hover:text-fd-accent-foreground data-[active=true]:border-fd-primary data-[active=true]:text-fd-primary", "data-active": active ? "true" : undefined, href: item.url, onClick: onSelect, style: { paddingInlineStart: getItemOffset(item.depth) }, children: item.title }));
|
|
21
|
+
export const TOCItems = ({ className, ...props }) => {
|
|
22
|
+
const items = useTOCItems();
|
|
23
|
+
const anchors = useActiveAnchors();
|
|
24
|
+
// Trailing headings never reach the top of the viewport, so scroll tracking
|
|
25
|
+
// misses them. Fall back to the clicked/deep-linked hash, and to the last
|
|
26
|
+
// heading once the reader hits the bottom of a scrollable page.
|
|
27
|
+
const [selected, setSelected] = useState(null);
|
|
28
|
+
const [atBottom, setAtBottom] = useState(false);
|
|
29
|
+
const ignoreScroll = useRef(false);
|
|
30
|
+
const ignoreTimer = useRef(undefined);
|
|
31
|
+
const select = useCallback((id) => {
|
|
32
|
+
setSelected(id);
|
|
33
|
+
if (!id) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
ignoreScroll.current = true;
|
|
37
|
+
clearTimeout(ignoreTimer.current);
|
|
38
|
+
ignoreTimer.current = setTimeout(() => {
|
|
39
|
+
ignoreScroll.current = false;
|
|
40
|
+
}, ANCHOR_SCROLL_MS);
|
|
41
|
+
}, []);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const syncFromHash = () => select(window.location.hash.slice(1) || null);
|
|
44
|
+
const updateAtBottom = () => {
|
|
45
|
+
const doc = document.documentElement;
|
|
46
|
+
const scrollable = doc.scrollHeight - window.innerHeight > 4;
|
|
47
|
+
setAtBottom(scrollable &&
|
|
48
|
+
window.scrollY + window.innerHeight >= doc.scrollHeight - 2);
|
|
49
|
+
};
|
|
50
|
+
// Any real scroll — wheel, touch, keyboard, or scrollbar drag — hands the
|
|
51
|
+
// indicator back to viewport-based tracking, unless it is the programmatic
|
|
52
|
+
// jump from a click/deep-link.
|
|
53
|
+
const onScroll = () => {
|
|
54
|
+
updateAtBottom();
|
|
55
|
+
if (!ignoreScroll.current) {
|
|
56
|
+
setSelected(null);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
syncFromHash();
|
|
60
|
+
updateAtBottom();
|
|
61
|
+
window.addEventListener("hashchange", syncFromHash);
|
|
62
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
63
|
+
window.addEventListener("resize", updateAtBottom);
|
|
64
|
+
return () => {
|
|
65
|
+
clearTimeout(ignoreTimer.current);
|
|
66
|
+
window.removeEventListener("hashchange", syncFromHash);
|
|
67
|
+
window.removeEventListener("scroll", onScroll);
|
|
68
|
+
window.removeEventListener("resize", updateAtBottom);
|
|
69
|
+
};
|
|
70
|
+
}, [select]);
|
|
71
|
+
const lastId = items.at(-1)?.url.slice(1) ?? null;
|
|
72
|
+
return (_jsx("div", { className: cn("flex flex-col", className), ...props, children: items.map((item) => {
|
|
73
|
+
const id = item.url.slice(1);
|
|
74
|
+
let active;
|
|
75
|
+
if (selected) {
|
|
76
|
+
active = selected === id;
|
|
77
|
+
}
|
|
78
|
+
else if (atBottom) {
|
|
79
|
+
active = id === lastId;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
active = anchors.includes(id);
|
|
83
|
+
}
|
|
84
|
+
return (_jsx(TOCItem, { active: active, item: item, onSelect: () => select(id) }, item.url));
|
|
85
|
+
}) }));
|
|
86
|
+
};
|
|
@@ -15,5 +15,5 @@ export function DrawerDescription({ className, ...props }) {
|
|
|
15
15
|
return (_jsx(DrawerPrimitive.Description, { className: cn("text-gray-800 text-sm", className), "data-slot": "drawer-description", ...props }));
|
|
16
16
|
}
|
|
17
17
|
export function DrawerContent({ className, children, ...props }) {
|
|
18
|
-
return (_jsxs(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", children: [_jsx(DrawerPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-
|
|
18
|
+
return (_jsxs(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", children: [_jsx(DrawerPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background-100/80 data-[state=closed]:animate-out data-[state=open]:animate-in", "data-slot": "drawer-overlay" }), _jsxs(DrawerPrimitive.Content, { className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background-100", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className), "data-slot": "drawer-content", ...props, children: [_jsx("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-gray-100 group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children] })] }));
|
|
19
19
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
2
2
|
import type { ComponentProps } from "react";
|
|
3
3
|
export declare function Sheet(props: ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function SheetContent({ className, children, side, ...props }: ComponentProps<typeof SheetPrimitive.Content> & {
|
|
4
|
+
export declare function SheetContent({ className, children, side, overlay, ...props }: ComponentProps<typeof SheetPrimitive.Content> & {
|
|
5
5
|
side?: "top" | "right" | "bottom" | "left";
|
|
6
|
+
/** Render the dimmed backdrop. Disable for full-width sheets that already
|
|
7
|
+
cover the page (nothing shows behind them). */
|
|
8
|
+
overlay?: boolean;
|
|
6
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export declare function SheetHeader({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export declare function SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAEtE;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,IAAc,EACd,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG;IACjD,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/internal/ui/sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAEtE;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,QAAQ,EACR,IAAc,EACd,OAAc,EACd,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG;IACjD,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C;sDACkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAoCA;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,2CAQ7C;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,2CAQnD"}
|
|
@@ -6,8 +6,8 @@ import { cn } from "../cn";
|
|
|
6
6
|
export function Sheet(props) {
|
|
7
7
|
return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
8
8
|
}
|
|
9
|
-
export function SheetContent({ className, children, side = "right", ...props }) {
|
|
10
|
-
return (_jsxs(SheetPrimitive.Portal, { "data-slot": "sheet-portal", children: [_jsx(SheetPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-
|
|
9
|
+
export function SheetContent({ className, children, side = "right", overlay = true, ...props }) {
|
|
10
|
+
return (_jsxs(SheetPrimitive.Portal, { "data-slot": "sheet-portal", children: [overlay ? (_jsx(SheetPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background-100/80 duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none", "data-slot": "sheet-overlay" })) : null, _jsxs(SheetPrimitive.Content, { className: cn("fixed z-50 flex flex-col gap-4 bg-background-100 shadow-[var(--ds-shadow-modal)] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none", side === "right" &&
|
|
11
11
|
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", side === "left" &&
|
|
12
12
|
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", side === "top" &&
|
|
13
13
|
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", side === "bottom" &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-docs-bar.d.ts","sourceRoot":"","sources":["../src/mobile-docs-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"mobile-docs-bar.d.ts","sourceRoot":"","sources":["../src/mobile-docs-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAQzD,UAAU,kBAAkB;IAC1B,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB;AAcD,eAAO,MAAM,aAAa,GAAI,SAAS,kBAAkB,4CA0ExD,CAAC"}
|
package/dist/mobile-docs-bar.js
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useActiveAnchors } from "fumadocs-core/toc";
|
|
3
4
|
import { useState } from "react";
|
|
4
5
|
import { IconFileText } from "./assets/icons/icon-file-text";
|
|
5
6
|
import { IconMenuAlt } from "./assets/icons/icon-menu-alt";
|
|
6
|
-
import {
|
|
7
|
-
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./internal/ui/sheet";
|
|
7
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./internal/ui/popover";
|
|
8
8
|
import { useGeistdocsSidebar } from "./sidebar";
|
|
9
|
+
// Text indentation per heading depth. Top-level items sit flush with the
|
|
10
|
+
// header; deeper headings indent to show nesting.
|
|
11
|
+
const getItemOffset = (depth) => {
|
|
12
|
+
if (depth <= 2) {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
if (depth === 3) {
|
|
16
|
+
return 12;
|
|
17
|
+
}
|
|
18
|
+
return 24;
|
|
19
|
+
};
|
|
9
20
|
export const MobileDocsBar = ({ toc }) => {
|
|
10
21
|
const { isOpen: sidebarOpen, setIsOpen: setSidebarOpen } = useGeistdocsSidebar();
|
|
11
22
|
const [tocOpen, setTocOpen] = useState(false);
|
|
12
|
-
|
|
23
|
+
const activeAnchors = useActiveAnchors();
|
|
24
|
+
const hasToc = Boolean(toc && toc.length > 0);
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "sticky top-16 z-30 -mx-6 -mt-6 mb-6 flex @min-[961px]:hidden h-[54px] items-center border-b bg-background-200 px-6", "data-mobile-docs-bar": true, children: _jsxs("button", { "aria-expanded": sidebarOpen, "aria-haspopup": "dialog", className: "-ml-2 flex min-h-8 touch-manipulation items-center gap-3 rounded-md px-2 text-gray-1000 text-label-16 transition-colors hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:bg-gray-alpha-300 motion-reduce:transition-none", onClick: () => setSidebarOpen(true), type: "button", children: [_jsx(IconMenuAlt, { size: 16 }), "Menu"] }) }), hasToc ? (_jsx("div", { className: "pointer-events-none sticky top-[calc(4rem+70px)] z-30 -mb-12 flex @min-[961px]:hidden justify-end", children: _jsxs(Popover, { onOpenChange: setTocOpen, open: tocOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { "aria-label": "Table of contents", className: "pointer-events-auto flex size-8 touch-manipulation items-center justify-center rounded-md bg-background-100 text-gray-900 shadow-[var(--ds-shadow-border)] transition-colors hover:border-gray-alpha-500 hover:text-gray-1000 focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none active:border-gray-alpha-600 data-[state=open]:border-gray-alpha-600 data-[state=open]:text-gray-1000 motion-reduce:transition-none", "data-mobile-toc-trigger": true, type: "button", children: _jsx(IconFileText, { size: 16 }) }) }), _jsx(PopoverContent, { align: "end", className: "w-64 overflow-hidden p-0", "data-geistdocs-mobile-toc": true, sideOffset: 8, children: _jsxs("div", { className: "max-h-[min(50vh,20rem)] overflow-y-auto overscroll-contain p-4", children: [_jsx("p", { className: "mb-2 font-medium text-gray-1000 text-xs uppercase tracking-wider", children: "On this page" }), _jsx("nav", { className: "flex flex-col", children: toc?.map((item) => {
|
|
26
|
+
const id = item.url.slice(1);
|
|
27
|
+
const active = activeAnchors.includes(id);
|
|
28
|
+
return (_jsx("a", { className: "wrap-anywhere block py-1.5 text-fd-muted-foreground text-sm transition-colors first:pt-0 last:pb-0 hover:text-fd-accent-foreground focus-visible:shadow-[var(--ds-focus-ring)] focus-visible:outline-none data-[active=true]:text-fd-primary motion-reduce:transition-none", "data-active": active ? "true" : undefined, href: item.url, onClick: () => setTocOpen(false), style: {
|
|
29
|
+
paddingInlineStart: getItemOffset(item.depth),
|
|
30
|
+
}, children: item.title }, item.url));
|
|
31
|
+
}) })] }) })] }) })) : null] }));
|
|
13
32
|
};
|
package/dist/navbar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GeistdocsConfig } from "./config";
|
|
2
2
|
interface NavbarProps {
|
|
3
|
-
config: Pick<GeistdocsConfig, "github" | "logo" | "nav" | "navbarGithub" | "navbarOssProducts" | "navbarVariant">;
|
|
3
|
+
config: Pick<GeistdocsConfig, "github" | "logo" | "nav" | "navbarActiveProduct" | "navbarGithub" | "navbarOssProducts" | "navbarVariant">;
|
|
4
4
|
}
|
|
5
5
|
export declare const Navbar: ({ config }: NavbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
package/dist/navbar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAOhD,UAAU,WAAW;IACnB,MAAM,EAAE,IAAI,CACV,eAAe,EACb,QAAQ,GACR,MAAM,GACN,KAAK,GACL,qBAAqB,GACrB,cAAc,GACd,mBAAmB,GACnB,eAAe,CAClB,CAAC;CACH;AAKD,eAAO,MAAM,MAAM,GAAI,YAAY,WAAW,4CAkE7C,CAAC"}
|
package/dist/navbar.js
CHANGED
|
@@ -3,15 +3,17 @@ import { AskAIButton, SearchButton } from "./controls";
|
|
|
3
3
|
import { GitHubButton, getGithubRepoUrl } from "./internal/github-button";
|
|
4
4
|
import { DesktopMenu } from "./internal/navbar/desktop-menu";
|
|
5
5
|
import { MobileMenu } from "./internal/navbar/mobile-menu";
|
|
6
|
-
import {
|
|
6
|
+
import { NavbarLogo } from "./internal/navbar/navbar-logo";
|
|
7
7
|
const SEARCH_BUTTON_CLASSES = "group hidden h-10 justify-between pr-1.5 text-gray-900 shadow-none @min-[1024px]:flex @min-[1024px]:h-8 @min-[1024px]:w-[150px] [&_[data-slot=kbd]]:transition-colors group-hover:[&_[data-slot=kbd]]:text-gray-1000";
|
|
8
8
|
export const Navbar = ({ config }) => {
|
|
9
9
|
const nav = config.nav ?? [];
|
|
10
10
|
const variant = config.navbarVariant ?? "oss";
|
|
11
|
+
const isOss = variant === "oss";
|
|
11
12
|
const showGithub = config.navbarGithub?.enabled !== false;
|
|
12
13
|
const githubUrl = showGithub ? getGithubRepoUrl(config.github) : null;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
// The default product list lives in a "use client" module, so it can only be
|
|
15
|
+
// resolved and filtered inside the client menus below. Pass the raw custom
|
|
16
|
+
// list (if any) and the active product down; each menu drops the active one.
|
|
17
|
+
const activeProduct = config.navbarActiveProduct;
|
|
18
|
+
return (_jsx("header", { className: "sticky top-0 z-40 flex h-16 justify-center border-b bg-background-200", children: _jsxs("div", { className: "@container mx-auto flex w-full max-w-[1448px] justify-between px-2", children: [_jsxs("div", { className: "flex select-none flex-row items-center", children: [isOss ? (_jsx(NavbarLogo, { activeProduct: activeProduct, className: "ml-4", logo: config.logo, ossProducts: config.navbarOssProducts, variant: "oss" })) : (_jsx(NavbarLogo, { className: "ml-4", logo: config.logo, variant: "standard" })), _jsx(DesktopMenu, { className: "@min-[1024px]:flex hidden", items: nav })] }), _jsxs("div", { className: "mr-4 flex flex-row items-center justify-end gap-2", children: [_jsx(SearchButton, { className: SEARCH_BUTTON_CLASSES }), _jsx(AskAIButton, { className: "@min-[768px]:flex hidden shrink-0 shadow-none", size: "sm", variant: "outline" }), _jsx(AskAIButton, { className: "@min-[768px]:hidden shadow-none", size: "sm", variant: "outline" }), showGithub ? (_jsx(GitHubButton, { className: "@min-[768px]:inline-flex hidden shrink-0", github: config.github })) : null, _jsx(MobileMenu, { activeProduct: activeProduct, githubUrl: githubUrl, nav: nav, ossProducts: config.navbarOssProducts, showOss: isOss })] })] }) }));
|
|
17
19
|
};
|
package/dist/pages/docs.d.ts.map
CHANGED
|
@@ -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,EAAE,KAAK,eAAe,EAA+B,MAAM,WAAW,CAAC;AAU9E,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAE1C,KAAK,aAAa,GA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AY,CAAC;KACtB,KAAK,YAAY,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,qBAAqB,CAAC,EAAE,cAAc,CACpC,OAAO,gBAAgB,CACxB,CAAC,uBAAuB,CAAC,CAAC;CAC5B;AA+BD,eAAO,MAAM,cAAc,GAAI,6LAe5B,qBAAqB;wBAoBnB;QACD,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAC;KACpD;;oCA2KE;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;CAiDtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAA4B,CAAC"}
|
package/dist/pages/docs.js
CHANGED
|
@@ -108,11 +108,15 @@ export const createDocsPage = ({ config, source, mdx, pageActions = createIntern
|
|
|
108
108
|
page,
|
|
109
109
|
pageUrl,
|
|
110
110
|
publicPageUrl,
|
|
111
|
-
}), _jsxs("div", { className: "flex flex-col-reverse gap-4 md:flex-row md:items-end md:justify-between", children: [_jsx(DocsTitle, { className: "mb-0 min-w-0", children: data.title }), _jsx(GeistdocsPageActions, { config: pageActions.config, page: {
|
|
111
|
+
}), _jsxs("div", { className: "flex flex-col-reverse gap-4 md:flex-row md:items-end md:justify-between", children: [_jsx(DocsTitle, { className: "mb-0 min-w-0", children: data.title }), _jsx(GeistdocsPageActions, { config: pageActions.config, only: "desktop", page: {
|
|
112
112
|
markdownUrl,
|
|
113
113
|
path: page.path,
|
|
114
114
|
url: publicPageUrl,
|
|
115
|
-
} })] }), _jsx(DocsDescription, { children: data.description }), _jsx(
|
|
115
|
+
} })] }), _jsx(DocsDescription, { children: data.description }), _jsx("div", { className: "-mt-6 mb-4 @min-[961px]:hidden", children: _jsx(GeistdocsPageActions, { config: pageActions.config, only: "mobile", page: {
|
|
116
|
+
markdownUrl,
|
|
117
|
+
path: page.path,
|
|
118
|
+
url: publicPageUrl,
|
|
119
|
+
} }) }), _jsx(DocsBody, { children: _jsx(MDX, { components: {
|
|
116
120
|
...createMdxComponents({ a: link }),
|
|
117
121
|
...resolvedMdx,
|
|
118
122
|
} }) })] }));
|
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.15.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.15.5 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
|
|
@@ -42,4 +42,5 @@ They are generated from `apps/template/content/docs` during the package build.
|
|
|
42
42
|
- [llms.txt](pages/llms-txt.md): A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
|
|
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
|
+
- [Table of contents](pages/table-of-contents.md): Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
45
46
|
- [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.15.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 1.15.5.
|
|
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
|
|
@@ -25,6 +25,7 @@ They describe how to build package-backed Geistdocs sites and how to use the pac
|
|
|
25
25
|
- [llms.txt](pages/llms-txt.md): A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
|
|
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
|
+
- [Table of contents](pages/table-of-contents.md): Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
28
29
|
- [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.
|
|
29
30
|
|
|
30
31
|
---
|
|
@@ -3305,6 +3306,71 @@ lastModified: 2025-11-12
|
|
|
3305
3306
|
```
|
|
3306
3307
|
|
|
3307
3308
|
|
|
3309
|
+
---
|
|
3310
|
+
|
|
3311
|
+
---
|
|
3312
|
+
title: Table of contents
|
|
3313
|
+
description: Show an "On this page" outline that tracks the reader's position along a straight guide rail
|
|
3314
|
+
type: reference
|
|
3315
|
+
summary: Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
3316
|
+
url: /docs/table-of-contents
|
|
3317
|
+
source: apps/template/content/docs/table-of-contents.mdx
|
|
3318
|
+
prerequisites:
|
|
3319
|
+
- /docs/getting-started
|
|
3320
|
+
related:
|
|
3321
|
+
- /docs/syntax
|
|
3322
|
+
- /docs/configuration
|
|
3323
|
+
---
|
|
3324
|
+
|
|
3325
|
+
# Table of contents
|
|
3326
|
+
|
|
3327
|
+
Every documentation page shows an **On this page** outline on the right side of the desktop layout. Geistdocs builds it from your headings, so you get an in-page table of contents without extra configuration. This page nests its own headings so you can watch the outline update as you scroll.
|
|
3328
|
+
|
|
3329
|
+
## Read the outline
|
|
3330
|
+
|
|
3331
|
+
The outline lists your headings in document order and highlights the section you are currently reading.
|
|
3332
|
+
|
|
3333
|
+
### Track the active section
|
|
3334
|
+
|
|
3335
|
+
A vertical guide rail runs down the left edge of the outline. As you scroll, an indicator slides along the rail to mark the active heading, so readers always know where they are in a long page.
|
|
3336
|
+
|
|
3337
|
+
### Follow the straight guide rail
|
|
3338
|
+
|
|
3339
|
+
The guide rail stays straight for every heading level. Sub-headings indent to the right of the rail, and the rail no longer bends outward to meet them, which keeps deep pages readable at a glance.
|
|
3340
|
+
|
|
3341
|
+
## Structure your headings
|
|
3342
|
+
|
|
3343
|
+
The outline mirrors your heading hierarchy, so a clear structure produces a clear outline.
|
|
3344
|
+
|
|
3345
|
+
### Start each section with an h2
|
|
3346
|
+
|
|
3347
|
+
Use `##` for the top-level sections of a page. These sit closest to the guide rail and anchor the rest of the outline.
|
|
3348
|
+
|
|
3349
|
+
### Nest sub-sections with an h3
|
|
3350
|
+
|
|
3351
|
+
Use `###` for sub-sections. Geistdocs indents them under their parent `##` heading:
|
|
3352
|
+
|
|
3353
|
+
```mdx
|
|
3354
|
+
## Structure your headings
|
|
3355
|
+
|
|
3356
|
+
### Nest sub-sections with an h3
|
|
3357
|
+
|
|
3358
|
+
#### Add detail with an h4
|
|
3359
|
+
```
|
|
3360
|
+
|
|
3361
|
+
#### Add detail with an h4
|
|
3362
|
+
|
|
3363
|
+
Use `####` when a sub-section needs its own breakdown. Geistdocs indents each level a little further so the relationship stays clear, while the guide rail itself remains a single straight line.
|
|
3364
|
+
|
|
3365
|
+
## Adapt to smaller screens
|
|
3366
|
+
|
|
3367
|
+
On mobile, Geistdocs replaces the sidebar outline with a compact menu in the page bar. The menu lists the same headings as a flat, indented list without the guide rail, so it stays legible on narrow screens.
|
|
3368
|
+
|
|
3369
|
+
## Write scannable headings
|
|
3370
|
+
|
|
3371
|
+
Keep headings short and descriptive so the outline reads like a summary of the page. Name each heading after the goal of its section, and avoid stacking two headings with no content between them.
|
|
3372
|
+
|
|
3373
|
+
|
|
3308
3374
|
---
|
|
3309
3375
|
|
|
3310
3376
|
---
|
package/docs/manifest.json
CHANGED
|
@@ -188,6 +188,15 @@
|
|
|
188
188
|
"type": "conceptual",
|
|
189
189
|
"url": "/docs/rss"
|
|
190
190
|
},
|
|
191
|
+
{
|
|
192
|
+
"description": "Show an \"On this page\" outline that tracks the reader's position along a straight guide rail",
|
|
193
|
+
"path": "pages/table-of-contents.md",
|
|
194
|
+
"source": "apps/template/content/docs/table-of-contents.mdx",
|
|
195
|
+
"summary": "Geistdocs builds the \"On this page\" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.",
|
|
196
|
+
"title": "Table of contents",
|
|
197
|
+
"type": "reference",
|
|
198
|
+
"url": "/docs/table-of-contents"
|
|
199
|
+
},
|
|
191
200
|
{
|
|
192
201
|
"description": "Display different images based on the user's light or dark theme preference",
|
|
193
202
|
"path": "pages/theme-aware-image.md",
|
|
@@ -199,5 +208,5 @@
|
|
|
199
208
|
}
|
|
200
209
|
],
|
|
201
210
|
"source": "apps/template/content/docs",
|
|
202
|
-
"version": "1.15.
|
|
211
|
+
"version": "1.15.5"
|
|
203
212
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Table of contents
|
|
3
|
+
description: Show an "On this page" outline that tracks the reader's position along a straight guide rail
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
6
|
+
url: /docs/table-of-contents
|
|
7
|
+
source: apps/template/content/docs/table-of-contents.mdx
|
|
8
|
+
prerequisites:
|
|
9
|
+
- /docs/getting-started
|
|
10
|
+
related:
|
|
11
|
+
- /docs/syntax
|
|
12
|
+
- /docs/configuration
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Table of contents
|
|
16
|
+
|
|
17
|
+
Every documentation page shows an **On this page** outline on the right side of the desktop layout. Geistdocs builds it from your headings, so you get an in-page table of contents without extra configuration. This page nests its own headings so you can watch the outline update as you scroll.
|
|
18
|
+
|
|
19
|
+
## Read the outline
|
|
20
|
+
|
|
21
|
+
The outline lists your headings in document order and highlights the section you are currently reading.
|
|
22
|
+
|
|
23
|
+
### Track the active section
|
|
24
|
+
|
|
25
|
+
A vertical guide rail runs down the left edge of the outline. As you scroll, an indicator slides along the rail to mark the active heading, so readers always know where they are in a long page.
|
|
26
|
+
|
|
27
|
+
### Follow the straight guide rail
|
|
28
|
+
|
|
29
|
+
The guide rail stays straight for every heading level. Sub-headings indent to the right of the rail, and the rail no longer bends outward to meet them, which keeps deep pages readable at a glance.
|
|
30
|
+
|
|
31
|
+
## Structure your headings
|
|
32
|
+
|
|
33
|
+
The outline mirrors your heading hierarchy, so a clear structure produces a clear outline.
|
|
34
|
+
|
|
35
|
+
### Start each section with an h2
|
|
36
|
+
|
|
37
|
+
Use `##` for the top-level sections of a page. These sit closest to the guide rail and anchor the rest of the outline.
|
|
38
|
+
|
|
39
|
+
### Nest sub-sections with an h3
|
|
40
|
+
|
|
41
|
+
Use `###` for sub-sections. Geistdocs indents them under their parent `##` heading:
|
|
42
|
+
|
|
43
|
+
```mdx
|
|
44
|
+
## Structure your headings
|
|
45
|
+
|
|
46
|
+
### Nest sub-sections with an h3
|
|
47
|
+
|
|
48
|
+
#### Add detail with an h4
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Add detail with an h4
|
|
52
|
+
|
|
53
|
+
Use `####` when a sub-section needs its own breakdown. Geistdocs indents each level a little further so the relationship stays clear, while the guide rail itself remains a single straight line.
|
|
54
|
+
|
|
55
|
+
## Adapt to smaller screens
|
|
56
|
+
|
|
57
|
+
On mobile, Geistdocs replaces the sidebar outline with a compact menu in the page bar. The menu lists the same headings as a flat, indented list without the guide rail, so it stays legible on narrow screens.
|
|
58
|
+
|
|
59
|
+
## Write scannable headings
|
|
60
|
+
|
|
61
|
+
Keep headings short and descriptive so the outline reads like a summary of the page. Name each heading after the goal of its section, and avoid stacking two headings with no content between them.
|
package/docs/sitemap.md
CHANGED
|
@@ -23,4 +23,5 @@ Use it to choose focused page files from `docs/pages/` before reading the full `
|
|
|
23
23
|
- [llms.txt](pages/llms-txt.md) | URL: /docs/llms-txt | Type: conceptual | Summary: A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
|
|
24
24
|
- [Open in Chat](pages/open-in-chat.md) | URL: /docs/open-in-chat | Type: conceptual | Summary: Transfer documentation context to AI chat platforms like ChatGPT, Claude, Cursor, and v0 with a single click.
|
|
25
25
|
- [RSS](pages/rss.md) | URL: /docs/rss | Type: conceptual | Summary: An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
|
|
26
|
+
- [Table of contents](pages/table-of-contents.md) | URL: /docs/table-of-contents | Type: reference | Summary: Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
26
27
|
- [Theme-Aware Image](pages/theme-aware-image.md) | URL: /docs/theme-aware-image | Type: reference | Summary: A component that swaps images based on the active theme, built on top of Next.js Image.
|
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.15.
|
|
4
|
+
"version": "1.15.5",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
"mermaid": "^11.12.2",
|
|
275
275
|
"motion": "^12.23.25",
|
|
276
276
|
"next-themes": "^0.4.6",
|
|
277
|
-
"radix-ui": "
|
|
277
|
+
"radix-ui": "1.6.4",
|
|
278
278
|
"react-player": "^3.4.0",
|
|
279
279
|
"sonner": "^2.0.7",
|
|
280
280
|
"streamdown": "^2.1.0",
|
|
@@ -305,6 +305,7 @@
|
|
|
305
305
|
"typescript": "^5.9.3"
|
|
306
306
|
},
|
|
307
307
|
"scripts": {
|
|
308
|
-
"build": "rm -rf dist docs template && node ./scripts/bundle-template.mjs && node ./scripts/bundle-docs.mjs && tsc -p tsconfig.runtime.json && tsup --config tsup.config.cli.ts"
|
|
308
|
+
"build": "rm -rf dist docs template && node ./scripts/bundle-template.mjs && node ./scripts/bundle-docs.mjs && tsc -p tsconfig.runtime.json && tsup --config tsup.config.cli.ts",
|
|
309
|
+
"dev": "tsc -p tsconfig.runtime.json --watch --preserveWatchOutput"
|
|
309
310
|
}
|
|
310
311
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Table of contents
|
|
3
|
+
description: Show an "On this page" outline that tracks the reader's position along a straight guide rail
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/syntax
|
|
10
|
+
- /docs/configuration
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Every documentation page shows an **On this page** outline on the right side of the desktop layout. Geistdocs builds it from your headings, so you get an in-page table of contents without extra configuration. This page nests its own headings so you can watch the outline update as you scroll.
|
|
14
|
+
|
|
15
|
+
## Read the outline
|
|
16
|
+
|
|
17
|
+
The outline lists your headings in document order and highlights the section you are currently reading.
|
|
18
|
+
|
|
19
|
+
### Track the active section
|
|
20
|
+
|
|
21
|
+
A vertical guide rail runs down the left edge of the outline. As you scroll, an indicator slides along the rail to mark the active heading, so readers always know where they are in a long page.
|
|
22
|
+
|
|
23
|
+
### Follow the straight guide rail
|
|
24
|
+
|
|
25
|
+
The guide rail stays straight for every heading level. Sub-headings indent to the right of the rail, and the rail no longer bends outward to meet them, which keeps deep pages readable at a glance.
|
|
26
|
+
|
|
27
|
+
## Structure your headings
|
|
28
|
+
|
|
29
|
+
The outline mirrors your heading hierarchy, so a clear structure produces a clear outline.
|
|
30
|
+
|
|
31
|
+
### Start each section with an h2
|
|
32
|
+
|
|
33
|
+
Use `##` for the top-level sections of a page. These sit closest to the guide rail and anchor the rest of the outline.
|
|
34
|
+
|
|
35
|
+
### Nest sub-sections with an h3
|
|
36
|
+
|
|
37
|
+
Use `###` for sub-sections. Geistdocs indents them under their parent `##` heading:
|
|
38
|
+
|
|
39
|
+
```mdx
|
|
40
|
+
## Structure your headings
|
|
41
|
+
|
|
42
|
+
### Nest sub-sections with an h3
|
|
43
|
+
|
|
44
|
+
#### Add detail with an h4
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Add detail with an h4
|
|
48
|
+
|
|
49
|
+
Use `####` when a sub-section needs its own breakdown. Geistdocs indents each level a little further so the relationship stays clear, while the guide rail itself remains a single straight line.
|
|
50
|
+
|
|
51
|
+
## Adapt to smaller screens
|
|
52
|
+
|
|
53
|
+
On mobile, Geistdocs replaces the sidebar outline with a compact menu in the page bar. The menu lists the same headings as a flat, indented list without the guide rail, so it stays legible on narrow screens.
|
|
54
|
+
|
|
55
|
+
## Write scannable headings
|
|
56
|
+
|
|
57
|
+
Keep headings short and descriptive so the outline reads like a summary of the page. Name each heading after the goal of its section, and avoid stacking two headings with no content between them.
|
package/template/next.config.ts
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { createMDX } from "fumadocs-mdx/next";
|
|
2
4
|
import type { NextConfig } from "next";
|
|
3
5
|
|
|
4
6
|
const withMDX = createMDX();
|
|
5
7
|
|
|
8
|
+
// In this monorepo, compile @vercel/geistdocs from its workspace source so edits
|
|
9
|
+
// to the package hot-reload in the running dev server (no rebuild/restart).
|
|
10
|
+
// Turbopack only watches packages listed here; without it, changes to the
|
|
11
|
+
// prebuilt dist in node_modules are ignored. Published/scaffolded installs have
|
|
12
|
+
// no workspace source, so this is skipped and the prebuilt dist is used as-is.
|
|
13
|
+
const inMonorepo = existsSync(
|
|
14
|
+
join(process.cwd(), "../../packages/geistdocs/src")
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// Distinct favicon per environment; production keeps the default (no-op).
|
|
18
|
+
const ENV_FAVICONS = {
|
|
19
|
+
development: "/favicon.development.ico",
|
|
20
|
+
preview: "/favicon.preview.ico",
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
const environment = process.env.VERCEL_ENV ?? process.env.NODE_ENV;
|
|
24
|
+
const envFavicon = ENV_FAVICONS[environment as keyof typeof ENV_FAVICONS];
|
|
25
|
+
|
|
6
26
|
const config: NextConfig = {
|
|
27
|
+
...(inMonorepo ? { transpilePackages: ["@vercel/geistdocs"] } : {}),
|
|
28
|
+
|
|
7
29
|
experimental: {
|
|
8
30
|
turbopackFileSystemCacheForDev: true,
|
|
9
31
|
},
|
|
@@ -17,6 +39,18 @@ const config: NextConfig = {
|
|
|
17
39
|
},
|
|
18
40
|
],
|
|
19
41
|
},
|
|
42
|
+
|
|
43
|
+
rewrites() {
|
|
44
|
+
if (!envFavicon) {
|
|
45
|
+
return Promise.resolve([]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return Promise.resolve({
|
|
49
|
+
beforeFiles: [{ source: "/favicon.ico", destination: envFavicon }],
|
|
50
|
+
afterFiles: [],
|
|
51
|
+
fallback: [],
|
|
52
|
+
});
|
|
53
|
+
},
|
|
20
54
|
};
|
|
21
55
|
|
|
22
56
|
export default withMDX(config);
|
package/template/package.json
CHANGED
|
@@ -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.15.
|
|
21
|
+
"@vercel/geistdocs": "1.15.5",
|
|
22
22
|
"@vercel/speed-insights": "^1.3.1",
|
|
23
23
|
"ai": "^6.0.132",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"nanoid": "^5.1.6",
|
|
38
38
|
"next": "16.2.6",
|
|
39
39
|
"next-themes": "^0.4.6",
|
|
40
|
-
"radix-ui": "
|
|
40
|
+
"radix-ui": "1.6.4",
|
|
41
41
|
"react": "^19.2.3",
|
|
42
42
|
"react-dom": "^19.2.3",
|
|
43
43
|
"react-player": "^3.4.0",
|
|
Binary file
|
|
Binary file
|