added settings
This commit is contained in:
@@ -8,7 +8,7 @@ export const Projects: CollectionConfig = {
|
|||||||
slug: true,
|
slug: true,
|
||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
defaultColumns: ['title', 'slug', 'updatedAt',],
|
defaultColumns: ['title', 'slug', 'updatedAt', 'order'],
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
@@ -41,6 +41,7 @@ export const Projects: CollectionConfig = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'github',
|
name: 'github',
|
||||||
|
label: 'Git Repo',
|
||||||
type: 'text'
|
type: 'text'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,8 +1,22 @@
|
|||||||
import type { CollectionConfig } from 'payload';
|
import type { GlobalConfig } from 'payload';
|
||||||
|
|
||||||
export const Settings: CollectionConfig = {
|
export const Settings: GlobalConfig = {
|
||||||
slug: 'settings',
|
slug: 'settings',
|
||||||
fields: [
|
fields: [
|
||||||
|
{
|
||||||
|
type: 'tabs',
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
label: 'Contact',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'email',
|
||||||
|
label: 'Contact Email',
|
||||||
|
type: 'email'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -92,9 +92,11 @@ export interface Config {
|
|||||||
};
|
};
|
||||||
globals: {
|
globals: {
|
||||||
nav: Nav;
|
nav: Nav;
|
||||||
|
settings: Setting;
|
||||||
};
|
};
|
||||||
globalsSelect: {
|
globalsSelect: {
|
||||||
nav: NavSelect<false> | NavSelect<true>;
|
nav: NavSelect<false> | NavSelect<true>;
|
||||||
|
settings: SettingsSelect<false> | SettingsSelect<true>;
|
||||||
};
|
};
|
||||||
locale: null;
|
locale: null;
|
||||||
user: User & {
|
user: User & {
|
||||||
@@ -461,6 +463,16 @@ export interface Nav {
|
|||||||
updatedAt?: string | null;
|
updatedAt?: string | null;
|
||||||
createdAt?: string | null;
|
createdAt?: string | null;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "settings".
|
||||||
|
*/
|
||||||
|
export interface Setting {
|
||||||
|
id: number;
|
||||||
|
email?: string | null;
|
||||||
|
updatedAt?: string | null;
|
||||||
|
createdAt?: string | null;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "nav_select".
|
* via the `definition` "nav_select".
|
||||||
@@ -476,6 +488,16 @@ export interface NavSelect<T extends boolean = true> {
|
|||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
globalType?: T;
|
globalType?: T;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "settings_select".
|
||||||
|
*/
|
||||||
|
export interface SettingsSelect<T extends boolean = true> {
|
||||||
|
email?: T;
|
||||||
|
updatedAt?: T;
|
||||||
|
createdAt?: T;
|
||||||
|
globalType?: T;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "auth".
|
* via the `definition` "auth".
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ import { Page } from './collections/Page'
|
|||||||
import { Projects } from './collections/Projects'
|
import { Projects } from './collections/Projects'
|
||||||
import { Categories } from './collections/Categories'
|
import { Categories } from './collections/Categories'
|
||||||
import { Nav } from './collections/Nav'
|
import { Nav } from './collections/Nav'
|
||||||
import { seoPlugin } from '@payloadcms/plugin-seo'
|
|
||||||
import { GenerateTitle, GenerateURL } from '@payloadcms/plugin-seo/types'
|
|
||||||
import { plugins } from './plugins'
|
import { plugins } from './plugins'
|
||||||
|
import { Settings } from './collections/Settings'
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
@@ -36,6 +35,7 @@ export default buildConfig({
|
|||||||
],
|
],
|
||||||
globals: [
|
globals: [
|
||||||
Nav,
|
Nav,
|
||||||
|
Settings,
|
||||||
],
|
],
|
||||||
editor: lexicalEditor({
|
editor: lexicalEditor({
|
||||||
features: ({ defaultFeatures, rootFeatures }) => [
|
features: ({ defaultFeatures, rootFeatures }) => [
|
||||||
|
|||||||
Reference in New Issue
Block a user