From 1a4d593ddb067d8082e9203d81980b5f0e6ba7ee Mon Sep 17 00:00:00 2001 From: __dil__ <68077556+LouisGariepy@users.noreply.github.com> Date: Fri, 8 Dec 2023 03:22:08 -0500 Subject: [PATCH] feat(examples): make content collections type explicit Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Co-authored-by: Bjorn Lu <34116392+bluwy@users.noreply.github.com> Co-authored-by: Florian Lefebvre <69633530+florian-lefebvre@users.noreply.github.com> --- examples/blog/src/content/config.ts | 1 + examples/portfolio/src/content/config.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/blog/src/content/config.ts b/examples/blog/src/content/config.ts index f0419223e7..667a31cc73 100644 --- a/examples/blog/src/content/config.ts +++ b/examples/blog/src/content/config.ts @@ -1,6 +1,7 @@ import { defineCollection, z } from 'astro:content'; const blog = defineCollection({ + type: 'content', // Type-check frontmatter using a schema schema: z.object({ title: z.string(), diff --git a/examples/portfolio/src/content/config.ts b/examples/portfolio/src/content/config.ts index 049465c9f8..06c6bab51f 100644 --- a/examples/portfolio/src/content/config.ts +++ b/examples/portfolio/src/content/config.ts @@ -2,6 +2,7 @@ import { defineCollection, z } from 'astro:content'; export const collections = { work: defineCollection({ + type: 'content', schema: z.object({ title: z.string(), description: z.string(),