@vercel/geistdocs 1.15.5 → 1.17.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 (66) hide show
  1. package/dist/assets/icons/icon-api.d.ts +5 -0
  2. package/dist/assets/icons/icon-api.d.ts.map +1 -0
  3. package/dist/assets/icons/icon-api.js +4 -0
  4. package/dist/assets/icons/icon-display-small.d.ts +5 -0
  5. package/dist/assets/icons/icon-display-small.d.ts.map +1 -0
  6. package/dist/assets/icons/icon-display-small.js +4 -0
  7. package/dist/assets/icons/icon-display.d.ts +5 -0
  8. package/dist/assets/icons/icon-display.d.ts.map +1 -0
  9. package/dist/assets/icons/icon-display.js +4 -0
  10. package/dist/assets/icons/icon-moon-small.d.ts +5 -0
  11. package/dist/assets/icons/icon-moon-small.d.ts.map +1 -0
  12. package/dist/assets/icons/icon-moon-small.js +4 -0
  13. package/dist/assets/icons/icon-moon.d.ts +5 -0
  14. package/dist/assets/icons/icon-moon.d.ts.map +1 -0
  15. package/dist/assets/icons/icon-moon.js +4 -0
  16. package/dist/assets/icons/icon-sun-small.d.ts +5 -0
  17. package/dist/assets/icons/icon-sun-small.d.ts.map +1 -0
  18. package/dist/assets/icons/icon-sun-small.js +4 -0
  19. package/dist/assets/icons/icon-sun.d.ts +5 -0
  20. package/dist/assets/icons/icon-sun.d.ts.map +1 -0
  21. package/dist/assets/icons/icon-sun.js +4 -0
  22. package/dist/assets/icons/index.d.ts +7 -0
  23. package/dist/assets/icons/index.d.ts.map +1 -1
  24. package/dist/assets/icons/index.js +7 -0
  25. package/dist/assets/logos/logo-icon-vercel.js +1 -1
  26. package/dist/assets/logos/logo-vercel-oss.js +1 -1
  27. package/dist/cli/index.js +1 -1
  28. package/dist/components/theme-switcher.d.ts +8 -0
  29. package/dist/components/theme-switcher.d.ts.map +1 -0
  30. package/dist/components/theme-switcher.js +37 -0
  31. package/dist/footer.d.ts +1 -7
  32. package/dist/footer.d.ts.map +1 -1
  33. package/dist/footer.js +170 -5
  34. package/dist/internal/navbar/mobile-menu.d.ts.map +1 -1
  35. package/dist/internal/navbar/mobile-menu.js +2 -1
  36. package/dist/internal/navbar/navbar-logo.d.ts.map +1 -1
  37. package/dist/internal/navbar/navbar-logo.js +1 -5
  38. package/dist/internal/navbar/navbar-shell.d.ts +5 -0
  39. package/dist/internal/navbar/navbar-shell.d.ts.map +1 -0
  40. package/dist/internal/navbar/navbar-shell.js +17 -0
  41. package/dist/internal/page-actions-client.d.ts.map +1 -1
  42. package/dist/internal/page-actions-client.js +34 -10
  43. package/dist/internal/sidebar-tree.d.ts +1 -0
  44. package/dist/internal/sidebar-tree.d.ts.map +1 -1
  45. package/dist/internal/sidebar-tree.js +9 -0
  46. package/dist/internal/sidebar.d.ts.map +1 -1
  47. package/dist/internal/sidebar.js +2 -2
  48. package/dist/navbar.d.ts.map +1 -1
  49. package/dist/navbar.js +2 -1
  50. package/dist/proxy.d.ts.map +1 -1
  51. package/dist/proxy.js +14 -3
  52. package/dist/versions.d.ts.map +1 -1
  53. package/dist/versions.js +1 -2
  54. package/docs/agents.md +1 -1
  55. package/docs/llms.txt +25 -2
  56. package/docs/manifest.json +1 -1
  57. package/docs/pages/guides/nested-navigation.md +23 -0
  58. package/docs/pages/syntax.md +1 -1
  59. package/package.json +14 -2
  60. package/template/app/[lang]/layout.tsx +1 -1
  61. package/template/app/styles/geistdocs.css +7 -0
  62. package/template/content/docs/guides/nested-navigation.mdx +23 -0
  63. package/template/content/docs/syntax.mdx +1 -1
  64. package/template/lib/geistdocs/fonts.ts +7 -10
  65. package/template/package.json +2 -1
  66. package/theme.css +4 -0
