We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b918916 + 90c5127 commit e6e8ae0Copy full SHA for e6e8ae0
1 file changed
src/content/docs/en/guides/assets.mdx
@@ -160,9 +160,10 @@ This is a blog post
160
A new `image` helper for content collections lets you validate the image metadata using Zod.
161
162
```ts title="src/content/config.ts"
163
-import { defineCollection, z, image } from "astro:content";
+import { defineCollection, z } from "astro:content";
164
+
165
const blogCollection = defineCollection({
- schema: z.object({
166
+ schema: ({ image }) => z.object({
167
title: z.string(),
168
cover: image().refine((img) => img.width >= 1080, {
169
message: "Cover image must be at least 1080 pixels wide!",
0 commit comments