feat: upgrade docs

This commit is contained in:
ReaJason
2026-03-30 21:55:55 +08:00
parent a11b41d403
commit ba53112010
17 changed files with 496 additions and 314 deletions
+19 -2
View File
@@ -1,9 +1,26 @@
import { loader } from "fumadocs-core/source";
import { loader, type InferPageType } from 'fumadocs-core/source';
import { docs } from 'collections/server';
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
import { docs } from "../../.source/server";
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}`;
}