65 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-02-07 10:50:40 +07:00
import { BeforeFooterBlock } from "@/blocks/BeforeFooter";
import { ContentBlock } from "@/blocks/Content";
2025-02-07 20:29:41 +07:00
import { HorizontalImageContentBlock } from "@/blocks/HorizontalImageContent";
import { OurTeamBlock } from "@/blocks/OurTeam";
2025-02-07 10:50:40 +07:00
import formatSlug from "@/utils/formatSlug";
import { CollectionConfig } from "payload";
export const Pages: CollectionConfig = {
slug: "pages",
fields: [
{
name: "title",
label: "Page Title",
type: "text",
required: true,
},
{
name: "hero_img",
label: "Hero Image",
type: "upload",
relationTo: "media",
},
{
name: "slug",
label: "Page Slug",
type: "text",
admin: {
position: "sidebar",
},
hooks: {
beforeValidate: [formatSlug("title")],
},
},
{
name: "layout",
label: "Page Layout",
type: "blocks",
minRows: 1,
2025-02-07 20:29:41 +07:00
blocks: [ContentBlock, BeforeFooterBlock, OurTeamBlock, HorizontalImageContentBlock],
2025-02-07 10:50:40 +07:00
},
{
name: "meta",
label: "Page Meta",
type: "group",
fields: [
{
name: "title",
label: "Title",
type: "text",
},
{
name: "description",
label: "Description",
type: "textarea",
},
{
name: "keywords",
label: "Keywords",
type: "text",
},
],
},
],
};