mirror of
https://github.com/YouHaveTrouble/youhavetrouble.github.io.git
synced 2026-06-29 20:46:18 +00:00
38 lines
915 B
TypeScript
38 lines
915 B
TypeScript
import {z, defineCollection} from 'astro:content';
|
|
|
|
const posts = defineCollection({
|
|
type: 'content',
|
|
schema: z.object({
|
|
title: z.string(),
|
|
description: z.string(),
|
|
publishDate: z.string(),
|
|
tags: z.array(z.string()),
|
|
image: z.string().optional(),
|
|
}),
|
|
});
|
|
const projects = defineCollection({
|
|
type: 'content',
|
|
schema: z.object({
|
|
category: z.string(),
|
|
name: z.string(),
|
|
description: z.string(),
|
|
image: z.string().optional(),
|
|
links: z.array(z.object({text: z.string(), url: z.string()})),
|
|
technologies: z.array(z.string()).optional(),
|
|
}),
|
|
});
|
|
const writing = defineCollection({
|
|
type: 'content',
|
|
schema: z.object({
|
|
title: z.string(),
|
|
publishDate: z.date({coerce: true}),
|
|
category: z.string(),
|
|
}),
|
|
});
|
|
|
|
export const collections = {
|
|
posts,
|
|
projects,
|
|
writing,
|
|
};
|