mirror of
https://github.com/Xevion/utsa-handbook.git
synced 2025-12-06 01:16:46 -06:00
Add author data collection
This commit is contained in:
7
src/content/authors/xevion.md
Normal file
7
src/content/authors/xevion.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
username: "xevion"
|
||||||
|
displayName: "Ryan Walters"
|
||||||
|
discord: ".xevion"
|
||||||
|
github: "xevion"
|
||||||
|
email: "ryan@walters.to"
|
||||||
|
---
|
||||||
@@ -1,15 +1,25 @@
|
|||||||
import { defineCollection, z } from 'astro:content';
|
import { defineCollection, z } from "astro:content";
|
||||||
|
|
||||||
const handbook = defineCollection({
|
const handbook = defineCollection({
|
||||||
type: 'content',
|
type: "content",
|
||||||
// Type-check frontmatter using a schema
|
// Type-check frontmatter using a schema
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
// Transform string to Date object
|
// Transform string to Date object
|
||||||
pubDate: z.coerce.date(),
|
pubDate: z.coerce.date(),
|
||||||
lastModified: z.coerce.date().optional(),
|
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 };
|
||||||
|
|||||||
Reference in New Issue
Block a user