[READ-ONLY] Mirror of https://github.com/flo-bit/dogumentation. Simple, minimalistic documentation template using astro
flo-bit.dev/dogumentation/
696 B
20 lines
1import type { APIRoute } from "astro";
2import config from "src/config";
3import { getSortedDocs, getDocs } from "src/utils";
4
5const docs = await getDocs();
6
7export const GET: APIRoute = async () => {
8 return new Response(
9 `# ${config.SITE_NAME} Documentation Overview\n\n${docs
10 .map((category) => {
11 return `${category.category}\n\n${category.docs
12 .map((doc) => {
13 return `${doc.data.title}:\n${config.SITE}${config.BASE}/${doc.id}\n\n`;
14 })
15 .join("")}`;
16 })
17 .join("\n\n")}`,
18 { headers: { "Content-Type": "text/plain; charset=utf-8" } }
19 );
20};