-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeystatic.config.ts
57 lines (55 loc) · 1.75 KB
/
keystatic.config.ts
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
import { config, fields, collection } from '@keystatic/core';
const isRemote = import.meta.env.PUBLIC_IS_REMOTE_ENVIRONMENT === 'true';
export default config({
storage: isRemote ? {
kind: 'github',
repo: 'yom-ko/yomko.dev',
} : { kind: 'local' },
collections: {
blog: collection({
label: 'Blog',
path: 'src/content/blog/*',
format: { contentField: 'content' },
entryLayout: 'content',
slugField: 'title',
schema: {
content: fields.mdx({
label: 'Content',
extension: 'md',
}),
title: fields.slug({
name: { label: 'Title', validation: { isRequired: true } },
}),
description: fields.text({
label: 'Description',
multiline: true,
validation: { length: { min: 30, max: 160 } },
}),
// thumbnail: fields.image({
// label: 'Thumbnail',
// directory: 'public/images',
// publicPath: '/images',
// }),
// language: fields.select({
// label: 'Language',
// defaultValue: 'en',
// options: [
// { label: 'English', value: 'en', },
// { label: 'Russian', value: 'ru', }
// ]
// }),
tags: fields.array(
fields.text({ label: 'Tag' }),
{
label: 'Tags',
itemLabel: props => props.value
}),
draft: fields.checkbox({ label: 'Draft' }),
featured: fields.checkbox({ label: 'Featured' }),
pubDatetime: fields.datetime({ label: 'Publication Date' }),
modDatetime: fields.datetime({ label: 'Modification Date' }),
author: fields.text({ label: 'Author', defaultValue: 'Artyom Bondarenko' }),
},
}),
},
});