docs: add llms
This commit is contained in:
@@ -1,10 +1,27 @@
|
||||
import {
|
||||
OPENPANEL_BASE_URL,
|
||||
OPENPANEL_DESCRIPTION,
|
||||
OPENPANEL_NAME,
|
||||
} from '@/lib/openpanel-brand';
|
||||
import { getLLMText, source } from '@/lib/source';
|
||||
|
||||
export const revalidate = false;
|
||||
export const dynamic = 'force-static';
|
||||
|
||||
const header = `# ${OPENPANEL_NAME} – Full documentation for LLMs
|
||||
|
||||
${OPENPANEL_DESCRIPTION}
|
||||
|
||||
This file contains the full text of all documentation pages. Each section is separated by --- and includes a canonical URL.
|
||||
|
||||
`;
|
||||
|
||||
export async function GET() {
|
||||
const scan = source.getPages().map(getLLMText);
|
||||
const scanned = await Promise.all(scan);
|
||||
const pages = source.getPages().slice().sort((a, b) => a.url.localeCompare(b.url));
|
||||
const scanned = await Promise.all(pages.map(getLLMText));
|
||||
|
||||
return new Response(scanned.join('\n\n'));
|
||||
return new Response(header + scanned.join('\n\n'), {
|
||||
headers: {
|
||||
'Content-Type': 'text/plain; charset=utf-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user