-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontent.config.ts
More file actions
43 lines (42 loc) · 1.16 KB
/
Copy pathcontent.config.ts
File metadata and controls
43 lines (42 loc) · 1.16 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
35
36
37
38
39
40
41
42
43
import { defineCollection, defineContentConfig } from '@nuxt/content'
import { defineRobotsSchema } from '@nuxtjs/robots/content'
import { defineSitemapSchema } from '@nuxtjs/sitemap/content'
import { z } from 'zod'
export default defineContentConfig({
collections: {
content: defineCollection({
type: 'page',
source: '**/*.md',
schema: z.object({
robots: defineRobotsSchema(),
sitemap: defineSitemapSchema(),
}),
}),
docs: defineCollection({
source: '**/*.md',
type: 'page',
}),
blog: defineCollection({
source: 'blog/*.md',
type: 'page',
schema: z.object({
draft: z.boolean(),
title: z.string(),
date: z.string(),
publishedAt: z.date(),
updatedAt: z.date(),
description: z.string(),
toc: z.union([z.string(), z.array(z.string())]),
slug: z.string(),
url: z.string().url(),
img: z.string(),
alt: z.string().optional(),
ogImage: z.string().optional(),
provider: z.string(),
tags: z.array(z.string()),
path: z.string(),
featured: z.boolean(),
}),
}),
},
})