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:
32
src/pages/pages.json.astro
Normal file
32
src/pages/pages.json.astro
Normal 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)}
|
Reference in New Issue
Block a user