2023-05-13 17:10:37 +00:00
|
|
|
import { CollectionConfig } from "payload/types";
|
2023-05-13 14:38:56 +00:00
|
|
|
|
|
|
|
const Posts: CollectionConfig = {
|
2023-05-13 17:10:37 +00:00
|
|
|
slug: "posts",
|
2023-05-13 14:38:56 +00:00
|
|
|
admin: {
|
2023-05-15 14:52:29 +00:00
|
|
|
defaultColumns: ["title", "author", "status"],
|
2023-05-13 17:10:37 +00:00
|
|
|
useAsTitle: "title",
|
2023-05-13 14:38:56 +00:00
|
|
|
},
|
|
|
|
access: {
|
|
|
|
read: () => true,
|
|
|
|
},
|
|
|
|
fields: [
|
|
|
|
{
|
2023-05-13 17:10:37 +00:00
|
|
|
name: "title",
|
|
|
|
type: "text",
|
2023-05-13 14:38:56 +00:00
|
|
|
},
|
|
|
|
{
|
2023-05-13 17:10:37 +00:00
|
|
|
name: "publishedDate",
|
|
|
|
type: "date",
|
2023-05-13 14:38:56 +00:00
|
|
|
},
|
2023-05-15 14:52:29 +00:00
|
|
|
|
2023-05-13 14:38:56 +00:00
|
|
|
{
|
2023-05-13 17:10:37 +00:00
|
|
|
name: "content",
|
|
|
|
type: "richText",
|
2023-05-15 14:52:29 +00:00
|
|
|
admin: {
|
|
|
|
elements: ["h2", "h3", "h4", "link", "ol", "ul", "upload"],
|
|
|
|
leaves: ["bold", "italic", "underline"],
|
|
|
|
upload: {
|
|
|
|
collections: {
|
|
|
|
media: {
|
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
name: "imagel",
|
|
|
|
type: "upload",
|
|
|
|
relationTo: "media",
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-05-13 14:38:56 +00:00
|
|
|
},
|
|
|
|
{
|
2023-05-13 17:10:37 +00:00
|
|
|
name: "status",
|
|
|
|
type: "select",
|
2023-05-13 14:38:56 +00:00
|
|
|
options: [
|
|
|
|
{
|
2023-05-13 17:10:37 +00:00
|
|
|
value: "draft",
|
|
|
|
label: "Draft",
|
2023-05-13 14:38:56 +00:00
|
|
|
},
|
|
|
|
{
|
2023-05-13 17:10:37 +00:00
|
|
|
value: "published",
|
|
|
|
label: "Published",
|
2023-05-13 14:38:56 +00:00
|
|
|
},
|
|
|
|
],
|
2023-05-13 17:10:37 +00:00
|
|
|
defaultValue: "draft",
|
2023-05-13 14:38:56 +00:00
|
|
|
admin: {
|
2023-05-13 17:10:37 +00:00
|
|
|
position: "sidebar",
|
|
|
|
},
|
|
|
|
},
|
2023-05-13 14:38:56 +00:00
|
|
|
],
|
2023-05-13 17:10:37 +00:00
|
|
|
};
|
2023-05-13 14:38:56 +00:00
|
|
|
|
2023-05-13 17:10:37 +00:00
|
|
|
export default Posts;
|