Co-authored-by: Aaron Yarborough <3855819+AaronJY@users.noreply.github.com> Reviewed-on: #1
136 lines
2.9 KiB
JavaScript
136 lines
2.9 KiB
JavaScript
import { defineConfig } from 'tinacms'
|
|
|
|
// Your hosting provider likely exposes this as an environment variable
|
|
const branch =
|
|
process.env.GITHUB_BRANCH ||
|
|
process.env.VERCEL_GIT_COMMIT_REF ||
|
|
process.env.HEAD ||
|
|
'main'
|
|
|
|
export default defineConfig({
|
|
branch,
|
|
|
|
// Get this from tina.io
|
|
clientId: process.env.NEXT_PUBLIC_TINA_CLIENT_ID,
|
|
// Get this from tina.io
|
|
token: process.env.TINA_TOKEN,
|
|
|
|
build: {
|
|
outputFolder: 'admin',
|
|
publicFolder: 'public'
|
|
},
|
|
media: {
|
|
tina: {
|
|
mediaRoot: '',
|
|
publicFolder: 'public'
|
|
}
|
|
},
|
|
// See docs on content modeling for more info on how to setup new content models: https://tina.io/docs/schema/
|
|
schema: {
|
|
collections: [
|
|
{
|
|
name: 'books',
|
|
label: 'Library',
|
|
path: 'content/books',
|
|
match: {
|
|
include: '*'
|
|
},
|
|
format: 'md',
|
|
fields: [
|
|
{
|
|
type: 'string',
|
|
name: 'title',
|
|
label: 'Title',
|
|
isTitle: true,
|
|
required: true
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'author',
|
|
label: 'Author',
|
|
required: true
|
|
},
|
|
{
|
|
type: 'number',
|
|
name: 'stars',
|
|
label: 'Stars',
|
|
required: true
|
|
},
|
|
{
|
|
type: 'datetime',
|
|
name: 'readDate',
|
|
label: 'Read date',
|
|
required: false
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'url',
|
|
label: 'URL',
|
|
required: false
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'thumbnailUrl',
|
|
label: 'Thumbnail URL',
|
|
required: false
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'tags',
|
|
label: 'Tags',
|
|
required: true
|
|
},
|
|
{
|
|
type: 'rich-text',
|
|
name: 'body',
|
|
label: 'Body',
|
|
isBody: true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
name: 'writing',
|
|
label: 'Writing',
|
|
path: 'content/writing',
|
|
match: {
|
|
include: '*'
|
|
},
|
|
format: 'md',
|
|
fields: [
|
|
{
|
|
type: 'string',
|
|
name: 'title',
|
|
label: 'Title',
|
|
isTitle: true,
|
|
required: true
|
|
},
|
|
{
|
|
type: 'datetime',
|
|
name: 'pubdate',
|
|
label: 'Publish Date'
|
|
},
|
|
{
|
|
type: 'string',
|
|
ui: {
|
|
component: 'textarea'
|
|
},
|
|
name: 'desc',
|
|
label: 'Description'
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'tags',
|
|
label: 'Tags',
|
|
list: true
|
|
},
|
|
{
|
|
type: 'rich-text',
|
|
name: 'body',
|
|
label: 'Body',
|
|
isBody: true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
})
|