-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeystatic.config.tsx
51 lines (48 loc) · 1.26 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
/* @jsxImportSource react */
import { config } from "@keystatic/core";
import { Logo } from "@/components/content/logo";
import { env } from "@/config/env.config";
import { locales } from "@/config/i18n.config";
import { collections } from "@/lib/content/collections";
import { i18n, withI18nPrefix } from "@/lib/content/i18n";
import { singletons } from "@/lib/content/singletons";
export default config({
collections: i18n(collections),
singletons: i18n(singletons),
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: "Website",
},
navigation: {
data: [],
pages: [
...locales.map((locale) => withI18nPrefix(locale, "indexPage")),
"---",
...locales.map((locale) => withI18nPrefix(locale, "pages")),
],
settings: [
...locales.map((locale) => withI18nPrefix(locale, "metadata")),
"---",
...locales.map((locale) => withI18nPrefix(locale, "navigation")),
],
},
},
});