diff --git a/src/components/GridRoadmapItem.astro b/src/components/GridRoadmapItem.astro new file mode 100644 index 000000000..fe2cb6d2c --- /dev/null +++ b/src/components/GridRoadmapItem.astro @@ -0,0 +1,30 @@ +--- +import type { RoadmapFrontmatter } from '../lib/roadmap'; + +export interface Props { + roadmap: RoadmapFrontmatter; +} + +const { roadmap } = Astro.props; +--- + + + {roadmap.title} + + + { + roadmap.isNew && ( + + New + + ) + } + diff --git a/src/lib/roadmap.ts b/src/lib/roadmap.ts index 3648402e6..27ad0f8f5 100644 --- a/src/lib/roadmap.ts +++ b/src/lib/roadmap.ts @@ -12,6 +12,7 @@ export interface RoadmapFrontmatter { title: string; description: string; hasTopics: boolean; + isNew: boolean; dimensions: { width: number; height: number; @@ -63,5 +64,7 @@ export async function getRoadmapsByTag(tag: string): Promise const roadmapFiles: MarkdownFileType[] = Object.values(roadmapFilesMap); const filteredRoadmaps = roadmapFiles.filter(roadmapFile => roadmapFile.frontmatter.tags.includes(tag)); - return filteredRoadmaps; + return filteredRoadmaps.sort( + (a, b) => a.frontmatter.order - b.frontmatter.order + ); } \ No newline at end of file diff --git a/src/pages/roadmaps.astro b/src/pages/roadmaps.astro index 79c2553ad..e48ac8cd0 100644 --- a/src/pages/roadmaps.astro +++ b/src/pages/roadmaps.astro @@ -1,4 +1,5 @@ --- +import GridRoadmapItem from '../components/GridRoadmapItem.astro'; import SimplePageHeader from '../components/SimplePageHeader.astro'; import BaseLayout from '../layouts/BaseLayout.astro'; import { getRoadmapsByTag } from '../lib/roadmap'; @@ -17,8 +18,17 @@ const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
-

{ roleRoadmaps.length }

-

{ skillRoadmaps.length }

+ { + roleRoadmaps.map((roleRoadmap) => ( + + )) + } + + { + skillRoadmaps.map((skillRoadmap) => ( + + )) + }