Release 3X-UI for Docker / build (push) Canceled after 0s
Release 3X-UI / build (386) (push) Canceled after 0s
Release 3X-UI / build (amd64) (push) Canceled after 0s
Release 3X-UI / build (arm64) (push) Canceled after 0s
Release 3X-UI / build (armv5) (push) Canceled after 0s
Release 3X-UI / build (armv6) (push) Canceled after 0s
Release 3X-UI / build (armv7) (push) Canceled after 0s
Release 3X-UI / build (s390x) (push) Canceled after 0s
Release 3X-UI / Build for Windows (amd64) (push) Canceled after 0s
Release 3X-UI / Publish rolling dev release (push) Canceled after 0s
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { docs } from 'collections/server';
|
|
import { loader } from 'fumadocs-core/source';
|
|
import { lucideIconsPlugin } from 'fumadocs-core/source/lucide-icons';
|
|
import { openapiPlugin } from 'fumadocs-openapi/server';
|
|
import { i18n } from '@/lib/i18n';
|
|
import { docsContentRoute, docsImageRoute, docsRoute } from './shared';
|
|
|
|
// See https://fumadocs.dev/docs/headless/source-api for more info.
|
|
// `i18n` builds one page tree per language; untranslated pages fall back to en.
|
|
// `openapiPlugin` adds HTTP-method badges to generated API reference pages.
|
|
export const source = loader({
|
|
i18n,
|
|
baseUrl: docsRoute,
|
|
source: docs.toFumadocsSource(),
|
|
plugins: [lucideIconsPlugin(), openapiPlugin()],
|
|
});
|
|
|
|
export function getPageImage(page: (typeof source)['$inferPage']) {
|
|
const segments = [...page.slugs, 'image.png'];
|
|
|
|
return {
|
|
segments,
|
|
url: `${docsImageRoute}/${segments.join('/')}`,
|
|
};
|
|
}
|
|
|
|
export function getPageMarkdownUrl(page: (typeof source)['$inferPage']) {
|
|
const segments = [...page.slugs, 'content.md'];
|
|
|
|
return {
|
|
segments,
|
|
url: `${docsContentRoute}/${segments.join('/')}`,
|
|
};
|
|
}
|
|
|
|
export async function getLLMText(page: (typeof source)['$inferPage']) {
|
|
const processed = await page.data.getText('processed');
|
|
|
|
return `# ${page.data.title} (${page.url})
|
|
|
|
${processed}`;
|
|
}
|