This commit is contained in:
rzmk 2025-09-30 14:59:12 -04:00
parent 16088fc929
commit 64708d2d68
26 changed files with 1376 additions and 0 deletions

25
docs/lib/source.ts Normal file
View file

@ -0,0 +1,25 @@
import { type InferPageType, loader } from "fumadocs-core/source";
import { docs } from "@/.source";
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
export const source = loader({
baseUrl: "/docs",
source: docs.toFumadocsSource(),
});
export function getPageImage(page: InferPageType<typeof source>) {
const segments = [...page.slugs, "image.png"];
return {
segments,
url: `/og/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}`;
}