Add author data collection

This commit is contained in:
2024-03-10 23:47:23 -05:00
parent 41544a97ef
commit 85271109f8
2 changed files with 28 additions and 11 deletions

View File

@@ -0,0 +1,7 @@
---
username: "xevion"
displayName: "Ryan Walters"
discord: ".xevion"
github: "xevion"
email: "ryan@walters.to"
---

View File

@@ -1,7 +1,7 @@
import { defineCollection, z } from 'astro:content';
import { defineCollection, z } from "astro:content";
const handbook = defineCollection({
type: 'content',
type: "content",
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
@@ -11,5 +11,15 @@ const handbook = defineCollection({
lastModified: z.coerce.date().optional(),
}),
});
const authors = defineCollection({
type: "data",
schema: z.object({
username: z.string(),
displayName: z.string(),
email: z.string().optional(),
discord: z.string().optional(),
github: z.string().optional(),
}),
});
export const collections = { handbook };
export const collections = { authors, handbook };