refactor: use a content collection for talks

This commit is contained in:
Oliver Davies 2023-04-09 10:17:52 +01:00
parent 85644e4f2d
commit 7b97ad3af2
42 changed files with 111 additions and 92 deletions

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

@ -0,0 +1,20 @@
import { defineCollection, z } from 'astro:content';
const talkCollection = defineCollection({
schema: z.object({
description: z.string(),
events: z.array(z.object({
date: z.string(),
location: z.string().optional(),
name: z.string(),
online: z.boolean().optional(),
})),
title: z.string(),
// TODO: add SpeakerDeck
// TODO: add Video
}),
});
export const collections = {
'talk': talkCollection,
};