diff --git a/src/components/FeaturedRoadmaps/FeaturedRoadmapItem.astro b/src/components/FeaturedRoadmaps/FeaturedRoadmapItem.astro new file mode 100644 index 000000000..5f8519107 --- /dev/null +++ b/src/components/FeaturedRoadmaps/FeaturedRoadmapItem.astro @@ -0,0 +1,56 @@ +--- +import type { RoadmapFileType } from '../../lib/roadmap'; + +export interface Props { + roadmap: RoadmapFileType; +} + +const { roadmap } = Astro.props; +const frontmatter = roadmap.frontmatter; + +let roadmapTitle = frontmatter.featuredTitle; + +// Lighthouse considers "Go" as a non-descriptive text such as "Submit" etc. +// Adding "Roadmap" as a postfix to make it not complain ¯\_(ツ)_/¯ +if (roadmapTitle === 'Go') { + roadmapTitle = 'Go Roadmap'; +} +--- + + + + {roadmapTitle} + + + { + frontmatter.isNew && ( + + + + + + New + + ) + } + + { + frontmatter.isUpcoming && ( + + + + + + Upcoming + + ) + } + diff --git a/src/components/FeaturedRoadmaps/FeaturedRoadmaps.astro b/src/components/FeaturedRoadmaps/FeaturedRoadmaps.astro new file mode 100644 index 000000000..39317ec20 --- /dev/null +++ b/src/components/FeaturedRoadmaps/FeaturedRoadmaps.astro @@ -0,0 +1,31 @@ +--- +import type { RoadmapFileType } from '../../lib/roadmap'; +import FeaturedRoadmapItem from './FeaturedRoadmapItem.astro'; + +export interface Props { + roadmaps: RoadmapFileType[]; + heading: string; +} + +const { roadmaps, heading } = Astro.props; +--- + +
+
+ + + +
+
diff --git a/src/lib/roadmap.ts b/src/lib/roadmap.ts index d3da51030..e574a9908 100644 --- a/src/lib/roadmap.ts +++ b/src/lib/roadmap.ts @@ -14,6 +14,7 @@ export interface RoadmapFrontmatter { description: string; hasTopics: boolean; isNew: boolean; + isUpcoming: boolean; dimensions: { width: number; height: number; diff --git a/src/pages/index.astro b/src/pages/index.astro index 6744f9386..04786d386 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,23 +1,38 @@ --- -import BaseLayout from "../layouts/BaseLayout.astro"; +import FeaturedRoadmaps from '../components/FeaturedRoadmaps/FeaturedRoadmaps.astro'; +import BaseLayout from '../layouts/BaseLayout.astro'; +import { getRoadmapsByTag } from '../lib/roadmap'; + +const roleRoadmaps = await getRoadmapsByTag('role-roadmap'); +const skillRoadmaps = await getRoadmapsByTag('skill-roadmap'); --- -
-
-
-

- Developer Roadmaps -

- - - -

- Community created roadmaps, guides and articles to help developers grow in their career. -

-
+
+
+
+

+ Developer Roadmaps +

+ + + +

+ Community created roadmaps, guides and articles to help developers + grow in their career. +

- \ No newline at end of file + + + +
+