This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/tina/config.ts

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,
},
],
},
],
},
})