63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
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: process.env.TINA_CLIENT_ID || '',
|
|
token: process.env.TINA_TOKEN || '',
|
|
|
|
build: {
|
|
outputFolder: 'admin',
|
|
publicFolder: 'src/assets/img',
|
|
},
|
|
media: {
|
|
tina: {
|
|
mediaRoot: '',
|
|
publicFolder: 'src/assets/img',
|
|
},
|
|
},
|
|
schema: {
|
|
collections: [
|
|
{
|
|
name: 'post',
|
|
label: 'Posts',
|
|
path: 'src/posts',
|
|
fields: [
|
|
{
|
|
type: 'string',
|
|
name: 'title',
|
|
label: 'Title',
|
|
isTitle: true,
|
|
required: true,
|
|
},
|
|
{
|
|
type: 'datetime',
|
|
name: 'date',
|
|
label: 'Date',
|
|
required: true,
|
|
},
|
|
{
|
|
type: 'boolean',
|
|
name: 'draft',
|
|
label: 'Draft',
|
|
required: true,
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'tags',
|
|
label: 'Tags',
|
|
required: false,
|
|
},
|
|
{
|
|
type: 'rich-text',
|
|
name: 'body',
|
|
label: 'Body',
|
|
isBody: true,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
})
|