Skip to content

Commit 127e6a0

Browse files
authored
Added icon support to source (#166)
1 parent 0d3d01b commit 127e6a0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/app/(docs)/not-found.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export default function NotFound() {
1010
404
1111
</h1>
1212
<p className="text-gray-500">
13-
Looks like you&apos;ve ventured into the unknown digital realm.
13+
Oops! You&apos;ve wandered off the Zen path. Let&apos;s guide you
14+
back to tranquility.
1415
</p>
1516
</div>
1617
<Link

src/lib/source.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import { docs } from "@/.source";
22
import { loader } from "fumadocs-core/source";
3+
import { icons } from "lucide-react";
4+
import { createElement } from "react";
35

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

0 commit comments

Comments
 (0)