-
Notifications
You must be signed in to change notification settings - Fork 2
/
keystatic.config.ts
45 lines (43 loc) · 1.14 KB
/
keystatic.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
43
44
45
import { config, collection, fields } from "@keystatic/core";
import { cloudImage } from "@keystatic/core/component-blocks";
export const componentBlocks = {
"cloud-image": cloudImage({ label: "Image" }),
};
export default config({
storage: {
kind: "local",
},
collections: {
categories: collection({
label: "Categories",
slugField: "name",
path: "src/content/categories/*",
schema: {
name: fields.slug({ name: { label: "Name" } }),
intro: fields.text({ label: "Intro", multiline: true }),
},
}),
topics: collection({
label: "Topics",
slugField: "title",
path: "src/content/topics/*",
format: { contentField: "content" },
entryLayout: "content",
schema: {
title: fields.slug({ name: { label: "Title" } }),
category: fields.relationship({
label: "Category",
collection: "categories",
}),
content: fields.document({
label: "Content",
componentBlocks,
formatting: true,
dividers: true,
links: true,
images: true,
}),
},
}),
},
});