-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeystatic.config.ts
More file actions
93 lines (90 loc) · 2.68 KB
/
Copy pathkeystatic.config.ts
File metadata and controls
93 lines (90 loc) · 2.68 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { config, collection, fields, singleton } from '@keystatic/core'
export const markdocConfig = fields.markdoc.createMarkdocConfig({})
export const showAdminUI = process.env.NODE_ENV === 'development'
export default config({
storage:
process.env.NEXT_PUBLIC_KEYSTATIC_STORAGE_KIND === 'github' ||
process.env.NODE_ENV === 'production'
? {
kind: 'github',
repo: 'SlashArash/blog',
}
: {
kind: 'local',
},
collections: {
posts: collection({
label: 'Posts',
slugField: 'title',
path: 'content/posts/*',
format: { contentField: 'content' },
schema: {
title: fields.slug({ name: { label: 'Title' } }),
date: fields.datetime({ label: 'Date' }),
description: fields.text({ label: 'Description', multiline: true }),
tags: fields.array(fields.text({ label: 'Tag' }), {
label: 'Tags',
itemLabel: (props) => props.value || 'New Tag', // Shows the tag name in the list
}),
keywords: fields.array(fields.text({ label: 'Keyword' }), {
label: 'Keywords',
itemLabel: (props) => props.value || 'New Keyword',
}),
seo: fields.object(
{
metaTitle: fields.text({
label: 'Meta Title (Optional)',
description: 'If empty, the post title will be used.',
}),
metaDescription: fields.text({
label: 'Meta Description',
multiline: true,
description: 'Ideally between 150-160 characters.',
}),
keywords: fields.array(fields.text({ label: 'Keyword' }), {
label: 'Keywords',
itemLabel: (props) => props.value || 'New Keyword',
}),
},
{
label: 'SEO Settings',
}
),
content: fields.markdoc({
label: 'Content',
options: {
link: true,
bold: true,
italic: true,
heading: [2, 3, 4],
blockquote: true,
orderedList: true,
unorderedList: true,
image: {
directory: 'public/images/posts',
publicPath: '/images/posts',
},
},
}),
},
}),
},
singletons: {
about: singleton({
label: 'About Me',
path: 'content/about',
format: { contentField: 'content' },
schema: {
title: fields.text({ label: 'Title' }),
content: fields.markdoc({
label: 'Content',
options: {
link: true,
bold: true,
heading: [2, 3],
},
}),
},
}),
},
})