diff options
author | 2023-12-08 03:22:08 -0500 | |
---|---|---|
committer | 2023-12-08 09:22:08 +0100 | |
commit | 1a4d593ddb067d8082e9203d81980b5f0e6ba7ee (patch) | |
tree | f8b014a4a774149356feee7ff401295b28c81dc5 | |
parent | a7a46b1a5d86ce7e0cf305065ce419792f80f43d (diff) | |
download | astro-1a4d593ddb067d8082e9203d81980b5f0e6ba7ee.tar.gz astro-1a4d593ddb067d8082e9203d81980b5f0e6ba7ee.tar.zst astro-1a4d593ddb067d8082e9203d81980b5f0e6ba7ee.zip |
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>
-rw-r--r-- | examples/blog/src/content/config.ts | 1 | ||||
-rw-r--r-- | examples/portfolio/src/content/config.ts | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/examples/blog/src/content/config.ts b/examples/blog/src/content/config.ts index f0419223e..667a31cc7 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 049465c9f..06c6bab51 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(), |