This commit is contained in:
Reid 2024-12-09 17:23:11 -08:00
parent 62d2b3717a
commit c697e7a278
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
11 changed files with 1136 additions and 2331 deletions

30
src/content.config.ts Normal file
View file

@ -0,0 +1,30 @@
import { z, defineCollection } from "astro:content";
import { file } from "astro/loaders";
// yeah, its not the best to have arrays
const projects = defineCollection({
loader: file("src/content/projects/projects.yml"),
schema: z.object({
slug: z.string(),
name: z.string(),
description: z.string(),
date: z.date(),
dateVisual: z.string().optional(),
links: z.string().array()
})
});
const badges = defineCollection({
loader: file("src/content/badges/badges.yml"),
schema: ({ image }) => z.object({
slug: z.string(),
// oh my god lol
// most scuffed way to do this
path: z.string().startsWith("/").or(image()),
alt: z.string(),
href: z.string().optional(),
title: z.string().optional()
})
});
export const collections = { projects, badges };