-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathsource.ts
More file actions
30 lines (28 loc) · 822 Bytes
/
source.ts
File metadata and controls
30 lines (28 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { docs, programs } from "@/.source";
import { loader } from "fumadocs-core/source";
import { icons } from "lucide-react";
import { createElement } from "react";
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
// it assigns a URL to your pages
baseUrl: "/docs",
source: docs.toFumadocsSource(),
icon(icon) {
if (!icon) {
// You may set a default icon
return;
}
if (icon in icons) return createElement(icons[icon as keyof typeof icons]);
},
});
export const programsSource = loader({
baseUrl: "/programs",
source: programs.toFumadocsSource(),
icon(icon) {
if (!icon) {
// You may set a default icon
return;
}
if (icon in icons) return createElement(icons[icon as keyof typeof icons]);
},
});