Skip to content

Commit 2be3f6f

Browse files
use the reusable CofestProject card component in the blog post
1 parent f096e56 commit 2be3f6f

5 files changed

Lines changed: 118 additions & 158 deletions

File tree

astro/src/build/normalize-content.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ const KNOWN_COMPONENTS = [
456456
'ReleaseGuardiansLabelPill',
457457
'ReleaseGuardiansCoordination',
458458
'CofestBoard',
459+
'CofestProject',
459460
];
460461

461462
function bodyHasComponents(body) {

astro/src/components/CofestProject.vue

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ import { Badge } from '@/components/ui/badge';
55
66
defineProps<{
77
project: Project;
8+
standalone?: boolean;
9+
postEvent?: boolean;
10+
hasOutcomes?: boolean;
811
}>();
912
</script>
1013

1114
<template>
12-
<Card class="gx-tile h-full border-galaxy-primary/10 py-0 gap-0">
15+
<Card :class="['gx-tile border-galaxy-primary/10 py-0 gap-0', { 'h-full': !standalone }]">
1316
<CardHeader class="pt-4 pb-1">
1417
<CardTitle class="m-0 text-galaxy-dark text-base leading-tight">{{ project.project }}</CardTitle>
1518
</CardHeader>
@@ -19,15 +22,19 @@ defineProps<{
1922
<span class="text-galaxy-grey">Lead: </span>
2023
<span class="font-semibold text-galaxy-primary">{{ project.lead }}</span>
2124
</div>
22-
<div class="team-section">
23-
<span class="team-label">TEAM</span>
25+
<div v-if="project.assignees.length > 0 || !postEvent" class="team-section">
26+
<span class="section-label">TEAM</span>
2427
<div v-if="project.assignees.length > 0" class="flex flex-wrap gap-1.5">
2528
<Badge v-for="name in project.assignees" :key="name" variant="default" class="text-xs font-normal">
2629
{{ name }}
2730
</Badge>
2831
</div>
2932
<p v-else class="text-xs text-galaxy-primary italic">✨ Open spot — come join this project!</p>
3033
</div>
34+
<div v-if="postEvent && hasOutcomes" class="outcomes-section">
35+
<span class="section-label">OUTCOMES</span>
36+
<slot />
37+
</div>
3138
</CardContent>
3239
</Card>
3340
</template>
@@ -42,10 +49,20 @@ defineProps<{
4249
gap: 0.35rem;
4350
}
4451
45-
.team-label {
52+
.section-label {
4653
font-size: 0.7rem;
4754
font-weight: 700;
4855
letter-spacing: 0.08em;
4956
color: var(--color-galaxy-grey, #6b7280);
5057
}
58+
59+
.outcomes-section {
60+
padding-top: 0.45rem;
61+
border-top: 1px solid color-mix(in srgb, var(--color-galaxy-primary, #25537b) 12%, transparent);
62+
display: flex;
63+
flex-direction: column;
64+
gap: 0.35rem;
65+
font-size: 0.875rem;
66+
line-height: 1.6;
67+
}
5168
</style>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
import CofestProject from '@/components/CofestProject.vue';
3+
4+
interface Props {
5+
name: string;
6+
description?: string;
7+
lead?: string;
8+
assignees?: string;
9+
}
10+
11+
const { name, description = '', lead = '', assignees = '' } = Astro.props;
12+
13+
const project = {
14+
project: name,
15+
description,
16+
lead,
17+
assignees: assignees
18+
? assignees
19+
.split(',')
20+
.map((s) => s.trim())
21+
.filter(Boolean)
22+
: [],
23+
};
24+
---
25+
26+
<CofestProject project={project} standalone postEvent hasOutcomes={Astro.slots.has('default')} client:load>
27+
<slot />
28+
</CofestProject>

astro/src/pages/news/[...slug].astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Supporters from '../../components/mdx/Supporters.astro';
1616
import Contacts from '../../components/mdx/Contacts.astro';
1717
import Icon from '../../components/mdx/Icon.astro';
1818
import Insert from '../../components/mdx/Insert.astro';
19+
import CofestProject from '../../components/mdx/CofestProject.astro';
1920
import { resolveSupporters } from '../../utils/supporters';
2021
import { extractAuthors, extractFunding, resolveAuthor } from '../../utils/contributors';
2122
@@ -62,6 +63,7 @@ const components = {
6263
Contacts,
6364
Icon,
6465
Insert,
66+
CofestProject,
6567
};
6668
6769
// Schema.org structured data

0 commit comments

Comments
 (0)