-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvelite.config.ts
More file actions
39 lines (36 loc) · 918 Bytes
/
velite.config.ts
File metadata and controls
39 lines (36 loc) · 918 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
30
31
32
33
34
35
36
37
38
39
import { defineCollection, defineConfig, s } from "velite";
const docs = defineCollection({
name: "Docs",
pattern: "docs/**/*.mdx",
schema: s.object({
title: s.string().max(99),
slug: s.path(),
description: s.string(),
order: s.number().default(999), // Para ordenar manualmente los items en el menú
content: s.mdx(),
raw: s.raw(),
toc: s.toc(),
}),
});
const news = defineCollection({
name: "News",
pattern: "news/**/*.mdx",
schema: s.object({
title: s.string().max(99),
slug: s.path(),
date: s.isodate(),
description: s.string(),
cover: s.string().optional(),
tags: s.array(s.string()).optional(),
links: s.array(s.object({ title: s.string(), url: s.string() })).optional(),
redirectUrl: s.string().optional(),
content: s.mdx(),
}),
});
export default defineConfig({
root: "content",
collections: {
docs,
news,
},
});