22 lines
786 B
TypeScript
22 lines
786 B
TypeScript
import { defineCollection } from 'astro:content';
|
||
import { glob } from 'astro/loaders';
|
||
import { z } from 'astro/zod';
|
||
|
||
const projects = defineCollection({
|
||
loader: glob({ pattern: '**/*.md', base: './src/content/projects' }),
|
||
schema: z.object({
|
||
title: z.string(),
|
||
summary: z.string(),
|
||
domain: z.enum(['hardware', 'silicon', 'systems', 'homelab', 'personal']),
|
||
domainLabel: z.string(), // e.g. "HARDWARE · PCB"
|
||
when: z.string(), // e.g. "NOV 24 – FEB 25"
|
||
whenLabel: z.enum(['WHEN', 'STATUS']).default('WHEN'),
|
||
order: z.number(),
|
||
draft: z.boolean().default(false),
|
||
tech: z.array(z.string()).default([]),
|
||
links: z.array(z.object({ label: z.string(), href: z.string().url() })).default([]),
|
||
}),
|
||
});
|
||
|
||
export const collections = { projects };
|