@@ -138,16 +138,12 @@ export function NavbarLogo({ className, href = "/", ...props }) {
138
138
  const ossSections = groupOssProducts(ossProducts.filter((product) => !product.featured));
139
139
  const [navOpen, setNavOpen] = useState(false);
140
140
  const router = useRouter();
141
- // The OSS trigger navigates via router.push (it's a button, not a Link, so
142
- // keyboard focus reaches radix), which skips next/link's automatic prefetch.
143
- // Warm the route on mount so clicking home is as fast as the prefetched
144
- // <Link> nav items. The standard variant's logo is a real <Link> already.
145
141
  useEffect(() => {
146
142
  if (isOss) {
147
143
  router.prefetch(href);
148
144
  }
149
145
  }, [isOss, router, href]);
150
- return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "relative flex items-center text-gray-1000 outline-none before:absolute before:-inset-x-1 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 20 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden", size: 18 })] })) : (_jsx(LogoIconVercel, { size: 20 })) }), _jsx("div", { className: "w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, {}) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: href, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "flex h-full items-center", children: [_jsx(NavigationMenuTrigger, { className: "relative -mx-3 flex h-full items-center gap-1.5 px-3 text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", onClick: (e) => {
146
+ return (_jsxs("span", { className: cn("flex items-center gap-2.5", className), children: [_jsx(Link, { className: "-mx-2 flex items-center rounded-md p-2 text-gray-1000 outline-none focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-inset", href: isOss ? "https://vercel.com/oss" : "https://vercel.com/", rel: "noopener", target: "_blank", children: isOss ? (_jsxs(_Fragment, { children: [_jsx(LogoIconVercel, { className: "@min-[640px]:hidden", size: 18 }), _jsx(LogoVercelOss, { className: "@min-[640px]:block hidden shrink-0", size: (18 * 45) / 43.391_652 })] })) : (_jsx(LogoIconVercel, { size: 18 })) }), _jsx("div", { className: "w-4 text-center text-gray-alpha-400 text-lg dark:text-gray-600", children: _jsx(IconSlashForward, {}) }), isOss ? (_jsxs(_Fragment, { children: [_jsx(Link, { className: "flex @min-[1024px]:hidden items-center text-gray-1000", href: href, children: props.logo }), _jsxs("div", { className: "@min-[1024px]:contents hidden", children: [_jsx(NavigationMenu, { delayDuration: 0, onValueChange: (value) => setNavOpen(Boolean(value)), skipDelayDuration: 0, viewport: false, children: _jsx(NavigationMenuList, { className: "h-16 items-stretch", children: _jsxs(NavigationMenuItem, { className: "flex h-full items-center", children: [_jsx(NavigationMenuTrigger, { className: "relative -mx-3 flex h-full items-center gap-1.5 px-3 text-gray-1000 outline-none before:absolute before:inset-x-0 before:top-1/2 before:h-9 before:-translate-y-1/2 before:rounded-md before:content-[''] focus-visible:before:ring-2 focus-visible:before:ring-blue-700 focus-visible:before:ring-inset", onClick: (e) => {
151
147
  if (e.detail !== 0) {
152
148
  router.push(href);
153
149
  }
@@ -0,0 +1,5 @@
1
+ import { type ReactNode } from "react";
2
+ export declare const NavbarShell: ({ children }: {
3
+ children: ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=navbar-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbar-shell.d.ts","sourceRoot":"","sources":["../../../src/internal/navbar/navbar-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAM5D,eAAO,MAAM,WAAW,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAqBhE,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { cn } from "../cn";
5
+ // Sticky navbar shell that reveals its bottom divider (a box-shadow, so it
6
+ // doesn't consume the 64px content row) only once the page is scrolled —
7
+ // matching the vercel.com header.
8
+ export const NavbarShell = ({ children }) => {
9
+ const [scrolled, setScrolled] = useState(false);
10
+ useEffect(() => {
11
+ const onScroll = () => setScrolled(window.scrollY > 0);
12
+ onScroll();
13
+ window.addEventListener("scroll", onScroll, { passive: true });
14
+ return () => window.removeEventListener("scroll", onScroll);
15
+ }, []);
16
+ return (_jsx("header", { className: cn("sticky top-0 z-40 flex h-16 justify-center bg-background-200 transition-shadow motion-reduce:transition-none", scrolled && "shadow-[0_1px_0_0_var(--ds-gray-alpha-400)]"), "data-scrolled": scrolled ? "" : undefined, children: children }));
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AA2mBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDA2FlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
1
+ {"version":3,"file":"page-actions-client.d.ts","sourceRoot":"","sources":["../../src/internal/page-actions-client.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmBjD,UAAU,gBAAgB;IACxB,MAAM,EAAE,IAAI,CACV,eAAe,EACf,IAAI,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CACxD,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,UAAU,oCAAoC;IAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAC;IACrE,YAAY,EAAE,SAAS,EAAE,CAAC;CAC3B;AAgnBD,eAAO,MAAM,oBAAoB,GAAI,yBAIlC,gBAAgB,mDAqHlB,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,2BAG7C,oCAAoC,4CAiBtC,CAAC"}
@@ -82,8 +82,8 @@ const ProviderMenuView = ({ backRef, onBack, providers, query, }) => (_jsxs(_Fra
82
82
  event.preventDefault();
83
83
  onBack();
84
84
  }, ref: backRef, children: [_jsx(ChevronLeftIcon, { className: "size-4" }), _jsx("span", { children: "Back to page actions" })] }), _jsx(DropdownMenuSeparator, {}), _jsx(OpenInProviderItems, { providers: providers, query: query })] }));
85
- const PageActionsMainMenu = ({ askAIEnabled, checked, copyEnabled, copyIcon, editSourceEnabled, editSourceUrl, handleCopy, isMobile, markdownUrl, onAskAI, onShowProviders, openInChatEnabled, openInChatRef, otherProviders, query, v0Provider, }) => {
86
- return (_jsxs(_Fragment, { children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto w-full p-2", children: _jsx("button", { onClick: handleCopy, type: "button", children: _jsx(PageActionMenuItemContent, { description: "Copy page as Markdown for LLMs", icon: copyIcon, title: checked ? "Copied" : "Copy page" }) }) }), _jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("a", { href: markdownUrl, rel: "noopener noreferrer", target: "_blank", children: _jsx(PageActionMenuItemContent, { description: "Open this page as plain text", icon: _jsx(SiMarkdown, { "aria-hidden": "true", className: "size-4" }), title: "View as Markdown" }) }) })] })) : null, openInChatEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("a", { href: v0Provider.getHref(query), rel: "noopener noreferrer", target: "_blank", children: _jsx(PageActionMenuItemContent, { description: "Ask v0 to help apply this page", icon: _jsx(SiV0, { "aria-hidden": "true", className: "size-4" }), title: v0Provider.label }) }) }), isMobile ? (_jsxs(DropdownMenuItem, { className: "h-auto p-2", onSelect: (event) => {
85
+ const PageActionsMainMenu = ({ askAIEnabled, checked, copyEnabled, copyIcon, editSourceEnabled, editSourceUrl, handleCopy, isMobile, onAskAI, onShowProviders, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, query, v0Provider, }) => {
86
+ return (_jsxs(_Fragment, { children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto w-full p-2", children: _jsx("button", { onClick: handleCopy, type: "button", children: _jsx(PageActionMenuItemContent, { description: "Copy page as Markdown for LLMs", icon: copyIcon, title: checked ? "Copied" : "Copy page" }) }) }), _jsx(DropdownMenuItem, { asChild: true, className: "h-auto w-full p-2", children: _jsx("button", { onClick: onViewMarkdown, type: "button", children: _jsx(PageActionMenuItemContent, { description: "Open this page as plain text", icon: _jsx(SiMarkdown, { "aria-hidden": "true", className: "size-4" }), title: "View as Markdown" }) }) })] })) : null, openInChatEnabled ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("a", { href: v0Provider.getHref(query), rel: "noopener noreferrer", target: "_blank", children: _jsx(PageActionMenuItemContent, { description: "Ask v0 to help apply this page", icon: _jsx(SiV0, { "aria-hidden": "true", className: "size-4" }), title: v0Provider.label }) }) }), isMobile ? (_jsxs(DropdownMenuItem, { className: "h-auto p-2", onSelect: (event) => {
87
87
  event.preventDefault();
88
88
  onShowProviders();
89
89
  }, ref: openInChatRef, children: [_jsx(PageActionMenuItemContent, { description: "Use this page in another AI chat", icon: _jsx(ExternalLinkIcon, { className: "size-4" }), title: "Open in another chat" }), _jsx(ChevronRightIcon, { className: "size-4" })] })) : (_jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { className: "h-auto p-2", children: _jsx(PageActionMenuItemContent, { description: "Use this page in another AI chat", icon: _jsx(ExternalLinkIcon, { className: "size-4" }), title: "Open in another chat" }) }), _jsx(DropdownMenuSubContent, { className: "w-52", sideOffset: 12, children: _jsx(OpenInProviderItems, { providers: otherProviders, query: query }) })] }))] })) : null, askAIEnabled ? (_jsx(DropdownMenuItem, { className: "h-auto p-2", onSelect: onAskAI, children: _jsx(PageActionMenuItemContent, { description: "Chat with this page as context", icon: _jsx(MessageCircleIcon, { className: "size-4" }), title: "Ask AI about this page" }) })) : null, editSourceEnabled ? (_jsx(DropdownMenuItem, { asChild: true, className: "h-auto p-2", children: _jsx("a", { href: editSourceUrl, rel: "noopener noreferrer", target: "_blank", children: _jsx(PageActionMenuItemContent, { description: "Suggest changes to this page", icon: _jsx(SiGithub, { "aria-hidden": "true", className: "size-4" }), title: "Edit this page on GitHub" }) }) })) : null] }));
@@ -130,13 +130,13 @@ const FeedbackAction = ({ siteId }) => {
130
130
  };
131
131
  // The mobile action row: three primary actions rendered inline below the
132
132
  // page description.
133
- const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, markdownUrl, onAskAI, onCopy, }) => {
133
+ const InlinePageActions = ({ askAIEnabled, checked, copyEnabled, onAskAI, onCopy, onViewMarkdown, }) => {
134
134
  const CopyStateIcon = checked ? CheckIcon : CopyIcon;
135
- return (_jsxs("div", { className: "flex items-center gap-3 border-b pb-3 text-label-12", children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsxs("button", { className: inlineActionClassName, onClick: onCopy, type: "button", children: [_jsx(CopyStateIcon, {}), _jsx("span", { children: checked ? "Copied" : "Copy for LLM" })] }), _jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400 max-sm:hidden" }), _jsxs("a", { className: `${inlineActionClassName} max-sm:hidden`, href: markdownUrl, rel: "noopener noreferrer", target: "_blank", children: [_jsx(SiMarkdown, { "aria-hidden": "true" }), _jsx("span", { children: "View Markdown" })] })] })) : null, copyEnabled && askAIEnabled ? (_jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400" })) : null, askAIEnabled ? (_jsxs("button", { className: inlineActionClassName, onClick: onAskAI, type: "button", children: [_jsx(MessageCircleIcon, {}), _jsx("span", { children: "Ask AI about this page" })] })) : null] }));
135
+ return (_jsxs("div", { className: "flex items-center gap-3 border-b pb-3 text-label-12", children: [copyEnabled ? (_jsxs(_Fragment, { children: [_jsxs("button", { className: inlineActionClassName, onClick: onCopy, type: "button", children: [_jsx(CopyStateIcon, {}), _jsx("span", { children: checked ? "Copied" : "Copy for LLM" })] }), _jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400 max-sm:hidden" }), _jsxs("button", { className: `${inlineActionClassName} max-sm:hidden`, onClick: onViewMarkdown, type: "button", children: [_jsx(SiMarkdown, { "aria-hidden": "true" }), _jsx("span", { children: "View Markdown" })] })] })) : null, copyEnabled && askAIEnabled ? (_jsx("span", { "aria-hidden": "true", className: "h-4 w-px shrink-0 bg-gray-alpha-400" })) : null, askAIEnabled ? (_jsxs("button", { className: inlineActionClassName, onClick: onAskAI, type: "button", children: [_jsx(MessageCircleIcon, {}), _jsx("span", { children: "Ask AI about this page" })] })) : null] }));
136
136
  };
137
137
  // The desktop action control: a compact copy button plus an actions dropdown,
138
138
  // aligned beside the page title.
139
- const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, markdownUrl, menuView, onAskAI, onCopy, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
139
+ const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnabled, editSourceUrl, isMobile, menuView, onAskAI, onCopy, onViewMarkdown, openInChatEnabled, openInChatRef, otherProviders, providersBackRef, query, setMenuView, v0Provider, }) => {
140
140
  const CopyStateIcon = checked ? CheckIcon : CopyIcon;
141
141
  return (_jsxs(ButtonGroup, { children: [copyEnabled ? (_jsxs(Button, { "aria-label": "Copy page", className: "touch-manipulation", onClick: onCopy, size: "sm", type: "button", variant: "outline", children: [_jsx(CopyStateIcon, { className: "size-4" }), _jsxs("span", { className: "relative hidden md:inline-block", children: [_jsx("span", { className: "invisible", children: "Copy page" }), _jsx("span", { className: "absolute inset-0", children: checked ? "Copied" : "Copy page" })] })] })) : null, _jsxs(DropdownMenu, { onOpenChange: (open) => {
142
142
  if (!open) {
@@ -145,10 +145,10 @@ const DesktopPageActions = ({ askAIEnabled, checked, copyEnabled, editSourceEnab
145
145
  }, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { "aria-label": copyEnabled ? "Open page actions" : "Page actions", className: copyEnabled ? "touch-manipulation px-2" : undefined, size: "sm", type: "button", variant: "outline", children: [copyEnabled ? null : _jsx("span", { children: "Page actions" }), _jsx(ChevronDownIcon, { className: "size-4" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-80 max-w-[calc(100vw-1rem)]", sideOffset: 8, children: isMobile && menuView === "providers" ? (_jsx(ProviderMenuView, { backRef: providersBackRef, onBack: () => {
146
146
  setMenuView("main");
147
147
  requestAnimationFrame(() => openInChatRef.current?.focus());
148
- }, providers: otherProviders, query: query })) : (_jsx(PageActionsMainMenu, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, copyIcon: _jsx(CopyStateIcon, { className: "size-4" }), editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, handleCopy: onCopy, isMobile: isMobile, markdownUrl: markdownUrl, onAskAI: onAskAI, onShowProviders: () => {
148
+ }, providers: otherProviders, query: query })) : (_jsx(PageActionsMainMenu, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, copyIcon: _jsx(CopyStateIcon, { className: "size-4" }), editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, handleCopy: onCopy, isMobile: isMobile, onAskAI: onAskAI, onShowProviders: () => {
149
149
  setMenuView("providers");
150
150
  requestAnimationFrame(() => providersBackRef.current?.focus());
151
- }, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, query: query, v0Provider: v0Provider })) })] })] }));
151
+ }, onViewMarkdown: onViewMarkdown, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, query: query, v0Provider: v0Provider })) })] })] }));
152
152
  };
