2023-04-09 09:17:52 +00:00
|
|
|
import { defineCollection, z } from 'astro:content';
|
|
|
|
|
2023-04-09 09:53:25 +00:00
|
|
|
const blogCollection = defineCollection({
|
|
|
|
schema: z.object({
|
|
|
|
date: z.date().or(z.null()),
|
|
|
|
draft: z.boolean().optional(),
|
|
|
|
excerpt: z.string().or(z.null()).optional(),
|
|
|
|
promoted: z.boolean().optional(),
|
|
|
|
title: z.string(),
|
|
|
|
tweets: z.boolean().optional(),
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2023-04-09 10:25:12 +00:00
|
|
|
const dailyEmailCollection = defineCollection({
|
|
|
|
schema: z.object({
|
|
|
|
pubDate: z.date(),
|
|
|
|
permalink: z.string(),
|
|
|
|
tags: z.array(z.string()).optional(),
|
|
|
|
title: z.string(),
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2023-04-09 09:17:52 +00:00
|
|
|
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(),
|
|
|
|
})),
|
2023-04-09 19:59:07 +00:00
|
|
|
speakerdeck: z.object({
|
|
|
|
id: z.string(),
|
|
|
|
ratio: z.string(),
|
|
|
|
url: z.string(),
|
|
|
|
}).optional(),
|
2023-04-09 09:17:52 +00:00
|
|
|
title: z.string(),
|
2023-04-09 19:59:07 +00:00
|
|
|
video: z.object({
|
|
|
|
id: z.string(),
|
|
|
|
type: z.enum(['vimeo', 'youtube']),
|
|
|
|
}).or(z.null()).optional(),
|
2023-04-09 09:17:52 +00:00
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
|
|
|
export const collections = {
|
2023-04-09 10:25:12 +00:00
|
|
|
'daily-email': dailyEmailCollection,
|
2023-04-09 09:53:25 +00:00
|
|
|
blog: blogCollection,
|
|
|
|
talk: talkCollection,
|
2023-04-09 09:17:52 +00:00
|
|
|
};
|