-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeystatic.config.tsx
48 lines (45 loc) · 1.33 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
/* @jsxImportSource react */
import { withI18nPrefix } from "@acdh-oeaw/keystatic-lib";
import { config } from "@keystatic/core";
import { env } from "@/config/env.config";
import { defaultLocale } from "@/config/i18n.config";
import { createSoftware } from "@/lib/keystatic/collections";
import { Logo } from "@/lib/keystatic/logo";
import { createIndexPage, createMetadata } from "@/lib/keystatic/singletons";
export default config({
collections: {
[withI18nPrefix("software", defaultLocale)]: createSoftware(defaultLocale),
},
singletons: {
[withI18nPrefix("index-page", defaultLocale)]: createIndexPage(defaultLocale),
[withI18nPrefix("metadata", defaultLocale)]: createMetadata(defaultLocale),
},
storage:
env.PUBLIC_KEYSTATIC_MODE === "github" &&
env.PUBLIC_KEYSTATIC_GITHUB_REPO_OWNER &&
env.PUBLIC_KEYSTATIC_GITHUB_REPO_NAME
? {
kind: "github",
repo: {
owner: env.PUBLIC_KEYSTATIC_GITHUB_REPO_OWNER,
name: env.PUBLIC_KEYSTATIC_GITHUB_REPO_NAME,
},
branchPrefix: "content/",
}
: {
kind: "local",
},
ui: {
brand: {
mark() {
return <Logo />;
},
name: "ACDH",
},
navigation: {
HomePage: [withI18nPrefix("index-page", defaultLocale)],
Software: [withI18nPrefix("software", defaultLocale)],
Metadata: [withI18nPrefix("metadata", defaultLocale)],
},
},
});