compose-theme/exampleSite/tina/config.js

145 lines
3.2 KiB
JavaScript
Raw Normal View History

2024-07-26 17:08:59 +02:00
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 || "master";
export default defineConfig({
branch,
clientId: "cf05fea4-4f23-47cf-be81-bf18b623b233", // Get this from tina.io
token: "bdce3e17adfa4a16da812d6c538a22cd61dd057b", // Get this from tina.io
build: {
outputFolder: "admin",
publicFolder: "static",
},
media: {
tina: {
mediaRoot: "images",
publicFolder: "static",
},
},
schema: {
collections: [
{
name: "docs",
label: "Docs",
path: "content/docs",
frontmatterFormat: "toml",
frontmatterDelimiters: "+++",
format: "md",
fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "number",
name: "weight",
label: "Weight"
},
{
type: "string",
name: "description",
label: "Description"
},
{
type: "rich-text",
name: "body",
label: "Body",
isBody: true,
},
],
},
{
name: "post",
label: "Posts",
path: "content/blog",
frontmatterFormat: "toml",
frontmatterDelimiters: "+++",
format: "md",
fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "string",
name: "author",
label: "Author",
},
{
type: "string",
name: "categories",
label: "Categories",
list: true
},
{
type: "string",
name: "tags",
label: "Tags",
list: true
},
{
type: "datetime",
name: "date",
label: "Date",
},
{
type: "image",
name: "image",
label: "Image",
},
{
type: "rich-text",
name: "body",
label: "Body",
isBody: true,
},
],
},
{
name: "tutorials",
label: "Tutorials",
path: "content/tutorials",
frontmatterFormat: "toml",
frontmatterDelimiters: "+++",
format: "md",
fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "number",
name: "weight",
label: "Weight",
},
{
type: "rich-text",
name: "body",
label: "Body",
isBody: true,
},
],
},
],
},
search: {
tina: {
indexerToken: "876018600e28b19feaf033cc3364f588fe8a6248",
stopwordLanguages: ["deu", "eng", "fra", "ita", "spa", "nld"]
},
indexBatchSize: 100,
maxSearchIndexFieldLength: 100
}
});