Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
Max Schmidt
2023-05-15 16:52:29 +02:00
parent a4b119614d
commit 7a57a69259
22 changed files with 1418 additions and 8897 deletions

@ -3,7 +3,7 @@ import { CollectionConfig } from "payload/types";
const Posts: CollectionConfig = {
slug: "posts",
admin: {
defaultColumns: ["title", "author", "category", "tags", "status"],
defaultColumns: ["title", "author", "status"],
useAsTitle: "title",
},
access: {
@ -14,29 +14,32 @@ const Posts: CollectionConfig = {
name: "title",
type: "text",
},
{
name: "author",
type: "relationship",
relationTo: "users",
},
{
name: "publishedDate",
type: "date",
},
{
name: "category",
type: "relationship",
relationTo: "categories",
},
{
name: "tags",
type: "relationship",
relationTo: "tags",
hasMany: true,
},
{
name: "content",
type: "richText",
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,
},
],
},
},
},
},
},
{
name: "status",