From dc34bd8c2723b3e5b75a28f4918df4cc43228738 Mon Sep 17 00:00:00 2001 From: molebox Date: Fri, 12 Jun 2026 11:05:08 +0200 Subject: [PATCH] Migrate docs site to package-based Geistdocs architecture Replace the vendored Geistdocs template in apps/website with the published @vercel/geistdocs package. The package now owns the shared runtime (layout, docs renderer, search, Ask AI chat, markdown routes, proxy, and MDX components) while the app keeps thin user-owned adapters. - Add @vercel/geistdocs 1.7.2 and bump Next.js to 16.2.6 (exact peer) - Delete ~50 vendored runtime files (components/geistdocs, hooks, custom chat UI, search/chat route implementations, feedback action) - Replace routes with package factories: createDocsPage, createChatRoute, createSearchRoute, createLlmsRoute, createDocsMarkdownRoute, createSitemapMarkdownRoute, createProxy - AI chat now uses the package-owned Ask AI (AI SDK v6 via the package) - Adopt the package geistdocs.css theme with @source entries for the geistdocs and streamdown dists; add a compat token layer in global.css for user-owned components - Add new /agents.md and /.well-known/mcp.json agent-readiness routes with Streamdown agent metadata in geistdocs.tsx - Keep the landing page, playground, KaTeX/Mermaid MDX pipeline, redirects, and workspace streamdown live demos intact - Prune dependencies now owned by the package (dexie, @orama/tokenizers, ai, @ai-sdk/react, etc.) and unused shadcn components --- .gitignore | 3 +- apps/website/README.md | 224 +- .../[lang]/(home)/components/installer.tsx | 18 +- apps/website/app/[lang]/(home)/layout.tsx | 9 +- apps/website/app/[lang]/(home)/page.tsx | 2 +- .../app/[lang]/.well-known/mcp.json/route.ts | 8 + apps/website/app/[lang]/agents.md/route.ts | 6 + .../app/[lang]/docs/[[...slug]]/page.tsx | 113 +- apps/website/app/[lang]/docs/layout.tsx | 6 +- apps/website/app/[lang]/layout.tsx | 12 +- .../app/[lang]/llms.mdx/[[...slug]]/route.ts | 33 +- apps/website/app/[lang]/llms.txt/route.ts | 23 +- apps/website/app/[lang]/rss.xml/route.ts | 12 +- apps/website/app/[lang]/sitemap.md/route.ts | 212 +- apps/website/app/actions/feedback/emotions.ts | 18 - apps/website/app/actions/feedback/index.ts | 45 - apps/website/app/api/chat/route.ts | 133 +- apps/website/app/api/chat/tools.ts | 208 -- apps/website/app/api/chat/types.ts | 26 - apps/website/app/api/chat/utils.ts | 56 - apps/website/app/api/search/route.ts | 54 +- apps/website/app/global.css | 40 +- apps/website/app/sitemap.ts | 6 +- apps/website/app/styles/geistdocs.css | 604 ++++- .../components/ai-elements/message.tsx | 337 --- .../components/ai-elements/open-in-chat.tsx | 365 --- .../components/ai-elements/prompt-input.tsx | 1263 --------- .../components/ai-elements/shimmer.tsx | 64 - .../components/ai-elements/sources.tsx | 77 - .../components/ai-elements/suggestion.tsx | 56 - apps/website/components/geistdocs/ask-ai.tsx | 33 - apps/website/components/geistdocs/callout.tsx | 40 - apps/website/components/geistdocs/chat.tsx | 454 ---- .../components/geistdocs/code-block-tabs.tsx | 61 - .../components/geistdocs/code-block.tsx | 134 - .../components/geistdocs/copy-chat.tsx | 56 - .../components/geistdocs/copy-page.tsx | 27 - .../components/geistdocs/desktop-menu.tsx | 52 - .../components/geistdocs/docs-layout.tsx | 43 +- .../components/geistdocs/docs-page.tsx | 35 - .../components/geistdocs/edit-source.tsx | 30 - .../website/components/geistdocs/feedback.tsx | 139 - apps/website/components/geistdocs/footer.tsx | 30 - .../components/geistdocs/github-button.tsx | 19 - .../components/geistdocs/home-layout.tsx | 46 - apps/website/components/geistdocs/icons.tsx | 13 - .../components/geistdocs/installer.tsx | 58 - .../geistdocs/language-selector.tsx | 43 - .../components/geistdocs/mdx-components.tsx | 62 +- apps/website/components/geistdocs/mermaid.tsx | 68 - .../components/geistdocs/message-metadata.tsx | 73 - .../components/geistdocs/mobile-menu.tsx | 20 - apps/website/components/geistdocs/navbar.tsx | 30 - .../components/geistdocs/open-in-chat.tsx | 49 - .../website/components/geistdocs/provider.tsx | 56 +- .../components/geistdocs/rss-button.tsx | 10 - .../components/geistdocs/scroll-top.tsx | 21 - apps/website/components/geistdocs/search.tsx | 78 - apps/website/components/geistdocs/sidebar.tsx | 128 - .../components/geistdocs/theme-toggle.tsx | 35 - apps/website/components/geistdocs/video.tsx | 16 - apps/website/components/ui/button-group.tsx | 83 - apps/website/components/ui/card.tsx | 92 - apps/website/components/ui/collapsible.tsx | 33 - apps/website/components/ui/command.tsx | 184 -- apps/website/components/ui/dialog.tsx | 143 - apps/website/components/ui/drawer.tsx | 135 - apps/website/components/ui/dropdown-menu.tsx | 257 -- apps/website/components/ui/hover-card.tsx | 44 - apps/website/components/ui/kbd.tsx | 28 - .../website/components/ui/navigation-menu.tsx | 168 -- apps/website/components/ui/scroll-area.tsx | 58 - apps/website/components/ui/separator.tsx | 28 - apps/website/components/ui/sheet.tsx | 139 - apps/website/components/ui/sonner.tsx | 40 - apps/website/components/ui/spinner.tsx | 16 - apps/website/components/ui/tooltip.tsx | 61 - apps/website/geistdocs.tsx | 25 + apps/website/hooks/geistdocs/use-chat.ts | 23 - apps/website/hooks/geistdocs/use-sidebar.ts | 13 - apps/website/hooks/use-mobile.ts | 19 - apps/website/lib/geistdocs/config.tsx | 30 + apps/website/lib/geistdocs/db.ts | 21 - apps/website/lib/geistdocs/md-tracking.ts | 9 +- apps/website/lib/geistdocs/source.ts | 55 +- apps/website/package.json | 16 +- apps/website/proxy.ts | 87 +- apps/website/source.config.ts | 53 +- pnpm-lock.yaml | 2309 +++++++++++++++-- 89 files changed, 2891 insertions(+), 7270 deletions(-) create mode 100644 apps/website/app/[lang]/.well-known/mcp.json/route.ts create mode 100644 apps/website/app/[lang]/agents.md/route.ts delete mode 100644 apps/website/app/actions/feedback/emotions.ts delete mode 100644 apps/website/app/actions/feedback/index.ts delete mode 100644 apps/website/app/api/chat/tools.ts delete mode 100644 apps/website/app/api/chat/types.ts delete mode 100644 apps/website/app/api/chat/utils.ts delete mode 100644 apps/website/components/ai-elements/message.tsx delete mode 100644 apps/website/components/ai-elements/open-in-chat.tsx delete mode 100644 apps/website/components/ai-elements/prompt-input.tsx delete mode 100644 apps/website/components/ai-elements/shimmer.tsx delete mode 100644 apps/website/components/ai-elements/sources.tsx delete mode 100644 apps/website/components/ai-elements/suggestion.tsx delete mode 100644 apps/website/components/geistdocs/ask-ai.tsx delete mode 100644 apps/website/components/geistdocs/callout.tsx delete mode 100644 apps/website/components/geistdocs/chat.tsx delete mode 100644 apps/website/components/geistdocs/code-block-tabs.tsx delete mode 100644 apps/website/components/geistdocs/code-block.tsx delete mode 100644 apps/website/components/geistdocs/copy-chat.tsx delete mode 100644 apps/website/components/geistdocs/copy-page.tsx delete mode 100644 apps/website/components/geistdocs/desktop-menu.tsx delete mode 100644 apps/website/components/geistdocs/docs-page.tsx delete mode 100644 apps/website/components/geistdocs/edit-source.tsx delete mode 100644 apps/website/components/geistdocs/feedback.tsx delete mode 100644 apps/website/components/geistdocs/footer.tsx delete mode 100644 apps/website/components/geistdocs/github-button.tsx delete mode 100644 apps/website/components/geistdocs/home-layout.tsx delete mode 100644 apps/website/components/geistdocs/icons.tsx delete mode 100644 apps/website/components/geistdocs/installer.tsx delete mode 100644 apps/website/components/geistdocs/language-selector.tsx delete mode 100644 apps/website/components/geistdocs/mermaid.tsx delete mode 100644 apps/website/components/geistdocs/message-metadata.tsx delete mode 100644 apps/website/components/geistdocs/mobile-menu.tsx delete mode 100644 apps/website/components/geistdocs/navbar.tsx delete mode 100644 apps/website/components/geistdocs/open-in-chat.tsx delete mode 100644 apps/website/components/geistdocs/rss-button.tsx delete mode 100644 apps/website/components/geistdocs/scroll-top.tsx delete mode 100644 apps/website/components/geistdocs/search.tsx delete mode 100644 apps/website/components/geistdocs/sidebar.tsx delete mode 100644 apps/website/components/geistdocs/theme-toggle.tsx delete mode 100644 apps/website/components/geistdocs/video.tsx delete mode 100644 apps/website/components/ui/button-group.tsx delete mode 100644 apps/website/components/ui/card.tsx delete mode 100644 apps/website/components/ui/collapsible.tsx delete mode 100644 apps/website/components/ui/command.tsx delete mode 100644 apps/website/components/ui/dialog.tsx delete mode 100644 apps/website/components/ui/drawer.tsx delete mode 100644 apps/website/components/ui/dropdown-menu.tsx delete mode 100644 apps/website/components/ui/hover-card.tsx delete mode 100644 apps/website/components/ui/kbd.tsx delete mode 100644 apps/website/components/ui/navigation-menu.tsx delete mode 100644 apps/website/components/ui/scroll-area.tsx delete mode 100644 apps/website/components/ui/separator.tsx delete mode 100644 apps/website/components/ui/sheet.tsx delete mode 100644 apps/website/components/ui/sonner.tsx delete mode 100644 apps/website/components/ui/spinner.tsx delete mode 100644 apps/website/components/ui/tooltip.tsx delete mode 100644 apps/website/hooks/geistdocs/use-chat.ts delete mode 100644 apps/website/hooks/geistdocs/use-sidebar.ts delete mode 100644 apps/website/hooks/use-mobile.ts create mode 100644 apps/website/lib/geistdocs/config.tsx delete mode 100644 apps/website/lib/geistdocs/db.ts diff --git a/.gitignore b/.gitignore index 10d45566..d102c5ed 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,5 @@ package-lock.json results.txt # Next.js -next-env.d.ts \ No newline at end of file +next-env.d.ts +*.tsbuildinfo diff --git a/apps/website/README.md b/apps/website/README.md index ceda0a60..774f323d 100644 --- a/apps/website/README.md +++ b/apps/website/README.md @@ -1,217 +1,49 @@ -# Geistdocs +# Streamdown Docs Website -A modern documentation template built with Next.js and [Fumadocs](https://fumadocs.dev). Designed for spinning up Vercel documentation sites quickly and consistently with built-in AI chat, GitHub discussions integration, and a beautiful UI. +The documentation and marketing site for [Streamdown](https://streamdown.ai), built on [Geistdocs](https://github.com/vercel/geistdocs) β€” Vercel's package-backed docs system powered by Next.js and [Fumadocs](https://fumadocs.dev). -## Features +The shared runtime (layout, docs renderer, search, Ask AI, markdown routes, proxy behavior, and MDX components) is provided by [`@vercel/geistdocs`](https://www.npmjs.com/package/@vercel/geistdocs). This app owns its content, configuration, and thin adapter files. -- πŸ“ **MDX-powered documentation** - Write docs in MDX with full component support -- πŸ€– **AI-powered chat** - Built-in AI assistant that understands your documentation -- πŸ’¬ **GitHub Discussions integration** - Allow users to provide feedback directly to GitHub -- 🎨 **Modern UI** - Beautiful, accessible components built with Radix UI -- πŸ” **Advanced search** - Fast, fuzzy search through all documentation -- πŸŒ™ **Dark mode** - Built-in theme switching -- πŸ“± **Responsive** - Mobile-first design that works everywhere -- ⚑ **Fast** - Built on Next.js 16 with App Router for optimal performance -- πŸ“° **RSS** - Built-in RSS feed for your documentation +## Structure -## Getting Started +- `content/docs/` - Documentation pages (MDX). Sidebar order is controlled by `content/docs/meta.json`. +- `geistdocs.tsx` - Site configuration (logo, nav, GitHub links, AI prompt and suggestions, agent metadata). +- `lib/geistdocs/` - Source and config adapters wiring the app to `@vercel/geistdocs`. +- `components/geistdocs/` - User-owned adapters for MDX components, the provider, and the docs layout. +- `app/[lang]/(home)/` - The marketing landing page. +- `app/[lang]/playground/` - The interactive Streamdown playground. +- `app/[lang]/docs/` - Docs routes rendered by `createDocsPage` from the package. +- `proxy.ts` - Markdown content negotiation (`.md`/`.mdx` URLs, `Accept: text/markdown`) and i18n handling via `createProxy`. -### Prerequisites +## AI-readable output -- Node.js 18+ and pnpm (recommended) or npm -- A GitHub repository for documentation content -- A GitHub App for discussions integration (optional) +The site serves machine-readable surfaces from package route helpers: -### Installation +- `/llms.txt` - Full documentation corpus as markdown +- `/sitemap.md` - Markdown sitemap with page summaries +- `/agents.md` - Agent-readiness metadata +- Any docs page with a `.md`/`.mdx` suffix - Per-page markdown -1. Create a new repository using this template: - -```bash -gh repo create mydocs --template vercel/geistdocs --clone -cd mydocs -``` +## Development -2. Install dependencies: +From the repository root: ```bash pnpm install +pnpm dev --filter website ``` -3. Configure environment variables (see [Environment Variables](#environment-variables) below) - -4. Run the development server: - -```bash -pnpm dev -``` - -5. Open [http://localhost:3000](http://localhost:3000) in your browser - -## Environment Variables +The site consumes the workspace `streamdown` and `@streamdown/*` packages directly, so live demos always render against the local source. -Create a `.env.local` file in the root of your project with the following variables: - -### Required Variables +## Updating Geistdocs ```bash -# GitHub Repository Configuration -# The owner of the GitHub repository (organization or username) -NEXT_PUBLIC_GEISTDOCS_OWNER=your-github-username - -# The name of your GitHub repository -NEXT_PUBLIC_GEISTDOCS_REPO=your-repo-name - -# The name of the GitHub Discussions category for feedback -NEXT_PUBLIC_GEISTDOCS_CATEGORY=Documentation - -# GitHub App Credentials (for discussions integration) -# Create a GitHub App at: https://github.com/settings/apps/new -GITHUB_APP_ID=your-app-id -GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" - -# AI Gateway API Key (for AI chat functionality) -# This is typically an OpenAI API key or compatible AI gateway -AI_GATEWAY_API_KEY=your-api-key - -# Production URL (set automatically on Vercel) -NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL=yourdomain.com +npx @vercel/geistdocs update ``` -### Setting Up GitHub App - -To enable the feedback feature that creates GitHub Discussions: - -1. Go to [GitHub Apps settings](https://github.com/settings/apps/new) -2. Create a new GitHub App with the following permissions: - - Repository permissions: - - Discussions: Read and write - - Subscribe to events: Discussions -3. Generate a private key and save it -4. Install the app on your documentation repository -5. Add the App ID and private key to your `.env.local` - -### Setting Up AI Chat - -The AI chat feature uses the Vercel AI SDK with OpenAI: - -1. Get an API key from [OpenAI](https://platform.openai.com/api-keys) -2. Add it as `AI_GATEWAY_API_KEY` in your `.env.local` -3. The chat will automatically search and answer questions about your documentation - -## Project Structure - -``` -geistdocs/ -β”œβ”€β”€ app/ -β”‚ β”œβ”€β”€ (home)/ # Landing page and marketing content -β”‚ β”œβ”€β”€ docs/ # Documentation pages -β”‚ β”œβ”€β”€ api/ -β”‚ β”‚ β”œβ”€β”€ chat/ # AI chat API endpoint -β”‚ β”‚ └── search/ # Search API endpoint -β”‚ └── actions/ # Server actions (e.g., GitHub discussions) -β”œβ”€β”€ components/ -β”‚ β”œβ”€β”€ geistdocs/ # Custom Geistdocs components -β”‚ └── ui/ # Reusable UI components -β”œβ”€β”€ content/ # MDX documentation content -β”œβ”€β”€ lib/ -β”‚ β”œβ”€β”€ source.ts # Content source adapter -β”‚ └── layout.shared.tsx # Shared layout configuration -└── source.config.ts # Fumadocs MDX configuration -``` - -## Writing Documentation - -Documentation is written in MDX format in the `content/` directory. Each file can include: - -- **Frontmatter** - Metadata like title, description, and more -- **MDX components** - Use React components directly in your markdown -- **Code blocks** - Syntax-highlighted code with Shiki - -Example: - -```mdx ---- -title: Getting Started -description: Learn how to get started with Geistdocs ---- - -# Getting Started - -Welcome to the documentation! - - - This is a custom component you can use in your docs. - -``` - -## Customization - -### Styling - -The project uses Tailwind CSS 4. Customize the theme in `tailwind.config.ts` and global styles in `app/globals.css`. - -### Components - -Add custom components to `components/geistdocs/` and import them in your MDX files. - -### Layout - -Modify the shared layout options in `lib/layout.shared.tsx` to customize the sidebar, navigation, and more. - -## Development - -```bash -# Start development server -pnpm dev - -# Build for production -pnpm build - -# Start production server -pnpm start - -# Run linter -pnpm lint - -# Format code -pnpm format -``` - -## Code Quality - -This project uses [Ultracite](https://github.com/haydenbleasel/ultracite), a zero-config Biome preset for TypeScript/React projects. All code is automatically formatted and linted with strict rules for: - -- Type safety -- Accessibility -- Performance -- React best practices - -Run `pnpm lint` to check for issues and `pnpm format` to auto-fix formatting. - -## Deployment - -### Vercel (Recommended) - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/geistdocs) - -1. Click the "Deploy" button above -2. Configure your environment variables in the Vercel dashboard -3. Deploy! - -### Other Platforms - -This is a standard Next.js application and can be deployed to any platform that supports Node.js: - -1. Build the application: `pnpm build` -2. Start the server: `pnpm start` -3. Ensure all environment variables are set - -## Learn More - -- [Next.js Documentation](https://nextjs.org/docs) - Learn about Next.js features and API -- [Fumadocs](https://fumadocs.dev) - Learn about Fumadocs -- [Ultracite](https://github.com/haydenbleasel/ultracite) - Learn about code quality standards +This bumps the `@vercel/geistdocs` dependency. Local adapter files are user-owned and never overwritten. -## License +## Environment variables -MIT +- `NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL` - Production URL used for absolute links (set automatically on Vercel) +- `AI_GATEWAY_API_KEY` - Enables the Ask AI assistant (set automatically on Vercel) diff --git a/apps/website/app/[lang]/(home)/components/installer.tsx b/apps/website/app/[lang]/(home)/components/installer.tsx index 03b731fd..d513ff00 100644 --- a/apps/website/app/[lang]/(home)/components/installer.tsx +++ b/apps/website/app/[lang]/(home)/components/installer.tsx @@ -12,33 +12,37 @@ import { InputGroupText, } from "@/components/ui/input-group"; -const CODE = "npm i streamdown"; -const TIMEOUT = 2000; +const COPY_TIMEOUT = 2000; -export const Installer = () => { +interface InstallerProps { + className?: string; + command: string; +} + +export const Installer = ({ command, className = "w-48" }: InstallerProps) => { const [copied, setCopied] = useState(false); const handleCopy = () => { - navigator.clipboard.writeText(CODE); + navigator.clipboard.writeText(command); toast.success("Copied to clipboard"); setCopied(true); track("Copied installer command"); setTimeout(() => { setCopied(false); - }, TIMEOUT); + }, COPY_TIMEOUT); }; const Icon = copied ? CheckIcon : CopyIcon; return ( - + $ - + ) => { const { lang } = await params; return ( - -
{children}
-
+ +
{children}
+
); }; diff --git a/apps/website/app/[lang]/(home)/page.tsx b/apps/website/app/[lang]/(home)/page.tsx index 02366515..cf2b0ec1 100644 --- a/apps/website/app/[lang]/(home)/page.tsx +++ b/apps/website/app/[lang]/(home)/page.tsx @@ -1,11 +1,11 @@ import DynamicLink from "fumadocs-core/dynamic-link"; import type { Metadata } from "next"; -import { Installer } from "@/components/geistdocs/installer"; import { Button } from "@/components/ui/button"; import { CenteredSection } from "./components/centered-section"; import { CTA } from "./components/cta"; import { Demo } from "./components/demo"; import { Hero } from "./components/hero"; +import { Installer } from "./components/installer"; import { Logos } from "./components/logos"; import { OneTwoSection } from "./components/one-two-section"; import { Templates } from "./components/templates"; diff --git a/apps/website/app/[lang]/.well-known/mcp.json/route.ts b/apps/website/app/[lang]/.well-known/mcp.json/route.ts new file mode 100644 index 00000000..5e1c81eb --- /dev/null +++ b/apps/website/app/[lang]/.well-known/mcp.json/route.ts @@ -0,0 +1,8 @@ +import { createMcpManifestRoute } from "@vercel/geistdocs/routes/mcp"; +import { config } from "@/lib/geistdocs/config"; + +export const { GET, generateStaticParams, revalidate } = createMcpManifestRoute( + { + config, + } +); diff --git a/apps/website/app/[lang]/agents.md/route.ts b/apps/website/app/[lang]/agents.md/route.ts new file mode 100644 index 00000000..ca644fab --- /dev/null +++ b/apps/website/app/[lang]/agents.md/route.ts @@ -0,0 +1,6 @@ +import { createAgentsRoute } from "@vercel/geistdocs/routes/agents"; +import { config } from "@/lib/geistdocs/config"; + +export const { GET, generateStaticParams, revalidate } = createAgentsRoute({ + config, +}); diff --git a/apps/website/app/[lang]/docs/[[...slug]]/page.tsx b/apps/website/app/[lang]/docs/[[...slug]]/page.tsx index 35022fae..7ca246b1 100644 --- a/apps/website/app/[lang]/docs/[[...slug]]/page.tsx +++ b/apps/website/app/[lang]/docs/[[...slug]]/page.tsx @@ -1,93 +1,22 @@ -import { createRelativeLink } from "fumadocs-ui/mdx"; -import type { Metadata } from "next"; -import { notFound } from "next/navigation"; -import { AskAI } from "@/components/geistdocs/ask-ai"; -import { CopyPage } from "@/components/geistdocs/copy-page"; -import { - DocsBody, - DocsDescription, - DocsPage, - DocsTitle, -} from "@/components/geistdocs/docs-page"; -import { EditSource } from "@/components/geistdocs/edit-source"; -import { Feedback } from "@/components/geistdocs/feedback"; +import { MobileDocsBar } from "@vercel/geistdocs/mobile-docs-bar"; +import { createDocsPage } from "@vercel/geistdocs/pages/docs"; import { getMDXComponents } from "@/components/geistdocs/mdx-components"; -import { OpenInChat } from "@/components/geistdocs/open-in-chat"; -import { ScrollTop } from "@/components/geistdocs/scroll-top"; -import { Separator } from "@/components/ui/separator"; -import { getLLMText, getPageImage, source } from "@/lib/geistdocs/source"; - -const Page = async ({ params }: PageProps<"/[lang]/docs/[[...slug]]">) => { - const { slug, lang } = await params; - const page = source.getPage(slug, lang); - - if (!page) { - notFound(); - } - - const markdown = await getLLMText(page); - const MDX = page.data.body; - - return ( - - - - - - - - - - ), - }} - toc={page.data.toc} - > - {page.data.title} - {page.data.description} - - - - - ); -}; - -export const generateStaticParams = () => source.generateParams(); - -export const generateMetadata = async ({ - params, -}: PageProps<"/[lang]/docs/[[...slug]]">) => { - const { slug, lang } = await params; - const page = source.getPage(slug, lang); - - if (!page) { - notFound(); - } - - const metadata: Metadata = { - title: page.data.title, - description: page.data.description, - openGraph: { - images: getPageImage(page).url, - }, - alternates: { - types: { - "text/markdown": slug ? `/docs/${slug.join("/")}.md` : "/docs.md", - }, - }, - }; - - return metadata; -}; - -export default Page; +import { config } from "@/lib/geistdocs/config"; +import { geistdocsSource } from "@/lib/geistdocs/source"; + +const docsPage = createDocsPage({ + config, + mdx: ({ link }) => getMDXComponents({ a: link }), + openGraph: { + images: true, + }, + source: geistdocsSource, + tableOfContentPopover: { + enabled: false, + }, + renderTop: ({ data }) => , +}); + +export default docsPage.Page; +export const generateStaticParams = docsPage.generateStaticParams; +export const generateMetadata = docsPage.generateMetadata; diff --git a/apps/website/app/[lang]/docs/layout.tsx b/apps/website/app/[lang]/docs/layout.tsx index df146f1e..0263099d 100644 --- a/apps/website/app/[lang]/docs/layout.tsx +++ b/apps/website/app/[lang]/docs/layout.tsx @@ -4,7 +4,11 @@ import { source } from "@/lib/geistdocs/source"; const Layout = async ({ children, params }: LayoutProps<"/[lang]/docs">) => { const { lang } = await params; - return {children}; + return ( +
+ {children} +
+ ); }; export default Layout; diff --git a/apps/website/app/[lang]/layout.tsx b/apps/website/app/[lang]/layout.tsx index 53a8da85..178d39f3 100644 --- a/apps/website/app/[lang]/layout.tsx +++ b/apps/website/app/[lang]/layout.tsx @@ -1,10 +1,10 @@ import "../global.css"; import "katex/dist/katex.css"; import "streamdown/styles.css"; -import { Footer } from "@/components/geistdocs/footer"; -import { Navbar } from "@/components/geistdocs/navbar"; +import { Footer } from "@vercel/geistdocs/footer"; +import { Navbar } from "@vercel/geistdocs/navbar"; import { GeistdocsProvider } from "@/components/geistdocs/provider"; -import { basePath } from "@/geistdocs"; +import { config } from "@/lib/geistdocs/config"; import { mono, sans } from "@/lib/geistdocs/fonts"; import { cn } from "@/lib/utils"; @@ -18,10 +18,10 @@ const Layout = async ({ children, params }: LayoutProps<"/[lang]">) => { suppressHydrationWarning > - - + + {children} -