172 lines
3.9 KiB
JavaScript
172 lines
3.9 KiB
JavaScript
// tina/config.ts
|
|
import { defineConfig } from "tinacms";
|
|
var branch = process.env.HEAD || process.env.VERCEL_GIT_COMMIT_REF || "main";
|
|
var config_default = defineConfig({
|
|
branch,
|
|
clientId: null,
|
|
token: null,
|
|
build: {
|
|
outputFolder: "admin",
|
|
publicFolder: "public"
|
|
},
|
|
media: {
|
|
tina: {
|
|
mediaRoot: "public/images",
|
|
publicFolder: "public"
|
|
}
|
|
},
|
|
schema: {
|
|
collections: [
|
|
{
|
|
name: "news",
|
|
label: "News",
|
|
path: "src/content/news",
|
|
format: "md",
|
|
match: {
|
|
include: "**/*"
|
|
},
|
|
ui: {
|
|
filename: {
|
|
readonly: false,
|
|
slugify: (values) => {
|
|
return values?.slug?.toLowerCase() || values?.title?.toLowerCase().replace(/ /g, "-");
|
|
}
|
|
}
|
|
},
|
|
fields: [
|
|
{
|
|
type: "string",
|
|
name: "locale",
|
|
label: "Language",
|
|
options: [
|
|
{ label: "Espa\xF1ol", value: "es" },
|
|
{ label: "English", value: "en" },
|
|
{ label: "Portugu\xEAs", value: "pt" },
|
|
{ label: "Kinyarwanda", value: "rw" },
|
|
{ label: "Frances", value: "fr" }
|
|
]
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "title",
|
|
label: "Title",
|
|
isTitle: true,
|
|
required: true
|
|
},
|
|
{
|
|
type: "datetime",
|
|
name: "date",
|
|
label: "Date",
|
|
required: true
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "slug",
|
|
label: "Slug"
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "place",
|
|
label: "Place"
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "country",
|
|
label: "Country"
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "city",
|
|
label: "City"
|
|
},
|
|
{
|
|
type: "image",
|
|
name: "thumbnail",
|
|
label: "Thumbnail URL"
|
|
},
|
|
{
|
|
type: "image",
|
|
name: "thumbnail_square",
|
|
label: "Thumbnail Square URL"
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "tags",
|
|
label: "Tags",
|
|
list: true
|
|
},
|
|
{
|
|
type: "object",
|
|
name: "gallery",
|
|
label: "Gallery",
|
|
list: true,
|
|
fields: [
|
|
{
|
|
type: "image",
|
|
name: "image",
|
|
label: "Image"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "youtube",
|
|
label: "YouTube ID"
|
|
},
|
|
{
|
|
type: "boolean",
|
|
name: "draft",
|
|
label: "Draft"
|
|
},
|
|
{
|
|
type: "rich-text",
|
|
name: "body",
|
|
label: "Content",
|
|
isBody: true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
name: "documentaries",
|
|
label: "Documentaries",
|
|
path: "src/content/documentaries",
|
|
format: "md",
|
|
fields: [
|
|
{
|
|
type: "string",
|
|
name: "locale",
|
|
label: "Language",
|
|
options: [
|
|
{ label: "Espa\xF1ol", value: "es" },
|
|
{ label: "English", value: "en" },
|
|
{ label: "Portugu\xEAs", value: "pt" },
|
|
{ label: "Kinyarwanda", value: "rw" }
|
|
]
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "title",
|
|
label: "Title",
|
|
isTitle: true,
|
|
required: true
|
|
},
|
|
{
|
|
type: "string",
|
|
name: "video_yt",
|
|
label: "YouTube ID"
|
|
},
|
|
{
|
|
type: "datetime",
|
|
name: "date",
|
|
label: "Date",
|
|
required: true
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
});
|
|
export {
|
|
config_default as default
|
|
};
|