mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user