Initial
This commit is contained in:
33
src/collections/Media.ts
Normal file
33
src/collections/Media.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { CollectionConfig } from 'payload/types';
|
||||
|
||||
const Media: CollectionConfig = {
|
||||
slug: 'media',
|
||||
access: {
|
||||
read: (): boolean => true
|
||||
},
|
||||
upload: {
|
||||
adminThumbnail: 'card',
|
||||
imageSizes: [
|
||||
{
|
||||
name: 'card',
|
||||
width: 640,
|
||||
height: 480
|
||||
},
|
||||
{
|
||||
name: 'feature',
|
||||
width: 1024,
|
||||
height: 576
|
||||
}
|
||||
]
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'alt',
|
||||
label: 'Alt Text',
|
||||
type: 'text',
|
||||
required: true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default Media;
|
||||
27
src/collections/Pages.ts
Normal file
27
src/collections/Pages.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { CollectionConfig } from 'payload/types';
|
||||
import slug from '../fields/Slug';
|
||||
|
||||
const Pages: CollectionConfig = {
|
||||
slug: 'pages',
|
||||
admin: {
|
||||
useAsTitle: 'title'
|
||||
},
|
||||
access: {
|
||||
read: (): boolean => true // Everyone can read Pages
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
label: 'Title',
|
||||
type: 'text'
|
||||
},
|
||||
{
|
||||
name: 'content',
|
||||
label: 'Content',
|
||||
type: 'richText'
|
||||
},
|
||||
slug
|
||||
]
|
||||
};
|
||||
|
||||
export default Pages;
|
||||
21
src/collections/Users.ts
Normal file
21
src/collections/Users.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { CollectionConfig } from 'payload/types';
|
||||
|
||||
const Users: CollectionConfig = {
|
||||
slug: 'users',
|
||||
auth: true,
|
||||
admin: {
|
||||
useAsTitle: 'email'
|
||||
},
|
||||
access: {
|
||||
read: () => true
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'name',
|
||||
type: 'text',
|
||||
required: true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default Users;
|
||||
Reference in New Issue
Block a user