Files
website/apps/docs-new/lib/source.ts
Mauricio Siu 95682a01c2 feat: add new documentation and assets for the website
- Introduced new MDX components and configuration files for the documentation site.
- Added various images and icons to enhance the visual representation of the documentation.
- Updated package.json and pnpm-lock.yaml to include new dependencies for the documentation.
- Created a .gitignore file for the new docs app to manage ignored files effectively.
- Enhanced README with instructions for restarting the dev server after adding new MDX files.
2025-12-07 05:12:07 -06:00

28 lines
759 B
TypeScript

import { docs } from 'fumadocs-mdx:collections/server';
import { type InferPageType, loader } from 'fumadocs-core/source';
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
// See https://fumadocs.dev/docs/headless/source-api for more info
export const source = loader({
baseUrl: '/docs',
source: docs.toFumadocsSource(),
plugins: [lucideIconsPlugin()],
});
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}
${processed}`;
}