You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,20 +53,22 @@ Schemas enforce data consistency within a collection and serve as the source of
51
53
On top of the [built-in fields](#built-in-fields), you can define a schema by adding the `schema` property to your collection by using a [`zod`](https://zod.dev) schema:
52
54
53
55
```ts [content.config.ts]
54
-
import { defineCollection, z } from'@nuxt/content'
55
-
56
-
exportconst collections = {
57
-
blog: defineCollection({
58
-
source: 'blog/*.md',
59
-
type: 'page',
60
-
// Define custom schema for docs collection
61
-
schema: z.object({
62
-
tags: z.array(z.string()),
63
-
image: z.string(),
64
-
date: z.date()
56
+
import { defineCollection, defineContentConfig, z } from'@nuxt/content'
Copy file name to clipboardexpand all lines: docs/content/docs/2.collections/3.sources.md
+10-8
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,16 @@ description: Learn how to import your files in Nuxt Content collections.
8
8
Nuxt Content provides several ways to import content files into your collection. You can configure the source by using the `source` property within `defineCollection`:
0 commit comments