153
153
  export const GeistdocsPageActions = ({ config, page, only, }) => {
154
154
  const isMobile = useIsMobile();
@@ -157,13 +157,37 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
157
157
  const openInChatRef = useRef(null);
158
158
  const providersBackRef = useRef(null);
159
159
  const markdownUrl = page.markdownUrl;
160
- const [checked, handleCopy] = useCopyButton(async () => {
160
+ const fetchMarkdown = async () => {
161
161
  const response = await fetch(markdownUrl);
162
162
  if (!response.ok) {
163
163
  throw new Error(`Failed to fetch markdown from ${markdownUrl}`);
164
164
  }
165
- await navigator.clipboard.writeText(await response.text());
165
+ return await response.text();
166
+ };
167
+ const [checked, handleCopy] = useCopyButton(async () => {
168
+ await navigator.clipboard.writeText(await fetchMarkdown());
166
169
  });
170
+ const handleViewMarkdown = () => {
171
+ // Open synchronously so popup blockers allow the tab, then load the
172
+ // markdown into a blob URL — keeps `.md` URLs out of the address bar
173
+ // and browser history (agents should cite canonical page URLs).
174
+ const viewer = window.open("about:blank", "_blank");
175
+ if (!viewer) {
176
+ return;
177
+ }
178
+ fetchMarkdown()
179
+ .then((markdown) => {
180
+ const blob = new Blob([markdown], {
181
+ type: "text/plain;charset=utf-8",
182
+ });
183
+ const blobUrl = URL.createObjectURL(blob);
184
+ viewer.location.href = blobUrl;
185
+ setTimeout(() => URL.revokeObjectURL(blobUrl), 60_000);
186
+ })
187
+ .catch(() => {
188
+ viewer.close();
189
+ });
190
+ };
167
191
  const editSourceUrl = getEditSourceUrl({
168
192
  github: config.github,
169
193
  path: page.path,
@@ -189,7 +213,7 @@ export const GeistdocsPageActions = ({ config, page, only, }) => {
189
213
  // Desktop variant aligns beside the title (self-end); the mobile variant is
190
214
  // rendered below the description and left-aligned.
191
215
  const rootClassName = only === "mobile" ? "@min-[961px]:hidden" : "self-end @max-[960px]:hidden";
192
- return (_jsxs("div", { className: rootClassName, children: [showDesktop ? (_jsx(DesktopPageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, isMobile: isMobile, markdownUrl: markdownUrl, menuView: menuView, onAskAI: onAskAI, onCopy: handleCopy, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, providersBackRef: providersBackRef, query: query, setMenuView: setMenuView, v0Provider: v0Provider })) : null, showMobile && (copyEnabled || askAIEnabled) ? (_jsx(InlinePageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, markdownUrl: markdownUrl, onAskAI: onAskAI, onCopy: handleCopy })) : null, _jsx("span", { "aria-live": "polite", className: "sr-only", children: checked ? "Page copied" : "" })] }));
216
+ return (_jsxs("div", { className: rootClassName, children: [showDesktop ? (_jsx(DesktopPageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, editSourceEnabled: editSourceEnabled, editSourceUrl: editSourceUrl, isMobile: isMobile, menuView: menuView, onAskAI: onAskAI, onCopy: handleCopy, onViewMarkdown: handleViewMarkdown, openInChatEnabled: openInChatEnabled, openInChatRef: openInChatRef, otherProviders: otherProviders, providersBackRef: providersBackRef, query: query, setMenuView: setMenuView, v0Provider: v0Provider })) : null, showMobile && (copyEnabled || askAIEnabled) ? (_jsx(InlinePageActions, { askAIEnabled: askAIEnabled, checked: checked, copyEnabled: copyEnabled, onAskAI: onAskAI, onCopy: handleCopy, onViewMarkdown: handleViewMarkdown })) : null, _jsx("span", { "aria-live": "polite", className: "sr-only", children: checked ? "Page copied" : "" })] }));
193
217
  };
194
218
  export const GeistdocsTableOfContentsActions = ({ config, extraActions, }) => {
195
219
  const actions = [];
@@ -10,6 +10,7 @@ export interface SidebarRootGroup {
10
10
  label?: ReactNode;
11
11
  }
12
12
  export declare const getSidebarItemBadge: (item: Item | undefined) => string | undefined;
13
+ export declare const getSidebarBadgeTone: (label: string) => string;
13
14
  export declare const isExternalSidebarItem: (item: Item | undefined) => boolean;
14
15
  export declare const isExternalSidebarUrl: (url: string) => boolean;
15
16
  export declare const hasSeparateRootDisclosure: (node: SidebarSectionNode) => node is Folder;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-tree.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;C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M,oBAAoB,GAAI,OAAO,IAAI,EAAE,KAAG,gBAAgB,EA8BpE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,OAAO,IAAI,EAAE,EACb,WAAW,MAAM,GAAG,SAAS,EAC7B,wBAAsB,EACtB,cAAiB,KAChB,MAAM,EAyBR,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,MAAM,EACd,YAAY,MAAM,EAAE,EACpB,cAAiB,KAChB,MAAM,EAiBR,CAAC"}
@@ -4,6 +4,15 @@ export const getSidebarItemBadge = (item) => {
4
4
  const badge = item?.badge;
5
5
  return typeof badge === "string" && badge.length > 0 ? badge : undefined;
6
6
  };
7
+ const METHOD_BADGE_TONES = {
8
+ DEL: "bg-red-100 text-red-900",
9
+ DELETE: "bg-red-100 text-red-900",
10
+ GET: "bg-green-100 text-green-900",
11
+ PATCH: "bg-amber-100 text-amber-900",
12
+ POST: "bg-blue-100 text-blue-900",
13
+ PUT: "bg-amber-100 text-amber-900",
14
+ };
15
+ export const getSidebarBadgeTone = (label) => METHOD_BADGE_TONES[label] ?? "bg-blue-100 text-blue-900";
7
16
  export const isExternalSidebarItem = (item) => Boolean(item && (item.external || EXTERNAL_URL.test(item.url)));
8
17
  export const isExternalSidebarUrl = (url) => EXTERNAL_URL.test(url);
9
18
  export const hasSeparateRootDisclosure = (node) => node.type === "folder" &&
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AA+2Bf,eAAO,MAAM,gBAAgB,GAAI,uBAG9B;IACD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CA8DA,CAAC"}
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/internal/sidebar.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAq3Bf,eAAO,MAAM,gBAAgB,GAAI,uBAG9B;IACD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,4CA8DA,CAAC"}
@@ -11,7 +11,7 @@ import { SearchButton } from "../controls";
11
11
  import { useGeistdocsSidebar } from "../sidebar";
12
12
  import { cn } from "./cn";
13
13
  import { observeSidebarContainer } from "./sidebar-responsive";
14
- import { findActiveRootSection, getDescendantFolderIds, getInitialOpenFolderIds, getSidebarItemBadge, getSidebarNodeId, getSidebarRootGroups, getSidebarSectionItems, hasSeparateRootDisclosure, isExternalSidebarItem, isExternalSidebarUrl, } from "./sidebar-tree";
14
+ import { findActiveRootSection, getDescendantFolderIds, getInitialOpenFolderIds, getSidebarBadgeTone, getSidebarItemBadge, getSidebarNodeId, getSidebarRootGroups, getSidebarSectionItems, hasSeparateRootDisclosure, isExternalSidebarItem, isExternalSidebarUrl, } from "./sidebar-tree";
15
15
  import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./ui/sheet";
16
16
  const UNSAFE_ID_CHARACTERS = /[^a-zA-Z0-9_-]/g;
17
17
  const collectPageUrls = (nodes) => {
@@ -134,7 +134,7 @@ const getSidebarRowTone = (isSelected, isGroup) => {
134
134
  return "text-gray-900 hover:bg-gray-alpha-100 hover:text-gray-1000 focus-visible:bg-gray-alpha-100 focus-visible:text-gray-1000 active:bg-gray-alpha-300";
135
135
  };
136
136
  const SidebarDisclosureIcon = ({ expanded }) => (_jsx(_Fragment, { children: expanded ? (_jsx(IconChevronDownSmall, { size: 16 })) : (_jsx(IconChevronRight, { size: 16 })) }));
137
- const SidebarBadge = ({ label }) => label ? (_jsx("span", { className: "inline-flex h-6 max-w-24 shrink-0 items-center truncate rounded-full bg-blue-100 px-2 text-blue-900 text-button-12", children: label })) : null;
137
+ const SidebarBadge = ({ label }) => label ? (_jsx("span", { className: cn("inline-flex h-6 max-w-24 shrink-0 items-center truncate rounded-full px-2 text-button-12", getSidebarBadgeTone(label)), children: label })) : null;
138
138
  const SidebarTreeNode = ({ depth, node, path, state, }) => {
139
139
  const nodeId = getSidebarNodeId(node, path, state.idScope);
140
140
  if (node.type === "separator") {
@@ -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;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"}
1
+ {"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../src/navbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,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
@@ -4,6 +4,7 @@ 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
6
  import { NavbarLogo } from "./internal/navbar/navbar-logo";
7
+ import { NavbarShell } from "./internal/navbar/navbar-shell";
7
8
  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
9
  export const Navbar = ({ config }) => {
9
10
  const nav = config.nav ?? [];
@@ -15,5 +16,5 @@ export const Navbar = ({ config }) => {
15
16
  // resolved and filtered inside the client menus below. Pass the raw custom
16
17
  // list (if any) and the active product down; each menu drops the active one.
17
18
  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 })] })] }) }));
