Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 2m55s
Build & Deploy / 🏗️ Build (push) Successful in 11m40s
Build & Deploy / 🚀 Deploy (push) Failing after 8s
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
43 lines
893 B
TypeScript
43 lines
893 B
TypeScript
import { CollectionConfig } from "payload";
|
|
import { lexicalEditor, BlocksFeature } from "@payloadcms/richtext-lexical";
|
|
import { payloadBlocks } from "../blocks/allBlocks";
|
|
|
|
export const Pages: CollectionConfig = {
|
|
slug: "pages",
|
|
admin: {
|
|
useAsTitle: "title",
|
|
defaultColumns: ["title", "slug", "updatedAt"],
|
|
},
|
|
access: {
|
|
read: () => true, // Publicly readable
|
|
},
|
|
fields: [
|
|
{
|
|
name: "title",
|
|
type: "text",
|
|
required: true,
|
|
},
|
|
{
|
|
name: "slug",
|
|
type: "text",
|
|
required: true,
|
|
admin: {
|
|
position: "sidebar",
|
|
},
|
|
},
|
|
{
|
|
name: "content",
|
|
type: "richText",
|
|
editor: lexicalEditor({
|
|
features: ({ defaultFeatures }) => [
|
|
...defaultFeatures,
|
|
BlocksFeature({
|
|
blocks: payloadBlocks,
|
|
}),
|
|
],
|
|
}),
|
|
required: true,
|
|
},
|
|
],
|
|
};
|