This repository has no description
Something went wrong. Try again.
993 B · 33 lines
TypeScript
at main
12345678910111213141516171819202122232425262728293031323334import type { CollectionConfig } from 'payload'import { bodyEditor } from '@/lib/lexical-editor'
export const Pages: CollectionConfig = { slug: 'pages', admin: { useAsTitle: 'title', defaultColumns: ['title', 'slug', 'updatedAt'] }, versions: { drafts: true }, access: { read: () => true, }, fields: [ { name: 'title', type: 'text', required: true }, { name: 'slug', type: 'text', required: true, unique: true, index: true }, { name: 'subtitle', type: 'text' }, { name: 'description', type: 'textarea' }, { name: 'seo', type: 'group', fields: [ { name: 'title', type: 'text' }, { name: 'description', type: 'textarea' }, { name: 'pageType', type: 'select', options: ['website', 'article'], defaultValue: 'website', }, { name: 'image', type: 'upload', relationTo: 'media' }, ], }, { name: 'body', type: 'richText', editor: bodyEditor }, ],}