-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvelite.config.ts
More file actions
43 lines (41 loc) · 974 Bytes
/
velite.config.ts
File metadata and controls
43 lines (41 loc) · 974 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
40
41
42
43
import rehypePrettyCode from "rehype-pretty-code";
import { defineCollection, defineConfig, s } from "velite";
const blog = defineCollection({
name: "Blog",
pattern: "blog/**/*.mdx",
schema: s
.object({
slug: s.path(),
title: s.string().max(99),
date: s.isodate(),
authors: s.array(s.string()),
excerpt: s.string().optional(),
published: s.boolean().default(true),
body: s.mdx({
rehypePlugins: [
[
rehypePrettyCode,
{
theme: "night-owl",
keepBackground: false
}
]
]
})
})
.transform((data) => ({
...data,
slugAsParams: data.slug.split("/").slice(1).join("/")
}))
});
export default defineConfig({
root: "./src/content",
output: {
data: ".velite",
assets: "public/static",
base: "/static/",
name: "[name]-[hash:6].[ext]",
clean: true
},
collections: { blog }
});