added SEO and nav

This commit is contained in:
briannelson95
2025-10-11 14:51:35 -04:00
parent 55859cf02a
commit ea3e216f62
10 changed files with 194 additions and 27 deletions

View File

@@ -1,3 +1,4 @@
import { MetaDescriptionField, MetaImageField, MetaTitleField, OverviewField, PreviewField } from '@payloadcms/plugin-seo/fields'
import type { CollectionConfig } from 'payload'
import { slugField } from 'payload'
@@ -17,9 +18,48 @@ export const Page: CollectionConfig = {
required: true,
},
{
name: 'richText',
type: 'richText'
type: 'tabs',
tabs: [
{
label: 'Content',
fields: [
{
name: 'richText',
type: 'richText'
},
]
},
{
name: 'meta',
label: 'SEO',
fields: [
OverviewField({
titlePath: 'meta.title',
descriptionPath: 'meta.description',
imagePath: 'meta.image',
}),
MetaTitleField({
hasGenerateFn: true,
}),
MetaImageField({
relationTo: 'media',
}),
MetaDescriptionField({}),
PreviewField({
// if the `generateUrl` function is configured
hasGenerateFn: true,
// field paths to match the target field for data
titlePath: 'meta.title',
descriptionPath: 'meta.description',
}),
],
},
]
},
slugField(),
],
}