-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvelite.config.ts
42 lines (41 loc) · 1.25 KB
/
velite.config.ts
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
import { defineConfig, s } from "velite";
export default defineConfig({
collections: {
projects: {
name: "Project",
pattern: "projects/**/*.mdx",
schema: s
.object({
title: s.string(),
slug: s.slug("projects"),
// slug: s.path(), // auto generate slug from file path
description: s.string(),
date: s.isodate(),
repository: s.string().optional(),
website: s.string().optional(),
published: s.boolean().default(true),
index: s.number().optional(),
content: s.mdx(),
metadata: s.metadata(), // extract markdown reading-time, word-count, etc.
excerpt: s.excerpt(), // excerpt of markdown content
})
.transform((data) => ({
...data,
permalink: `/projects/${data.slug}`,
})),
},
about: {
name: "About",
pattern: "about/**/*.mdx",
schema: s.object({
title: s.string(),
subtitle: s.string(),
slug: s.slug("about"),
description: s.string(),
content: s.mdx(),
metadata: s.metadata(), // extract markdown reading-time, word-count, etc.
excerpt: s.excerpt(), // excerpt of markdown content
}),
},
},
});