37 lines
686 B
TypeScript
37 lines
686 B
TypeScript
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;
|