mirror of
https://github.com/zen-browser/docs.git
synced 2025-07-07 17:05:34 +02:00
Added icon support to source (#166)
This commit is contained in:
parent
0d3d01b0f8
commit
127e6a001f
2 changed files with 12 additions and 1 deletions
|
@ -10,7 +10,8 @@ export default function NotFound() {
|
|||
404
|
||||
</h1>
|
||||
<p className="text-gray-500">
|
||||
Looks like you've ventured into the unknown digital realm.
|
||||
Oops! You've wandered off the Zen path. Let's guide you
|
||||
back to tranquility.
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
|
|
|
@ -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(),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue