Skip to content

Commit 854b756

Browse files
committed
style: make sidebar items opened by default
1 parent 88b715a commit 854b756

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/app/(home)/layout.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { baseOptions } from "@/lib/layout.shared";
2-
import { source } from "@/lib/source";
32
import { DocsLayout } from "fumadocs-ui/layouts/docs";
43

54
export default function Layout({ children }: LayoutProps<"/">) {
6-
return (
7-
<DocsLayout tree={source.pageTree} {...baseOptions()}>
8-
{children}
9-
</DocsLayout>
10-
);
5+
return <DocsLayout {...baseOptions()}>{children}</DocsLayout>;
116
}

src/lib/layout.shared.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
import { source } from "@/lib/source";
2+
import { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
13
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
24

3-
export function baseOptions(): BaseLayoutProps {
5+
export function baseOptions(): BaseLayoutProps & DocsLayoutProps {
46
return {
57
nav: {
68
title: "Fire",
79
},
10+
sidebar: {
11+
defaultOpenLevel: 99,
12+
},
13+
tree: source.pageTree,
814
};
915
}

0 commit comments

Comments
 (0)