1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-02-24 03:23:08 +01:00
developer-roadmap/lib/roadmap.ts

41 lines
904 B
TypeScript
Raw Normal View History

2021-08-29 16:05:19 +02:00
import roadmaps from '../content/roadmaps.json';
export type RoadmapType = {
seo: {
title: string;
description: string;
keywords: string[]
},
title: string,
description: string,
featuredTitle: string;
featuredDescription: string,
author: {
name: string,
url: string
},
featured: boolean,
imagePath?: string,
contentPath?: string;
resourcesPath: string;
2021-09-26 22:02:59 +02:00
metaPath: string;
2021-08-29 16:05:19 +02:00
isCommunity: boolean;
2021-09-04 18:50:38 +02:00
isUpcoming: boolean;
2021-08-29 21:29:14 +02:00
id: string;
2021-09-04 19:14:02 +02:00
pdfUrl?: string;
2021-08-29 16:05:19 +02:00
};
2021-08-29 21:29:14 +02:00
export function getRoadmapById(id: string): RoadmapType | undefined {
return (roadmaps as RoadmapType[]).find(roadmap => roadmap.id === id);
2021-08-29 16:05:19 +02:00
}
export function getAllRoadmaps(): RoadmapType[] {
return (roadmaps as RoadmapType[]);
}
export function getFeaturedRoadmaps(): RoadmapType[] {
const roadmaps: RoadmapType[] = getAllRoadmaps();
return roadmaps.filter(roadmap => roadmap.featured);
}