-
Notifications
You must be signed in to change notification settings - Fork 0
/
keystatic.config.ts
98 lines (96 loc) · 2.53 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import { collection, config, fields } from "@keystatic/core"
// https://keystatic.com/docs/github-mode
const isProd = import.meta.env.PROD
const REPO_OWNER = ""
const REPO_NAME = ""
export default config({
storage: isProd
? {
kind: "github",
repo: `${REPO_OWNER}/${REPO_NAME}`,
}
: { kind: "local" },
ui: {
brand: {
name: "Название",
},
},
collections: {
posts: collection({
label: "Посты/Статьи",
slugField: "title",
path: "src/content/posts/*",
entryLayout: "content",
columns: ["title", "datePublished", "draft"],
format: { contentField: "content" },
schema: {
title: fields.slug({ name: { label: "Заголовок" } }),
description: fields.text({
label: "Описание",
multiline: true,
}),
datePublished: fields.datetime({
defaultValue: { kind: "now" },
label: "Дата публикации",
}),
ogImage: fields.image({
label: "Изображение",
directory: "src/assets/images/posts",
publicPath: "../../assets/images/posts/",
}),
content: fields.mdx({
label: "Контент",
description: "",
options: {
image: {
directory: "src/assets/images/posts",
publicPath: "../../assets/images/posts/",
},
},
}),
tags: fields.multiselect({
label: "Теги",
options: [{ label: "Тег", value: "Тег" }],
}),
draft: fields.checkbox({
label: "Черновик",
defaultValue: false,
description: "Установите как черновик, чтобы предотвратить его публикацию.",
}),
},
}),
pages: collection({
label: "Страницы",
slugField: "title",
path: "src/content/pages/*",
entryLayout: "content",
columns: ["title", "description", "noIndex"],
format: { contentField: "content" },
schema: {
title: fields.slug({ name: { label: "SEO Заголовок" } }),
description: fields.text({
label: "SEO Описание",
multiline: true,
}),
ogImage: fields.image({
label: "Изображение",
directory: "src/assets/images/pages",
publicPath: "../../assets/images/pages/",
}),
noIndex: fields.checkbox({
label: "НЕ Индексировать страницу?",
defaultValue: false,
}),
content: fields.mdx({
label: "Контент",
options: {
image: {
directory: "src/assets/images/pages",
publicPath: "../../assets/images/pages/",
},
},
}),
},
}),
},
})