mirror of
https://github.com/pterodactyl/documentation.git
synced 2026-02-04 21:04:32 -06:00
28 lines
755 B
TypeScript
28 lines
755 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: '/',
|
|
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}`;
|
|
}
|