chore: add helix-api and workspace config to monorepo
This commit is contained in:
40 files changed
+7145
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import { getLLMText, source } from '@/lib/source';
|
||||
|
||||
export async function loader() {
|
||||
const scan = source.getPages().map(getLLMText);
|
||||
const scanned = await Promise.all(scan);
|
||||
|
||||
return new Response(scanned.join('\n\n'));
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { source } from '@/lib/source';
|
||||
import { llms } from 'fumadocs-core/source';
|
||||
|
||||
export function loader() {
|
||||
return new Response(llms(source).index());
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { Route } from './+types/mdx';
|
||||
import { getLLMText, source } from '@/lib/source';
|
||||
|
||||
export async function loader({ params }: Route.LoaderArgs) {
|
||||
const slugs = params['*'].split('/').filter((v) => v.length > 0);
|
||||
// remove the appended "index.mdx" that's added to avoid React Router issues
|
||||
slugs.pop();
|
||||
const page = source.getPage(slugs);
|
||||
if (!page) {
|
||||
return new Response('not found', { status: 404 });
|
||||
}
|
||||
return new Response(await getLLMText(page), {
|
||||
headers: {
|
||||
'Content-Type': 'text/markdown',
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user