-
Notifications
You must be signed in to change notification settings - Fork 2
/
keystatic.config.ts
78 lines (76 loc) · 2.19 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
import { config, fields, singleton } from "@keystatic/core";
const dzikirSchema = {
title: fields.text({ label: "Title" }),
description: fields.text({ label: "Description" }),
dzikir: fields.array(
fields.object({
arabic: fields.text({ label: "Arabic", multiline: true }),
latin: fields.text({ label: "Latin", multiline: true }),
translation: fields.text({ label: "Translation", multiline: true }),
source: fields.text({ label: "Source", multiline: true }),
read: fields.text({ label: "Read", multiline: true }),
benefit: fields.text({ label: "Benefit", multiline: true }),
}),
{
itemLabel: (item) => item.fields.arabic.value,
label: "Dzikir",
},
),
};
export const keystaticConfig = config({
storage: {
kind: "local",
},
singletons: {
about: singleton({
label: "About",
path: "public/content/about",
format: "json",
schema: {
title: fields.text({ label: "Title" }),
// description: fields.text({ label: "Description" }),
source: fields.array(
fields.object({
label: fields.text({ label: "Label" }),
url: fields.text({ label: "URL" }),
}),
{
itemLabel: (item) => item.fields.label.value,
label: "Source",
},
),
},
}),
dzikirPagi: singleton({
label: "Dzikir Pagi",
path: "public/content/dzikir-pagi",
format: "json",
schema: dzikirSchema,
}),
dzikirSore: singleton({
label: "Dzikir Sore",
path: "public/content/dzikir-sore",
format: "json",
schema: dzikirSchema,
}),
api: singleton({
label: "API",
path: "public/content/api",
format: "json",
schema: {
title: fields.text({ label: "Title" }),
description: fields.text({ label: "Description" }),
api: fields.array(
fields.object({
label: fields.text({ label: "Label" }),
url: fields.url({ label: "URL", validation: { isRequired: true } }),
}),
{
itemLabel: (item) => item.fields.url.value as string,
label: "API",
},
),
},
}),
},
});