🎉 Start development
This commit is contained in:
30
tina/collection/author.ts
Normal file
30
tina/collection/author.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import type { Collection } from "tinacms";
|
||||
|
||||
const Author: Collection = {
|
||||
label: "Authors",
|
||||
name: "author",
|
||||
path: "content/authors",
|
||||
format: "mdx",
|
||||
fields: [
|
||||
{
|
||||
type: "string",
|
||||
label: "Name",
|
||||
name: "name",
|
||||
isTitle: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
type: "image",
|
||||
label: "Avatar",
|
||||
name: "avatar",
|
||||
},
|
||||
{
|
||||
type: "rich-text",
|
||||
label: "Introduction",
|
||||
name: "_body",
|
||||
templates: [],
|
||||
isBody: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
export default Author;
|
51
tina/collection/event.ts
Normal file
51
tina/collection/event.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import type { Collection } from "tinacms";
|
||||
|
||||
const Event: Collection = {
|
||||
label: "Events",
|
||||
name: "event",
|
||||
path: "content/events",
|
||||
format: "mdx",
|
||||
ui: {
|
||||
router: ({ document }) => {
|
||||
return `/events/${document._sys.filename}`;
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: "string",
|
||||
label: "Title",
|
||||
name: "title",
|
||||
isTitle: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
type: "image",
|
||||
name: "heroImg",
|
||||
label: "Hero Image",
|
||||
},
|
||||
{
|
||||
type: "reference",
|
||||
label: "Author",
|
||||
name: "author",
|
||||
collections: ["author"],
|
||||
},
|
||||
{
|
||||
type: "datetime",
|
||||
label: "Published Date",
|
||||
name: "date",
|
||||
ui: {
|
||||
dateFormat: "MMMM DD YYYY",
|
||||
timeFormat: "hh:mm A",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "rich-text",
|
||||
label: "Body",
|
||||
name: "_body",
|
||||
templates: [],
|
||||
isBody: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Event;
|
36
tina/collection/page.ts
Normal file
36
tina/collection/page.ts
Normal file
@ -0,0 +1,36 @@
|
||||
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;
|
56
tina/collection/post.ts
Normal file
56
tina/collection/post.ts
Normal file
@ -0,0 +1,56 @@
|
||||
import type { Collection } from "tinacms";
|
||||
|
||||
const Post: Collection = {
|
||||
label: "Posts",
|
||||
name: "post",
|
||||
path: "content/posts",
|
||||
format: "mdx",
|
||||
ui: {
|
||||
router: ({ document }) => {
|
||||
return `/posts/${document._sys.filename}`;
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: "string",
|
||||
label: "Title",
|
||||
name: "title",
|
||||
isTitle: true,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
type: "image",
|
||||
name: "heroImg",
|
||||
label: "Hero Image",
|
||||
},
|
||||
{
|
||||
type: "rich-text",
|
||||
label: "Excerpt",
|
||||
name: "excerpt",
|
||||
},
|
||||
{
|
||||
type: "reference",
|
||||
label: "Author",
|
||||
name: "author",
|
||||
collections: ["author"],
|
||||
},
|
||||
{
|
||||
type: "datetime",
|
||||
label: "Published Date",
|
||||
name: "date",
|
||||
ui: {
|
||||
dateFormat: "MMMM DD YYYY",
|
||||
timeFormat: "hh:mm A",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "rich-text",
|
||||
label: "Body",
|
||||
name: "_body",
|
||||
templates: [],
|
||||
isBody: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Post;
|
Reference in New Issue
Block a user