1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-28 11:39:52 +02:00

Add pages JSON

This commit is contained in:
Kamran Ahmed
2023-05-18 20:03:46 +01:00
parent 7a72c96e79
commit ad7ba44a2e

View File

@@ -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)}