feat: upgrade docs

This commit is contained in:
ReaJason
2026-03-30 21:55:55 +08:00
parent a11b41d403
commit ba53112010
17 changed files with 496 additions and 314 deletions
+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 "content.md"
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; charset=utf-8',
},
});
}