forked from ArbitrumHub/ArbitrumDAO_Hub
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBlogs.tsx
67 lines (59 loc) · 1.62 KB
/
Blogs.tsx
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
import { collection, fields } from "@keystatic/core";
export const Blogs = collection({
label: "Blogs",
slugField: "title",
path: "src/content/blogs/*/",
entryLayout: "content",
format: { contentField: "content" },
schema: {
title: fields.slug({
name: { label: "Title", validation: { isRequired: true } },
}),
description: fields.text({
label: "Description",
multiline: true,
validation: { isRequired: true },
}),
image: fields.image({
label: "Image",
//add ./ to the image path
directory: "src/assets/images/blogs",
// Use the @assets path alias
publicPath: "@assets/images/blogs/",
validation: { isRequired: true },
}),
tag: fields.text({ label: "Tag" }),
label: fields.text({ label: "Label" }),
pubDate: fields.date({
label: "Publication Date",
validation: { isRequired: true },
}),
author: fields.relationship({
label: "Author",
description: "Select the author of the blog",
collection: "author",
validation: { isRequired: true },
}),
content: fields.markdoc({
label: "Content",
extension: "md",
options: {
image: {
directory: "public/images/blogs",
// Use the @assets path alias
publicPath: "/images/blogs/",
},
},
}),
},
});
export const Authors = collection({
label: "Authors",
slugField: "name",
format: { data: "json" },
path: "src/content/authors/*",
schema: {
name: fields.slug({ name: { label: "Name" } }),
description: fields.text({ label: "Description", multiline: true }),
},
});