blob: 6f6cde9623c41ab27751d42967741c6652cdd665 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { defineCollection } from 'astro:content';
import { z } from 'zod';
const blog = defineCollection({
schema: z.object({
title: z.string(),
description: z.string(),
publishDate: z.string().or(z.date()).transform(val => new Date(val)),
updatedDate: z.string().or(z.date()).transform(val => new Date(val)).optional(),
socialImage: z.string().optional(),
coverImage: z.string().optional(),
lang: z.enum(['en']).default('en'),
}),
});
export const collections = { blog };
|