chore: update to Fumadocs 15.7 (#4154)

Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Co-authored-by: Kinfe123 <kinfishtech@gmail.com>
This commit is contained in:
Fuma Nama
2025-08-23 10:00:45 +08:00
committed by GitHub
parent c45ad901ce
commit d20f9a763c
32 changed files with 6469 additions and 4588 deletions

View File

@@ -19,6 +19,7 @@ import {
} from "lucide-react";
import { ReactNode, SVGProps } from "react";
import { Icons } from "./icons";
import { PageTree } from "fumadocs-core/server";
interface Content {
title: string;
@@ -34,6 +35,51 @@ interface Content {
}[];
}
export function getPageTree(): PageTree.Root {
return {
$id: "root",
name: "docs",
children: [
{
type: "folder",
root: true,
name: "Docs",
description: "get started, concepts, and plugins.",
children: contents.map(contentToPageTree),
},
{
type: "folder",
root: true,
name: "Examples",
description: "exmaples and guides.",
children: examples.map(contentToPageTree),
},
],
};
}
function contentToPageTree(content: Content): PageTree.Folder {
return {
type: "folder",
icon: <content.Icon />,
name: content.title,
index: content.href
? {
icon: <content.Icon />,
name: content.title,
type: "page",
url: content.href,
}
: undefined,
children: content.list.map((item) => ({
type: "page",
url: item.href,
name: item.title,
icon: <item.icon />,
})),
};
}
export const contents: Content[] = [
{
title: "Get Started",