feat: integrate tinacms

This commit is contained in:
Cory Dransfeldt 2023-04-18 13:15:00 -07:00
parent 659755e9c5
commit 62b2518590
No known key found for this signature in database
12 changed files with 8602 additions and 89 deletions

63
tina/config.ts Normal file
View file

@ -0,0 +1,63 @@
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,
},
],
},
],
},
})