Skip to content

Commit 93effa3

Browse files
Update roadmap componet to include goals
1 parent 1c60533 commit 93effa3

File tree

5 files changed

+947
-43
lines changed

5 files changed

+947
-43
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@astrojs/tailwind": "^5.1.0",
1818
"astro": "^4.0.1",
1919
"astro-og-canvas": "^0.4.2",
20+
"biome": "^0.3.3",
2021
"canvaskit-wasm": "^0.39.1",
2122
"sharp": "^0.33.1",
2223
"tailwindcss": "^3.4.1",

src/components/roadmap.astro

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ interface Milestone {
55
description: string;
66
date: string; // Format: YYYY-MM
77
reached: boolean; // Indicates if the milestone is reached
8+
goals?: string[]; // Optional: array of goals
89
}
910
1011
// Props: array of milestones
@@ -15,38 +16,53 @@ interface Props {
1516
const { milestones } = Astro.props as Props;
1617
---
1718

18-
<div>
19+
<div class="not-content">
1920
{
20-
milestones.map((milestone, index) => (
21-
<div class="flex items-center justify-center h-40" style="margin:0">
22-
<div class="flex relative h-full w-6">
23-
<div
24-
class={`absolute top-1/2 -translate-y-1/2 flex-shrink-0 h-6 w-6 rounded-full ${
25-
milestone.reached ? "bg-green-500" : "bg-blue-300"
26-
} inline-flex items-center justify-center z-10`}
27-
style="margin: 0;"
28-
/>
29-
<div
30-
class={`absolute h-full w-0.5 left-1/2 -translate-x-1/2 transform ${
31-
milestone.reached ? "bg-green-500" : "bg-blue-300"
32-
}`}
33-
style="margin: 0;"
34-
/>
21+
milestones.map((milestone) => (
22+
<div class="flex">
23+
<div class="w-1/6">
24+
<div class="h-full w-full">
25+
<div class="relative h-full">
26+
<div
27+
class={`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex-shrink-0 h-6 w-6 rounded-full ${
28+
milestone.reached
29+
? "bg-green-500"
30+
: "bg-blue-300"
31+
} inline-flex items-center justify-center z-10`}
32+
/>
33+
<div
34+
class={`absolute h-full w-0.5 left-1/2 -translate-x-1/2 transform ${
35+
milestone.reached
36+
? "bg-green-500"
37+
: "bg-blue-300"
38+
}`}
39+
/>
40+
</div>
41+
</div>
3542
</div>
3643

37-
<div class="flex-grow pl-4" style="margin: 0;">
38-
<h3 class="font-bold text-lg flex items-center">
39-
{milestone.title}
44+
<div class="w-5/6 pl-4 my-4">
45+
<div class="flex gap-4">
46+
<h3 class="font-bold text-2xl flex items-center">
47+
{milestone.title}
48+
</h3>
49+
<span class="h-fit text-white text-xs font-bold px-2.5 py-0.5 rounded-md bg-violet-800 border-[1px] border-violet-300">
50+
{milestone.date}
51+
</span>
4052
{milestone.reached && (
41-
<span class="ml-4 inline-flex items-center px-2.5 py-0.5 rounded-md text-sm font-bold bg-green-500 text-white">
53+
<span class="h-fit text-white text-xs font-bold px-2.5 py-0.5 rounded-md bg-green-800 border-[1px] border-green-300">
4254
Reached
4355
</span>
4456
)}
45-
</h3>
57+
</div>
4658
<p class="text-gray-600">{milestone.description}</p>
47-
<span class="text-sm text-gray-500">
48-
Date: {milestone.date}
49-
</span>
59+
{milestone.goals && (
60+
<ul class="pl-5 mt-2">
61+
{milestone.goals.map((goal) => (
62+
<li>{goal}</li>
63+
))}
64+
</ul>
65+
)}
5066
</div>
5167
</div>
5268
))

src/content/docs/getting-started/roadmap.mdx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ import Roadmap from "../../../components/roadmap.astro";
77

88
Check our Roadmap, highlighting achievements and upcoming plans on our journey.
99

10-
<div class="relative">
10+
<div class="static min-h-full">
1111
<Roadmap
1212
milestones={[
1313
{
14-
title: "Milestone 1",
15-
description: "This is the first milestone.",
16-
date: "2022-01",
17-
reached: true,
14+
title: "Milestone 2",
15+
description: "This is the second milestone.",
16+
date: "2022-02",
17+
goals: [
18+
"Goal 1",
19+
]
1820
},
1921
{
2022
title: "Milestone 1.5",
@@ -23,10 +25,17 @@ Check our Roadmap, highlighting achievements and upcoming plans on our journey.
2325
reached: true,
2426
},
2527
{
26-
title: "Milestone 2",
27-
description: "This is the second milestone.",
28-
date: "2022-02",
28+
title: "Milestone 1",
29+
description: "This is the first milestone.",
30+
date: "2022-01",
31+
reached: true,
32+
goals: [
33+
"Goal 1",
34+
"Goal 2",
35+
"Goal 3",
36+
]
2937
},
3038
]}
3139
/>
40+
3241
</div>

src/pages/og/[...slug].ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const { getStaticPaths, GET } = OGImageRoute({
4242
weight: "Medium",
4343
families: ["Poppins", "sans-serif"],
4444
lineHeight: 1.5,
45-
}
46-
}
45+
},
46+
},
4747
};
4848
},
4949
});

0 commit comments

Comments
 (0)