19
+ return (_jsx(NavbarShell, { 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 })] })] }) }));
19
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,iBAAiB,GACjB,WAAW,GACX,IAAI,CAAC;AAET,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,QAAQ,GAAG,mBAAmB,GAAG,eAAe,CAAC;IAC/D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,cAAc,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,KAAK,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,qBAAqB,KAC3B,OAAO,CAAC,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,kEAMzB,kBAAkB,MA0PL,SAAS,WAAW,EAAE,SAAS,cAAc,sBA6C5D,CAAC"}
package/dist/proxy.js CHANGED
@@ -1,4 +1,4 @@
1
- import { generateNotFoundMarkdown, isAIAgent } from "@vercel/agent-readability";
1
+ import { applyMarkdownHeaders, generateNotFoundMarkdown, isAIAgent, } from "@vercel/agent-readability";
2
2
  import { defineI18n } from "fumadocs-core/i18n";
3
3
  import { createI18nMiddleware } from "fumadocs-core/i18n/middleware";
4
4
  import { isMarkdownPreferred } from "fumadocs-core/negotiation";
@@ -168,7 +168,15 @@ export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdo
168
168
  rewriteUrl.basePath = configuredBasePath;
169
169
  }
170
170
  rewriteUrl.pathname = result;
171
- return NextResponse.rewrite(rewriteUrl);
171
+ const response = NextResponse.rewrite(rewriteUrl);
172
+ // Vary: Accept keeps shared caches from serving markdown to browsers
173
+ // (or HTML to agents) on negotiated URLs; Link: rel="canonical" points
174
+ // crawlers at the public page URL instead of the markdown variant.
175
+ const canonicalPath = getPublicPath((options?.trackPath ?? pathname).replace(MDX_EXTENSION_PATTERN, ""), config.basePath);
176
+ applyMarkdownHeaders(response.headers, {
177
+ canonicalUrl: `${request.nextUrl.origin}${canonicalPath}`,
178
+ });
179
+ return response;
172
180
  };
