chore: add helix-api and workspace config to monorepo

This commit is contained in:
siujamo committed 2026-09-01 10:11:07 +08:00
1 parent c732624580
commit 112d0f3be4
40 files changed
+7145

No files matched your search

+17
View File
@@ -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',
},
});
}