87 lines
1.8 KiB
TypeScript
87 lines
1.8 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: $TINA_CID, // Get this from tina.io
|
|
token: $TINA_TOKEN, // Get this from tina.io
|
|
|
|
build: {
|
|
outputFolder: "admin",
|
|
publicFolder: "static",
|
|
},
|
|
media: {
|
|
tina: {
|
|
mediaRoot: "",
|
|
publicFolder: "static",
|
|
},
|
|
},
|
|
schema: {
|
|
collections: [
|
|
{
|
|
name: "post",
|
|
label: "Posts",
|
|
path: "content/posts",
|
|
fields: [
|
|
{
|
|
type: "string",
|
|
name: "title",
|
|
label: "Title",
|
|
isTitle: true,
|
|
required: true,
|
|
},
|
|
{
|
|
type: "rich-text",
|
|
name: "body",
|
|
label: "Body",
|
|
isBody: true,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "products",
|
|
label: "Products",
|
|
path: "content/products",
|
|
fields: [
|
|
{
|
|
type: "string",
|
|
name: "title",
|
|
label: "Product Name",
|
|
isTitle: true,
|
|
required: true,
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "code",
|
|
label: "Code",
|
|
required: true,
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "image",
|
|
label: "Image URL",
|
|
required: false,
|
|
},
|
|
{
|
|
type: "rich-text",
|
|
name: "description",
|
|
label: "Description",
|
|
isBody: true,
|
|
},
|
|
]
|
|
},
|
|
],
|
|
},
|
|
|
|
search: {
|
|
tina: {
|
|
indexerToken: '3ad8991708087bb81af5aa2bd79586afd6d847fb',
|
|
stopwordLanguages: ['eng']
|
|
},
|
|
indexBatchSize: 100,
|
|
maxSearchIndexFieldLength: 100
|
|
},
|
|
});
|