From 5f7fafc86a8b1658ade1052bdce36ec8483b07f2 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Tue, 29 Apr 2025 17:11:30 +0600 Subject: [PATCH] fix: remove tree json --- src/data/roadmaps/frontend/tree.json | 110 --------------------------- src/pages/[roadmapId]/tree.json.ts | 34 --------- 2 files changed, 144 deletions(-) delete mode 100644 src/data/roadmaps/frontend/tree.json delete mode 100644 src/pages/[roadmapId]/tree.json.ts diff --git a/src/data/roadmaps/frontend/tree.json b/src/data/roadmaps/frontend/tree.json deleted file mode 100644 index dcb3c6345..000000000 --- a/src/data/roadmaps/frontend/tree.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - { - "id": "VlNNwIEDWqQXtqkHWJYzC", - "text": "Front-end > Internet" - }, - { - "id": "yCnn-NfSxIybUQ2iTuUGq", - "text": "Front-end > Internet > How does the internet work?" - }, - { - "id": "R12sArWVpbIs_PHxBqVaR", - "text": "Front-end > Internet > What is HTTP?" - }, - { - "id": "ZhSuu2VArnzPDp6dPQQSC", - "text": "Front-end > Internet > What is Domain Name?" - }, - { - "id": "aqMaEY8gkKMikiqleV5EP", - "text": "Front-end > Internet > What is hosting?" - }, - { - "id": "hkxw9jPGYphmjhTjw8766", - "text": "Front-end > Internet > DNS and how it works?" - }, - { - "id": "P82WFaTPgQEPNp5IIuZ1Y", - "text": "Front-end > Internet > Browsers and how they work?" - }, - { - "id": "yWG2VUkaF5IJVVut6AiSy", - "text": "Front-end > HTML" - }, - { - "id": "mH_qff8R7R6eLQ1tPHLgG", - "text": "Front-end > HTML > SEO Basics" - }, - { - "id": "iJIqi7ngpGHWAqtgdjgxB", - "text": "Front-end > HTML > Accessibility" - }, - { - "id": "V5zucKEHnIPPjwHqsMPHF", - "text": "Front-end > HTML > Forms and Validations" - }, - { - "id": "z8-556o-PaHXjlytrawaF", - "text": "Front-end > HTML > Writing Semantic HTML" - }, - { - "id": "PCirR2QiFYO89Fm-Ev3o1", - "text": "Front-end > HTML > Learn the basics" - }, - { - "id": "ZhJhf1M2OphYbEmduFq-9", - "text": "Front-end > CSS" - }, - { - "id": "YFjzPKWDwzrgk2HUX952L", - "text": "Front-end > CSS > Learn the basics" - }, - { - "id": "dXeYVMXv-3MRQ1ovOUuJW", - "text": "Front-end > CSS > Making Layouts" - }, - { - "id": "TKtWmArHn7elXRJdG6lDQ", - "text": "Front-end > CSS > Responsive Design" - }, - { - "id": "ODcfFEorkfJNupoQygM53", - "text": "Front-end > JavaScript" - }, - { - "id": "wQSjQqwKHfn5RGPk34BWI", - "text": "Front-end > JavaScript > Learn the Basics" - }, - { - "id": "0MAogsAID9R04R5TTO2Qa", - "text": "Front-end > JavaScript > Learn DOM Manipulation" - }, - { - "id": "A4brX0efjZ0FFPTB4r6U0", - "text": "Front-end > JavaScript > Fetch API / Ajax (XHR)" - }, - { - "id": "NIY7c4TQEEHx0hATu-k5C", - "text": "Front-end > Version Control Systems" - }, - { - "id": "R_I4SGYqLk5zze5I1zS_E", - "text": "Front-end > Version Control Systems > Git" - }, - { - "id": "MXnFhZlNB1zTsBFDyni9H", - "text": "Front-end > VCS Hosting" - }, - { - "id": "DILBiQp7WWgSZ5hhtDW6A", - "text": "Front-end > VCS Hosting > Bitbucket" - }, - { - "id": "zIoSJMX3cuzCgDYHjgbEh", - "text": "Front-end > VCS Hosting > GitLab" - }, - { - "id": "qmTVMJDsEhNIkiwE_UTYu", - "text": "Front-end > VCS Hosting > GitHub" - } -] diff --git a/src/pages/[roadmapId]/tree.json.ts b/src/pages/[roadmapId]/tree.json.ts deleted file mode 100644 index 116a3bcec..000000000 --- a/src/pages/[roadmapId]/tree.json.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { APIRoute } from 'astro'; - -export const prerender = true; - -export async function getStaticPaths() { - const roadmapJsons = import.meta.glob('/src/data/roadmaps/**/tree.json', { - eager: true, - }); - - return Object.keys(roadmapJsons).map((filePath) => { - const filePathParts = filePath.split('/'); - const roadmapId = filePathParts?.[filePathParts.length - 2]; - - const treeJSON = roadmapJsons[filePath] as Record; - - return { - params: { - roadmapId, - }, - props: { - treeJSON: treeJSON?.default || {}, - }, - }; - }); -} - -export const GET: APIRoute = async function ({ params, request, props }) { - return new Response(JSON.stringify(props.treeJSON), { - status: 200, - headers: { - 'Content-Type': 'application/json', - }, - }); -};