-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkeystatic.config.ts
More file actions
73 lines (71 loc) · 2.53 KB
/
keystatic.config.ts
File metadata and controls
73 lines (71 loc) · 2.53 KB
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
import { config, fields, collection } from "@keystatic/core";
export const showAdminUI = process.env.NODE_ENV === "development";
export default config({
storage: { kind: "local" },
collections: {
authors: collection({
label: "Authors",
slugField: "name",
path: "content/authors/*",
format: { data: "yaml" },
schema: {
name: fields.slug({ name: { label: "Name" } }),
avatar: fields.image({
label: "Avatar",
directory: "public/blog/authors",
publicPath: "/blog/authors/",
}),
role: fields.text({ label: "Role", defaultValue: "Contributor" }),
bio: fields.text({ label: "Bio", multiline: true }),
social: fields.object(
{
github: fields.url({ label: "GitHub URL" }),
twitter: fields.url({ label: "Twitter URL" }),
website: fields.url({ label: "Website URL" }),
},
{ label: "Social Links" },
),
},
}),
blogs: collection({
label: "Blog Posts",
slugField: "title",
path: "public/blog/content/*",
format: { contentField: "content" },
schema: {
title: fields.slug({ name: { label: "Title" } }),
subtitle: fields.text({ label: "Subtitle" }),
date: fields.date({ label: "Date", validation: { isRequired: true } }),
author: fields.text({ label: "Author", defaultValue: "CAMEL-AI" }),
authorprofile: fields.image({
label: "Author Photo",
directory: "public/blog/authors",
publicPath: "/blog/authors/",
}),
role: fields.text({ label: "Author Role", defaultValue: "Author" }),
description: fields.text({ label: "Description", multiline: true }),
cover: fields.image({
label: "Cover Image",
directory: "public/blog/thumbnails",
publicPath: "/blog/thumbnails/",
}),
thumbnail: fields.image({
label: "Thumbnail Image",
directory: "public/blog/thumbnails",
publicPath: "/blog/thumbnails/",
}),
featured: fields.checkbox({ label: "Featured", defaultValue: false }),
category: fields.text({ label: "Category" }),
keywords: fields.array(fields.text({ label: "Keyword" }), {
label: "Keywords",
itemLabel: (props) => props.value || "New keyword",
}),
toc: fields.checkbox({
label: "Show Table of Contents",
defaultValue: true,
}),
content: fields.mdx({ label: "Content" }),
},
}),
},
});