173
181
  const isMdExtensionRequest = (pathname, language) => (pathname.endsWith(".md") || pathname.endsWith(".mdx")) &&
174
182
  Boolean(resolveMarkdownRewrite(pathname.replace(MDX_EXTENSION_PATTERN, ""), language));
@@ -194,8 +202,11 @@ export const createProxy = ({ after, before, config, markdownRoutes, trackMarkdo
194
202
  if (response) {
195
203
  return response;
196
204
  }
205
+ const notFoundHeaders = applyMarkdownHeaders(new Headers({ "Content-Type": "text/markdown; charset=utf-8" }), {
206
+ canonicalUrl: `${request.nextUrl.origin}${getPublicPath(trackPath, config.basePath)}`,
207
+ });
197
208
  return new NextResponse(generateNotFoundMarkdown(pathname), {
198
- headers: { "Content-Type": "text/markdown; charset=utf-8" },
209
+ headers: notFoundHeaders,
199
210
  });
200
211
  };
201
212
  const handlePreferredMarkdownRequest = (request, context, pathname, language, trackPath) => isMarkdownPreferred(request)
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAQhF,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,uBAAuB,CAAC,IAAI,SAAS,wBAAwB;IACrE,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,yBAAyB;IACjC,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,UAAU,yBAAyB,CAAC,IAAI,SAAS,wBAAwB;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC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Q,EAAE,sBAAsB,EAAE,GAAG,uBAAuB,CAAC;CAC9D;AAkED,eAAO,MAAM,gBAAgB,GAAI,IAAI,SAAS,wBAAwB,EAAE,kCAIrE,uBAAuB,CAAC,IAAI,CAAC,WA0B/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,0CAKpC,2BAA2B,4CAqC7B,CAAC"}
package/dist/versions.js CHANGED
@@ -17,7 +17,6 @@ const removeRoutePrefix = (pathname, item) => {
17
17
  ? pathname.slice(item.routePrefix.length) || "/"
18
18
  : pathname;
19
19
  };
20
- const getVersionDescription = ({ current, version, }) => version.description ?? (current ? "Current version" : "Previous version");
21
20
  const SelectIcon = ({ active, children, }) => (_jsx("span", { className: cn("flex size-9 shrink-0 items-center justify-center rounded-md border", active
22
21
  ? "border-blue-500 bg-blue-100 text-blue-900"
23
22
  : "border-gray-alpha-400 bg-gray-100 text-gray-800"), children: children }));
@@ -98,5 +97,5 @@ export const GeistdocsVersionSelect = ({ className, current, paths, versions, })
98
97
  })
