Blog posts use Date type pubDate

This commit is contained in:
Joe Carstairs
2024-07-15 16:14:08 +01:00
parent dff4a997f8
commit ea96f40f7c
13 changed files with 20 additions and 69 deletions
+2 -8
View File
@@ -1,19 +1,13 @@
import { defineCollection, z } from 'astro:content';
const dateSchema = z.object({
year: z.number(),
month: z.number(),
day: z.number(),
});
const blog = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
hidden: z.optional(z.boolean()),
description: z.string(),
pubDate: dateSchema,
updatedDate: z.optional(dateSchema),
pubDate: z.date(),
updatedDate: z.optional(z.date()),
}),
});