-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
108 lines (104 loc) · 2.14 KB
/
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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { CATEGORIES } from '../src/data/categories.ts'
import { defineConfig } from 'tinacms'
// Your hosting provider likely exposes this as an environment variable
const branch = process.env.HEAD || process.env.VERCEL_GIT_COMMIT_REF || 'main'
export default defineConfig({
branch,
clientId: null, // Get this from tina.io
token: null, // Get this from tina.io
build: {
outputFolder: 'admin',
publicFolder: 'public'
},
media: {
tina: {
mediaRoot: '/src/assets/images',
publicFolder: ''
}
},
schema: {
collections: [
{
name: 'post',
label: 'Blog Post',
path: 'src/content/blog',
format: 'mdx',
fields: [
{
type: 'image',
label: 'Cover Image',
required: true,
name: 'heroImage',
description: 'The image used for the cover of the post'
},
{
type: 'string',
required: true,
name: 'category',
label: 'Category',
description: 'Select an category for this post',
options: [...CATEGORIES]
},
{
type: 'string',
label: 'description',
required: true,
name: 'description',
description: 'A short description of the post'
},
{
type: 'datetime',
name: 'pubDate',
label: 'Publication Date',
required: true
},
{
name: 'draft',
label: 'Draft',
type: 'boolean',
description: 'If this is checked the post will not be published'
},
{
type: 'string',
name: 'tags',
required: true,
label: 'Tags',
description: 'Tags for this post',
list: true,
ui: {
component: 'tags'
}
},
{
type: 'string',
name: 'title',
label: 'Title',
isTitle: true,
required: true
},
{
type: 'rich-text',
label: 'Body',
name: 'SButton',
isBody: true,
templates: [
// Custom Components
{
label: 'SButton',
name: 'SButton',
fields: [
{
type: 'rich-text',
label: 'SButton',
name: 'children',
isBody: true
}
]
}
]
}
]
}
]
}
})