99
98
  : baseItems;
100
99
  const currentId = current ?? (Array.isArray(versions) ? items[0]?.id : versions.current);
101
- return (_jsx(GeistdocsRouteSelect, { ariaLabel: "Select documentation version", className: className, current: currentId, getDescription: ({ active, item }) => getVersionDescription({ current: active, version: item }), items: items, renderIcon: ({ active, item }) => item.icon ? (_jsx(SelectIcon, { active: active, children: item.icon })) : (_jsx(VersionIcon, { active: active })) }));
100
+ return (_jsx(GeistdocsRouteSelect, { ariaLabel: "Select documentation version", className: className, current: currentId, items: items, renderIcon: ({ active, item }) => item.icon ? (_jsx(SelectIcon, { active: active, children: item.icon })) : (_jsx(VersionIcon, { active: active })) }));
102
101
  };
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.5 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.17.0 so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Documentation
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.15.5.
3
+ These docs are bundled with `@vercel/geistdocs` 1.17.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
@@ -1116,7 +1116,7 @@ badge: Beta
1116
1116
  ---
1117
1117
  ```
1118
1118
 
1119
- 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.
1119
+ 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. Badge labels that match an uppercase HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, or `DELETE`) render with a method-specific color. See [Configure sidebar navigation](/docs/guides/nested-navigation) for the full color mapping.
1120
1120
 
1121
1121
  ## Basic Markdown
1122
1122
 
@@ -2699,6 +2699,29 @@ badge: Beta
2699
2699
 
2700
2700
  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.
2701
2701
 
2702
+ ## Show HTTP method badges on API reference pages
2703
+
2704
+ Badge labels that match an HTTP method render with a method-specific color, so readers can distinguish endpoint types in an API reference sidebar at a glance. Set `badge` to the uppercase method name:
2705
+
2706
+ ```yaml title="content/docs/api-reference/get-user.mdx"
2707
+ ---
2708
+ title: Get a user
2709
+ description: Retrieve a single user by ID.
2710
+ badge: GET
2711
+ ---
2712
+ ```
2713
+
2714
+ Geistdocs applies a color for each method:
2715
+
2716
+ | Badge label | Color |
2717
+ | ---------------- | ----- |
2718
+ | `GET` | Green |
2719
+ | `POST` | Blue |
2720
+ | `PUT`, `PATCH` | Amber |
2721
+ | `DEL`, `DELETE` | Red |
2722
+
2723
+ Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. Any other label, such as `Beta`, keeps the default blue badge. Badge colors adapt to light and dark themes automatically.
2724
+
2702
2725
  ## Add links to the navigation
2703
2726
 
2704
2727
  The `pages` array can include internal and external links alongside content files:
@@ -208,5 +208,5 @@
208
208
  }
209
209
  ],
210
210
  "source": "apps/template/content/docs",
211
- "version": "1.15.5"
211
+ "version": "1.17.0"
212
212
  }
@@ -151,6 +151,29 @@ badge: Beta
151
151
 
152
152
  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.
153
153
 
154
+ ## Show HTTP method badges on API reference pages
155
+
156
+ Badge labels that match an HTTP method render with a method-specific color, so readers can distinguish endpoint types in an API reference sidebar at a glance. Set `badge` to the uppercase method name:
157
+
158
+ ```yaml title="content/docs/api-reference/get-user.mdx"
159
+ ---
160
+ title: Get a user
161
+ description: Retrieve a single user by ID.
162
+ badge: GET
163
+ ---
164
+ ```
165
+
166
+ Geistdocs applies a color for each method:
167
+
168
+ | Badge label | Color |
169
+ | ---------------- | ----- |
170
+ | `GET` | Green |
171
+ | `POST` | Blue |
172
+ | `PUT`, `PATCH` | Amber |
173
+ | `DEL`, `DELETE` | Red |
174
+
175
+ Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. Any other label, such as `Beta`, keeps the default blue badge. Badge colors adapt to light and dark themes automatically.
176
+
154
177
  ## Add links to the navigation
155
178
 
156
179
  The `pages` array can include internal and external links alongside content files:
@@ -29,7 +29,7 @@ badge: Beta
29
29
  ---
30
30
  ```
