diff --git a/src/collections/Categories.ts b/src/collections/Categories.ts new file mode 100644 index 0000000..ec2d4ec --- /dev/null +++ b/src/collections/Categories.ts @@ -0,0 +1,20 @@ +import type { CollectionConfig } from 'payload'; + +import { slugField } from 'payload'; + +export const Categories: CollectionConfig = { + slug: 'categories', + admin: { + useAsTitle: 'title', + }, + fields: [ + { + name: 'title', + type: 'text', + required: true, + }, + slugField({ + position: undefined + }) + ] +} \ No newline at end of file diff --git a/src/collections/Projects.ts b/src/collections/Projects.ts index d89258e..2528a8a 100644 --- a/src/collections/Projects.ts +++ b/src/collections/Projects.ts @@ -1,5 +1,6 @@ import type { CollectionConfig } from 'payload' import { slugField } from 'payload' +import { fa } from 'payload/i18n/fa' export const Projects: CollectionConfig = { slug: 'projects', @@ -44,9 +45,32 @@ export const Projects: CollectionConfig = { type: 'text' } ] + }, + { + label: 'Settings', + fields: [ + + ] } ] }, slugField(), + { + name: 'featuredProject', + type: 'checkbox', + label: 'Make this a Featured Project', + defaultValue: false, + admin: { + position: 'sidebar' + } + }, + { + name: 'order', + type: 'number', + defaultValue: 0, + admin: { + position: 'sidebar' + } + }, ], } \ No newline at end of file diff --git a/src/payload-types.ts b/src/payload-types.ts index 0469f18..d4e4472 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -177,6 +177,8 @@ export interface Project { */ generateSlug?: boolean | null; slug: string; + featuredProject?: boolean | null; + order?: number | null; updatedAt: string; createdAt: string; } @@ -314,6 +316,8 @@ export interface ProjectsSelect { github?: T; generateSlug?: T; slug?: T; + featuredProject?: T; + order?: T; updatedAt?: T; createdAt?: T; }