forked from Thinkmill/keystatic-demo-landing-page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keystatic.config.tsx
56 lines (54 loc) · 1.53 KB
/
keystatic.config.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
import {
collection,
config,
fields,
singleton,
LocalConfig,
GitHubConfig,
} from "@keystatic/core";
const storage: LocalConfig["storage"] | GitHubConfig["storage"] =
process.env.NODE_ENV === "development"
? { kind: "local" }
: {
kind: "github",
repo: {
owner: process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER!,
name: process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG!,
},
};
export default config({
storage,
singletons: {
landingPage: singleton({
label: "Landing Page",
path: "content/landing-page/",
schema: {
heroHeadline: fields.text({ label: "Hero headline" }),
heroIntroText: fields.text({
label: "Hero intro text",
multiline: true,
}),
footerHeadline: fields.text({ label: "Footer headline" }),
footerText: fields.text({ label: "Footer text", multiline: true }),
},
}),
},
collections: {
testimonials: collection({
path: "content/testimonials/*/",
label: "Testimonials",
slugField: "author",
schema: {
author: fields.slug({ name: { label: "Author" } }),
testimonial: fields.text({ label: "Testimonial", multiline: true }),
featured: fields.checkbox({ label: "Featured testimonial" }),
twitterHandle: fields.text({ label: "Twitter handle" }),
avatar: fields.image({
label: "Avatar",
directory: "public/images/testimonials",
validation: { isRequired: true },
}),
},
}),
},
});