mirror of
https://github.com/zen-browser/docs.git
synced 2025-07-07 08:55:33 +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
|
404
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-gray-500">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link
|
||||||
|
|
|
@ -1,9 +1,19 @@
|
||||||
import { docs } from "@/.source";
|
import { docs } from "@/.source";
|
||||||
import { loader } from "fumadocs-core/source";
|
import { loader } from "fumadocs-core/source";
|
||||||
|
import { icons } from "lucide-react";
|
||||||
|
import { createElement } from "react";
|
||||||
|
|
||||||
// `loader()` also assign a URL to your pages
|
// `loader()` also assign a URL to your pages
|
||||||
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
|
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
|
||||||
export const source = loader({
|
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: "/",
|
baseUrl: "/",
|
||||||
source: docs.toFumadocsSource(),
|
source: docs.toFumadocsSource(),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue