Capital/tina/collection/page.ts

37 lines
686 B
TypeScript
Raw Normal View History

2024-01-20 15:19:15 +00:00
import type { Collection } from "tinacms";
const Page: Collection = {
label: "Pages",
name: "page",
path: "content/pages",
format: "mdx",
ui: {
router: ({ document }) => {
if (document._sys.filename === "about") {
return `/about`;
}
return undefined;
},
},
fields: [
{
type: "string",
label: "Title",
name: "title",
description:
"The title of the page. This is used to display the title in the CMS",
isTitle: true,
required: true,
},
{
type: "rich-text",
label: "Body",
name: "_body",
templates: [],
isBody: true,
},
],
};
export default Page;