File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Display labels for the project `domains` enum (defined in src/content.config.ts).
2+ // Shared so the gallery filter (projects.astro) and the detail page ([slug].astro)
3+ // show the same human-readable labels instead of the raw kebab-case values.
4+ // Keep these keys in sync with the enum in the schema.
5+ export const DOMAIN_LABELS = {
6+ web : 'Web' ,
7+ mobile : 'Mobile' ,
8+ 'ai-ml' : 'AI / ML' ,
9+ cybersecurity : 'Cybersecurity' ,
10+ 'game-dev' : 'Game Dev' ,
11+ hardware : 'Hardware' ,
12+ systems : 'Systems' ,
13+ infrastructure : 'Infrastructure' ,
14+ } as const ;
Original file line number Diff line number Diff line change 1010 */
1111import { getCollection , render } from ' astro:content' ;
1212import Base from ' ../../layouts/Base.astro' ;
13+ import { DOMAIN_LABELS } from ' ../../lib/domains' ;
1314
1415export async function getStaticPaths() {
1516 const projects = await getCollection (' projects' );
@@ -37,7 +38,9 @@ const { Content } = await render(entry);
3738 <div class =" flex flex-wrap items-baseline justify-between gap-2" >
3839 <h1 class =" text-3xl font-bold tracking-tight" >{ data .title } </h1 >
3940 <span class =" text-muted text-sm"
40- >{ data .domains .join (' , ' )} · { data .year } </span
41+ >{ data .domains .map ((d ) => DOMAIN_LABELS [d ]).join (' , ' )} · {
42+ data .year
43+ } </span
4144 >
4245 </div >
4346 <p class =" text-muted text-lg" >{ data .description } </p >
You can’t perform that action at this time.
0 commit comments