astro v5
This commit is contained in:
parent
62d2b3717a
commit
c697e7a278
11 changed files with 1136 additions and 2331 deletions
30
src/content.config.ts
Normal file
30
src/content.config.ts
Normal 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 };
|
||||
Loading…
Add table
Add a link
Reference in a new issue