mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
37 lines
869 B
TypeScript
37 lines
869 B
TypeScript
import { loader, type InferPageType } from "fumadocs-core/source";
|
|
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
|
|
import { defineDocs } from "fumadocs-mdx/macro";
|
|
|
|
export const docs = defineDocs({
|
|
dir: "content/docs",
|
|
docs: {
|
|
async: true,
|
|
postprocess: {
|
|
includeProcessedMarkdown: true,
|
|
},
|
|
},
|
|
});
|
|
|
|
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}`;
|
|
}
|