Files
website/apps/docs/lib/source.ts
Mauricio Siu 1388b1266d chore: update documentation and assets for new features
- Enhanced API documentation with new MDX files and improved structure.
- Updated OpenAPI specifications to reflect recent changes and added new components.
- Refined global CSS and layout configurations for better styling and user experience.
- Added various images and icons to enrich the visual aspects of the documentation.
- Updated package dependencies to ensure compatibility with the latest features.
2025-12-07 06:26:03 -06:00

36 lines
997 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';
import { createOpenAPI } from 'fumadocs-openapi/server';
import { createAPIPage } from 'fumadocs-openapi/ui';
// See https://fumadocs.dev/docs/headless/source-api for more info
export const source = loader({
baseUrl: '/docs',
source: docs.toFumadocsSource(),
plugins: [lucideIconsPlugin()],
});
export const openapi = createOpenAPI({
input: ['./public/openapi.json'],
});
export const APIPage = createAPIPage(openapi);
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}`;
}