-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.config.ts
More file actions
34 lines (33 loc) · 1.1 KB
/
content.config.ts
File metadata and controls
34 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { defineCollection, defineContentConfig, z } from "@nuxt/content";
import { asOgImageCollection } from "nuxt-og-image/content";
export default defineContentConfig({
collections: {
pages: defineCollection({
type: "page",
source: "pages/**/*.md",
schema: z.object({})
}),
posts: defineCollection(
asOgImageCollection({
type: "page",
source: {
include: "posts/**/*.md"
},
schema: z.object({
title: z.string(),
description: z.string(),
date: z.string().date(),
updated: z.string().date().optional(),
authors: z.array(
z.object({
name: z.string(),
avatar: z.string().optional()
})
),
tags: z.array(z.string()),
published: z.boolean().optional()
})
})
)
}
});