Added icon support to source

This commit is contained in:
Jonas List 2025-04-17 22:41:45 +02:00
parent 0d3d01b0f8
commit c8f11cda15
2 changed files with 12 additions and 1 deletions

View file

@ -10,7 +10,8 @@ export default function NotFound() {
404
</h1>
<p className="text-gray-500">
Looks like you&apos;ve ventured into the unknown digital realm.
Oops! You&apos;ve wandered off the Zen path. Let&apos;s guide you
back to tranquility.
</p>
</div>
<Link

View file

@ -1,9 +1,19 @@
import { docs } from "@/.source";
import { loader } from "fumadocs-core/source";
import { icons } from "lucide-react";
import { createElement } from "react";
// `loader()` also assign a URL to your pages
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
icon(icon) {
if (!icon) {
// You may set a default icon
return;
}
if (icon in icons) return createElement(icons[icon as keyof typeof icons]);
},
baseUrl: "/",
source: docs.toFumadocsSource(),
});