31
31
 
32
- 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.
32
+ 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. Badge labels that match an uppercase HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, or `DELETE`) render with a method-specific color. See [Configure sidebar navigation](/docs/guides/nested-navigation) for the full color mapping.
33
33
 
34
34
  ## Basic Markdown
35
35
 
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.5",
4
+ "version": "1.17.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -219,6 +219,10 @@
219
219
  "types": "./dist/components/switch.d.ts",
220
220
  "default": "./dist/components/switch.js"
221
221
  },
222
+ "./components/theme-switcher": {
223
+ "types": "./dist/components/theme-switcher.d.ts",
224
+ "default": "./dist/components/theme-switcher.js"
225
+ },
222
226
  "./components/textarea": {
223
227
  "types": "./dist/components/textarea.d.ts",
224
228
  "default": "./dist/components/textarea.js"
@@ -258,7 +262,7 @@
258
262
  "@orama/tokenizers": "^3.1.16",
259
263
  "@streamdown/cjk": "^1.0.1",
260
264
  "@streamdown/code": "^1.0.1",
261
- "@vercel/agent-readability": "^0.2.1",
265
+ "@vercel/agent-readability": "^0.5.0",
262
266
  "@vercel/oidc": "^3.4.1",
263
267
  "ai": "^6.0.132",
264
268
  "class-variance-authority": "^0.7.1",
@@ -276,11 +280,17 @@
276
280
  "next-themes": "^0.4.6",
277
281
  "radix-ui": "1.6.4",
278
282
  "react-player": "^3.4.0",
283
+ "remark-frontmatter": "^5.0.0",
284
+ "remark-gfm": "^4.0.1",
285
+ "remark-mdx": "^3.1.1",
286
+ "remark-parse": "^11.0.0",
279
287
  "sonner": "^2.0.7",
280
288
  "streamdown": "^2.1.0",
281
289
  "tailwind-merge": "^3.4.0",
282
290
  "ts-morph": "^27.0.2",
283
291
  "tw-animate-css": "^1.4.0",
292
+ "unified": "^11.0.5",
293
+ "unist-util-visit": "^5.1.0",
284
294
  "use-stick-to-bottom": "^1.1.1",
285
295
  "vaul": "^1.1.2",
286
296
  "zod": "^4.1.13"
@@ -294,10 +304,12 @@
294
304
  "devDependencies": {
295
305
  "@biomejs/biome": "^2.3.8",
296
306
  "@types/glob": "^9.0.0",
307
+ "@types/mdast": "^4.0.4",
297
308
  "@types/mdx": "^2.0.13",
298
309
  "@types/node": "^24.10.1",
299
310
  "@types/react": "^19.2.7",
300
311
  "@types/react-dom": "^19.2.3",
312
+ "mdast-util-mdx-jsx": "^3.2.0",
301
313
  "next": "16.2.6",
302
314
  "react": "^19.2.3",
303
315
  "react-dom": "^19.2.3",
@@ -19,7 +19,7 @@ const Layout = async ({ children, params }: LayoutProps<"/[lang]">) => {
19
19
  <GeistdocsProvider basePath={config.basePath} lang={lang}>
20
20
  <Navbar config={config} />
21
21
  {children}
22
- <Footer config={config} />
22
+ <Footer />
23
23
  </GeistdocsProvider>
24
24
  </body>
25
25
  </html>
@@ -14,6 +14,13 @@
14
14
  body {
15
15
  @apply bg-background-200 text-gray-1000;
16
16
  }
17
+
18
+ /* Geist Sans is loaded from the `geist` npm package, which exposes the
19
+ `--font-geist-sans` variable. Alias it so `font-sans`/`--font-sans`
20
+ resolves to it. */
21
+ :root {
22
+ --font-sans: var(--font-geist-sans);
23
+ }
17
24
  }
18
25
 
19
26
  /* Align docs content with navbar on mobile */
@@ -148,6 +148,29 @@ badge: Beta
148
148
 
149
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
150
 
151
+ ## Show HTTP method badges on API reference pages
152
+
153
+ Badge labels that match an HTTP method render with a method-specific color, so readers can distinguish endpoint types in an API reference sidebar at a glance. Set `badge` to the uppercase method name:
154
+
155
+ ```yaml title="content/docs/api-reference/get-user.mdx"
156
+ ---
157
+ title: Get a user
158
+ description: Retrieve a single user by ID.
159
+ badge: GET
160
+ ---
161
+ ```
162
+
163
+ Geistdocs applies a color for each method:
164
+
165
+ | Badge label | Color |
166
+ | ---------------- | ----- |
167
+ | `GET` | Green |
168
+ | `POST` | Blue |
169
+ | `PUT`, `PATCH` | Amber |
170
+ | `DEL`, `DELETE` | Red |
171
+
172
+ Method matching is case-sensitive, so use uppercase labels. `DEL` and `DELETE` render the same red badge, so prefer `DEL` when you want a narrower badge. Any other label, such as `Beta`, keeps the default blue badge. Badge colors adapt to light and dark themes automatically.
173
+
151
174
  ## Add links to the navigation
152
175
 
153
176
  The `pages` array can include internal and external links alongside content files:
@@ -27,7 +27,7 @@ badge: Beta
27
27
  ---
28
28
  ```
29
29
 
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
+ 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. Badge labels that match an uppercase HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, or `DELETE`) render with a method-specific color. See [Configure sidebar navigation](/docs/guides/nested-navigation) for the full color mapping.
31
31
 
32
32
  ## Basic Markdown
33
33
 
@@ -1,14 +1,11 @@
1
- import {
2
- Geist_Mono as createMono,
3
- Geist as createSans,
4
- } from "next/font/google";
1
+ import { GeistSans } from "geist/font/sans";
2
+ import { Geist_Mono as createMono } from "next/font/google";
5
3
 
6
- export const sans = createSans({
7
- variable: "--font-sans",
8
- subsets: ["latin"],
9
- weight: "variable",
10
- display: "swap",
11
- });
4
+ // Geist Sans is loaded from the `geist` npm package (local woff2) rather than
5
+ // Google Fonts so the full font-feature-settings — e.g. the `ss11` alternate
6
+ // "I" enabled in the geistdocs theme — are available. The package hardcodes the
7
+ // `--font-geist-sans` variable; it's aliased to `--font-sans` in geistdocs.css.
8
+ export const sans = GeistSans;
12
9
 
13
10
  export const mono = createMono({
14
11
  variable: "--font-mono",
@@ -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.5",
21
+ "@vercel/geistdocs": "1.17.0",
22
22
  "@vercel/speed-insights": "^1.3.1",
23
23
  "ai": "^6.0.132",
24
24
  "class-variance-authority": "^0.7.1",
@@ -30,6 +30,7 @@
30
30
  "fumadocs-core": "16.2.2",
31
31
  "fumadocs-mdx": "14.0.4",
32
32
  "fumadocs-ui": "16.2.2",
33
+ "geist": "^1.7.1",
33
34
  "jotai": "^2.15.2",
34
35
  "lucide-react": "^0.555.0",
35
36
  "mermaid": "^11.12.2",