Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { getPageImage, source } from "@/lib/source";
import { createRelativeLink } from "fumadocs-ui/mdx";
import {
DocsBody,
DocsDescription,
DocsPage,
DocsTitle,
} from "fumadocs-ui/page";
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { getPageImage, source } from "@/lib/source";
import { getMDXComponents } from "@/mdx-components";
import type { Metadata } from "next";
import { createRelativeLink } from "fumadocs-ui/mdx";

export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
export default async function Page(props: PageProps<"/[[...slug]]">) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
Expand All @@ -37,7 +37,7 @@ export async function generateStaticParams() {
}

export async function generateMetadata(
props: PageProps<"/docs/[[...slug]]">,
props: PageProps<"/[[...slug]]">,
): Promise<Metadata> {
const params = await props.params;
const page = source.getPage(params.slug);
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { source } from "@/lib/source";
import { createFromSource } from "fumadocs-core/search/server";
import { source } from "@/lib/source";

// Use staticGET for static export compatibility
export const { staticGET: GET } = createFromSource(source, {
Expand Down
11 changes: 0 additions & 11 deletions src/app/docs/layout.tsx

This file was deleted.

11 changes: 11 additions & 0 deletions src/app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import { RootProvider } from "fumadocs-ui/provider/next";
import "./global.css";
import { Space_Grotesk, Space_Mono } from "next/font/google";
import { baseOptions } from "@/lib/layout.shared";
import { source } from "@/lib/source";
import "./global.css";

const spaceGrotesk = Space_Grotesk({
subsets: ["latin"],
Expand All @@ -24,7 +27,11 @@ export default function Layout({ children }: LayoutProps<"/">) {
suppressHydrationWarning
>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
<RootProvider>
<DocsLayout tree={source.pageTree} {...baseOptions()}>
{children}
</DocsLayout>
</RootProvider>
</body>
</html>
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/og/docs/[...slug]/route.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getPageImage, source } from "@/lib/source";
import { generate as DefaultImage } from "fumadocs-ui/og";
import { notFound } from "next/navigation";
import { ImageResponse } from "next/og";
import { generate as DefaultImage } from "fumadocs-ui/og";
import { getPageImage, source } from "@/lib/source";

export const revalidate = false;

Expand Down
5 changes: 0 additions & 5 deletions src/app/page.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions src/components/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use client";

import { usePathname } from "next/navigation";
import { useBreadcrumb } from "fumadocs-core/breadcrumb";
import * as PageTree from "fumadocs-core/page-tree";
import { Fragment } from "react";
import type * as PageTree from "fumadocs-core/page-tree";
import { ChevronRight } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { Fragment } from "react";

export function Breadcrumb({ tree }: { tree: PageTree.Root }) {
const pathname = usePathname();
Expand Down
2 changes: 1 addition & 1 deletion src/components/InstallSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState } from "react";
import { Check, Copy, Terminal } from "lucide-react";
import { useState } from "react";
import { cn } from "@/lib/utils"; // Assuming a utility for classnames exists or I'll inline it

// Simplified cn utility if it doesn't exist in context
Expand Down
4 changes: 2 additions & 2 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import * as PageTree from "fumadocs-core/page-tree";
import type * as PageTree from "fumadocs-core/page-tree";
import { ChevronRight } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useState } from "react";
import { ChevronRight } from "lucide-react";

interface SidebarProps {
tree: PageTree.Root;
Expand Down
4 changes: 2 additions & 2 deletions src/components/docs/SidebarSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { Search } from "lucide-react";
import { useSearchContext } from "fumadocs-ui/contexts/search";
import { useEffect, type ReactElement } from "react";
import { Search } from "lucide-react";
import { type ReactElement, useEffect } from "react";
import { cn } from "@/lib/utils";

interface SidebarSearchProps {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/source.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { docs } from "@/.source";
import { type InferPageType, loader } from "fumadocs-core/source";
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
import { docs } from "@/.source";

// See https://fumadocs.dev/docs/headless/source-api for more info
export const source = loader({
Expand Down