Skip to content

Commit 1bb6fd4

Browse files
committed
feat(deps): add lucide-react and update fumadocs dependencies; refactor import styles
1 parent d3bdf52 commit 1bb6fd4

File tree

9 files changed

+44
-24
lines changed

9 files changed

+44
-24
lines changed

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createMDX } from 'fumadocs-mdx/next';
1+
import { createMDX } from "fumadocs-mdx/next";
22

33
const withMDX = createMDX();
44

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
"postinstall": "fumadocs-mdx"
1010
},
1111
"dependencies": {
12+
"fumadocs-core": "15.3.1",
13+
"fumadocs-mdx": "11.6.3",
14+
"fumadocs-ui": "15.3.1",
15+
"lucide-react": "^0.525.0",
1216
"next": "15.3.1",
1317
"react": "^19.1.0",
14-
"react-dom": "^19.1.0",
15-
"fumadocs-ui": "15.3.1",
16-
"fumadocs-core": "15.3.1",
17-
"fumadocs-mdx": "11.6.3"
18+
"react-dom": "^19.1.0"
1819
},
1920
"devDependencies": {
2021
"@types/node": "22.15.12",

source.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
defineDocs,
44
frontmatterSchema,
55
metaSchema,
6-
} from 'fumadocs-mdx/config';
6+
} from "fumadocs-mdx/config";
77

88
// You can customise Zod schemas for frontmatter and `meta.json` here
99
// see https://fumadocs.vercel.app/docs/mdx/collections#define-docs

src/app/docs/[[...slug]]/page.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { source } from '@/lib/source';
1+
import { source } from "@/lib/source";
22
import {
33
DocsPage,
44
DocsBody,
55
DocsDescription,
66
DocsTitle,
7-
} from 'fumadocs-ui/page';
8-
import { notFound } from 'next/navigation';
9-
import { createRelativeLink } from 'fumadocs-ui/mdx';
10-
import { getMDXComponents } from '@/mdx-components';
7+
} from "fumadocs-ui/page";
8+
import { notFound } from "next/navigation";
9+
import { createRelativeLink } from "fumadocs-ui/mdx";
10+
import { getMDXComponents } from "@/mdx-components";
1111

1212
export default async function Page(props: {
1313
params: Promise<{ slug?: string[] }>;
@@ -19,7 +19,14 @@ export default async function Page(props: {
1919
const MDXContent = page.data.body;
2020

2121
return (
22-
<DocsPage toc={page.data.toc} full={page.data.full}>
22+
<DocsPage
23+
toc={page.data.toc}
24+
tableOfContent={{
25+
style: "clerk",
26+
single: false,
27+
}}
28+
full={page.data.full}
29+
>
2330
<DocsTitle>{page.data.title}</DocsTitle>
2431
<DocsDescription>{page.data.description}</DocsDescription>
2532
<DocsBody>

src/app/docs/layout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
2-
import type { ReactNode } from 'react';
3-
import { baseOptions } from '@/app/layout.config';
4-
import { source } from '@/lib/source';
1+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
2+
import type { ReactNode } from "react";
3+
import { baseOptions } from "@/app/layout.config";
4+
import { source } from "@/lib/source";
55

66
export default function Layout({ children }: { children: ReactNode }) {
77
return (

src/app/global.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@import 'tailwindcss';
2-
@import 'fumadocs-ui/css/neutral.css';
3-
@import 'fumadocs-ui/css/preset.css';
1+
@import "tailwindcss";
2+
@import "fumadocs-ui/css/vitepress.css";
3+
@import "fumadocs-ui/css/preset.css";

src/lib/source.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
import { docs } from '@/.source';
2-
import { loader } from 'fumadocs-core/source';
1+
import { docs } from "@/.source";
2+
import { loader } from "fumadocs-core/source";
3+
import { icons } from "lucide-react";
4+
import { createElement } from "react";
35

46
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
57
export const source = loader({
68
// it assigns a URL to your pages
7-
baseUrl: '/docs',
9+
baseUrl: "/docs",
810
source: docs.toFumadocsSource(),
11+
icon(icon) {
12+
if (!icon) {
13+
// You may set a default icon
14+
return;
15+
}
16+
if (icon in icons) return createElement(icons[icon as keyof typeof icons]);
17+
},
918
});

src/mdx-components.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import defaultMdxComponents from 'fumadocs-ui/mdx';
2-
import type { MDXComponents } from 'mdx/types';
1+
import defaultMdxComponents from "fumadocs-ui/mdx";
2+
import type { MDXComponents } from "mdx/types";
33

44
// use this function to get MDX components, you will need it for rendering MDX
55
export function getMDXComponents(components?: MDXComponents): MDXComponents {

0 commit comments

Comments
 (0)