refactor: Migrate documentation content, rebuild UI components, and update core architecture.

This commit is contained in:
gitfromwildan
2026-03-10 01:38:58 +07:00
parent aac81dff8a
commit ab755844a3
132 changed files with 3947 additions and 12862 deletions

35
lib/routes.ts Normal file
View File

@@ -0,0 +1,35 @@
import docuConfig from "@/docu.json"; // Import JSON file
export type ContextInfo = {
icon: string;
description: string;
title?: string;
};
export type EachRoute = {
title: string;
href: string;
noLink?: boolean;
context?: ContextInfo;
items?: EachRoute[];
};
export const ROUTES: EachRoute[] = docuConfig.routes;
type Page = { title: string; href: string };
function getRecursiveAllLinks(node: EachRoute): Page[] {
const ans: Page[] = [];
if (!node.noLink) {
ans.push({ title: node.title, href: node.href });
}
node.items?.forEach((subNode) => {
const temp = { ...subNode, href: `${node.href}${subNode.href}` };
ans.push(...getRecursiveAllLinks(temp));
});
return ans;
}
export const page_routes: Page[] = ROUTES.map((route) =>
getRecursiveAllLinks(route)
).flat();