-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.config.ts
More file actions
29 lines (28 loc) · 865 Bytes
/
Copy pathcontent.config.ts
File metadata and controls
29 lines (28 loc) · 865 Bytes
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
import { defineCollection, defineContentConfig } from "@nuxt/content";
import * as v from "valibot";
export default defineContentConfig({
collections: {
articles: defineCollection({
source: {
include: "articles/**/*.md",
repository: "https://github.com/danielwaltz/content",
},
type: "page",
schema: v.object({
title: v.pipe(v.string(), v.minLength(1)),
description: v.pipe(v.string(), v.minLength(1)),
date: v.pipe(v.string(), v.minLength(1)),
status: v.picklist(["draft", "published"]),
discussion: v.optional(v.pipe(v.string(), v.url())),
meta: v.object({
readingTime: v.object({
text: v.string(),
minutes: v.number(),
time: v.number(),
words: v.number(),
}),
}),
}),
}),
},
});