43 lines
894 B
TypeScript
43 lines
894 B
TypeScript
import type { CollectionConfig } from '../../../packages/payload/src/collections/config/types'
|
|
|
|
import { pagesSlug } from '../shared'
|
|
|
|
export const Pages: CollectionConfig = {
|
|
slug: pagesSlug,
|
|
labels: {
|
|
singular: 'Page',
|
|
plural: 'Pages',
|
|
},
|
|
admin: {
|
|
useAsTitle: 'title',
|
|
},
|
|
versions: {
|
|
drafts: true,
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'title',
|
|
label: 'Title',
|
|
type: 'text',
|
|
required: true,
|
|
},
|
|
{
|
|
name: 'excerpt',
|
|
label: 'Excerpt',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'slug',
|
|
type: 'text',
|
|
required: true,
|
|
// NOTE: in order for position: 'sidebar' to work here,
|
|
// the first field of this config must be of type `tabs`,
|
|
// and this field must be a sibling of it
|
|
// See `./Posts` or the `../../README.md` for more info
|
|
admin: {
|
|
position: 'sidebar',
|
|
},
|
|
},
|
|
],
|
|
}
|