-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.config.ts
More file actions
70 lines (69 loc) · 1.83 KB
/
content.config.ts
File metadata and controls
70 lines (69 loc) · 1.83 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { defineContentConfig, defineCollection } from "@nuxt/content";
import { z } from "zod";
export default defineContentConfig({
collections: {
pages: defineCollection({
type: "page",
source: {
include: "**/*.md",
exclude: ["blog/**"],
schema: z.object({
title: z.string(),
date: z.string().refine((date) => !isNaN(Date.parse(date)), {
message: "Invalid date format",
}),
description: z.string().optional(),
img: z.string().optional(),
category: z.string().optional(),
}),
},
}),
blog: defineCollection({
type: "page",
source: "blog/*.md",
schema: z.object({
title: z.string(),
date: z.string().refine((date) => !isNaN(Date.parse(date)), {
message: "Invalid date format",
}),
description: z.string().optional(),
img: z.string().optional(),
category: z.string().optional(),
}),
}),
media: defineCollection({
type: "data",
source: "_media.csv",
schema: z.object({
title: z.string(),
url: z.string().url(),
type: z.enum(["image", "video"]),
id: z.string(),
year: z.number().optional(),
}),
}),
capi: defineCollection({
type: "data",
source: "_capi.csv",
schema: z.object({
nome: z.string(),
nomeCaccia: z.string().optional(),
ruolo: z.string(),
staff: z.string(),
coca: z.number(),
desc: z.string().optional(),
img: z.string(),
order: z.number(),
}),
}),
quotes: defineCollection({
type: "data",
source: "_quotes.csv",
schema: z.object({
text: z.string(),
type: z.string(),
author: z.string().optional(),
}),
}),
},
});