diff --git a/src/pages/pages.json.astro b/src/pages/pages.json.astro new file mode 100644 index 000000000..f48bf15d6 --- /dev/null +++ b/src/pages/pages.json.astro @@ -0,0 +1,32 @@ +--- +import { getAllBestPractices } from '../lib/best-pratice'; +import { getAllGuides } from '../lib/guide'; +import { getRoadmapsByTag } from '../lib/roadmap'; +import { getAllVideos } from '../lib/video'; + +const guides = await getAllGuides(); +const videos = await getAllVideos(); +const roadmaps = await getRoadmapsByTag('roadmap'); +const bestPractices = await getAllBestPractices(); + +const formattedData = { + Roadmaps: roadmaps.map((roadmap) => ({ + url: `/${roadmap.id}`, + title: roadmap.frontmatter.briefTitle, + })), + 'Best Practices': bestPractices.map((bestPractice) => ({ + url: `/${bestPractice.id}`, + title: bestPractice.frontmatter.briefTitle, + })), + Guides: guides.map((guide) => ({ + url: `/${guide.id}`, + title: guide.frontmatter.title, + })), + Videos: videos.map((guide) => ({ + url: `/${guide.id}`, + title: guide.frontmatter.title, + })), +}; +--- + +{JSON.stringify(formattedData)}