Files
MemShellParty/web/app/lib/source.ts
T
2026-04-26 21:33:15 +08:00

27 lines
706 B
TypeScript

import { docs } from "collections/server";
import { loader, type InferPageType } from "fumadocs-core/source";
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
export const source = loader({
source: docs.toFumadocsSource(),
baseUrl: "/docs",
plugins: [lucideIconsPlugin()],
});
export function getPageMarkdownUrl(page: InferPageType<typeof source>) {
const segments = [...page.slugs, "content.md"];
return {
segments,
url: `/llms.mdx/docs/${segments.join("/")}`,
};
}
export async function getLLMText(page: InferPageType<typeof source>) {
const processed = await page.data.getText("processed");
return `# ${page.data.title} (${page.url})
${processed}`;
}