From 05617a53026a3050e6e75d1d3430e0ebe4e79e22 Mon Sep 17 00:00:00 2001 From: Pablo Moyano Date: Sun, 8 Oct 2023 03:01:38 +0200 Subject: [PATCH] Working blog --- src/content/config.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/content/config.ts diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 0000000..8bf294c --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,15 @@ +import { defineCollection, z } from "astro:content"; + +const blogCollection = defineCollection({ + schema: ({ image }) => z.object({ + title: z.string(), + cover: image().refine((img) => img.width >= 1080, { + message: "Cover image must be at least 1080 pixels wide!", + }), + coverAlt: z.string(), + }), +}); + +export const collections = { + blog: blogCollection, +}; \ No newline at end of file