organise media
This commit is contained in:
parent
239b67719a
commit
b1c2720d85
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
@ -34,6 +34,9 @@
|
|||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
"@swc/core",
|
||||||
|
"core-js",
|
||||||
|
"es5-ext",
|
||||||
"sharp"
|
"sharp"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,7 @@ export interface Config {
|
|||||||
collections: {
|
collections: {
|
||||||
projects: Project;
|
projects: Project;
|
||||||
news: News;
|
news: News;
|
||||||
media: Media;
|
images: Image;
|
||||||
documents: Document;
|
documents: Document;
|
||||||
data: Datum;
|
data: Datum;
|
||||||
users: User;
|
users: User;
|
||||||
@ -81,7 +81,7 @@ export interface Config {
|
|||||||
collectionsSelect: {
|
collectionsSelect: {
|
||||||
projects: ProjectsSelect<false> | ProjectsSelect<true>;
|
projects: ProjectsSelect<false> | ProjectsSelect<true>;
|
||||||
news: NewsSelect<false> | NewsSelect<true>;
|
news: NewsSelect<false> | NewsSelect<true>;
|
||||||
media: MediaSelect<false> | MediaSelect<true>;
|
images: ImagesSelect<false> | ImagesSelect<true>;
|
||||||
documents: DocumentsSelect<false> | DocumentsSelect<true>;
|
documents: DocumentsSelect<false> | DocumentsSelect<true>;
|
||||||
data: DataSelect<false> | DataSelect<true>;
|
data: DataSelect<false> | DataSelect<true>;
|
||||||
users: UsersSelect<false> | UsersSelect<true>;
|
users: UsersSelect<false> | UsersSelect<true>;
|
||||||
@ -201,9 +201,9 @@ export interface News {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "media".
|
* via the `definition` "images".
|
||||||
*/
|
*/
|
||||||
export interface Media {
|
export interface Image {
|
||||||
id: number;
|
id: number;
|
||||||
alt?: string | null;
|
alt?: string | null;
|
||||||
description?: string | null;
|
description?: string | null;
|
||||||
@ -319,8 +319,8 @@ export interface PayloadLockedDocument {
|
|||||||
value: number | News;
|
value: number | News;
|
||||||
} | null)
|
} | null)
|
||||||
| ({
|
| ({
|
||||||
relationTo: 'media';
|
relationTo: 'images';
|
||||||
value: number | Media;
|
value: number | Image;
|
||||||
} | null)
|
} | null)
|
||||||
| ({
|
| ({
|
||||||
relationTo: 'documents';
|
relationTo: 'documents';
|
||||||
@ -410,9 +410,9 @@ export interface NewsSelect<T extends boolean = true> {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "media_select".
|
* via the `definition` "images_select".
|
||||||
*/
|
*/
|
||||||
export interface MediaSelect<T extends boolean = true> {
|
export interface ImagesSelect<T extends boolean = true> {
|
||||||
alt?: T;
|
alt?: T;
|
||||||
description?: T;
|
description?: T;
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
|
|||||||
@ -7,7 +7,9 @@ import { Home } from '@/globals/Home'
|
|||||||
|
|
||||||
import { News } from './src/collections/News'
|
import { News } from './src/collections/News'
|
||||||
import { Projects } from '@/collections/Projects'
|
import { Projects } from '@/collections/Projects'
|
||||||
import { Data, Documents, Media } from '@/collections/Files'
|
import { Images } from '@/collections/media/Images'
|
||||||
|
import { Documents } from '@/collections/media/Documents'
|
||||||
|
import { Data } from '@/collections/media/Data'
|
||||||
|
|
||||||
export default buildConfig({
|
export default buildConfig({
|
||||||
// If you'd like to use Rich Text, pass your editor here
|
// If you'd like to use Rich Text, pass your editor here
|
||||||
@ -23,7 +25,7 @@ export default buildConfig({
|
|||||||
globals: [Home],
|
globals: [Home],
|
||||||
|
|
||||||
// Define and configure your collections in this array
|
// Define and configure your collections in this array
|
||||||
collections: [Projects, News, Media, Documents, Data],
|
collections: [Projects, News, Images, Documents, Data],
|
||||||
|
|
||||||
// Your Payload secret - should be a complex and secure string, unguessable
|
// Your Payload secret - should be a complex and secure string, unguessable
|
||||||
secret: process.env.PAYLOAD_SECRET || '',
|
secret: process.env.PAYLOAD_SECRET || '',
|
||||||
|
|||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@ -13,10 +13,10 @@ importers:
|
|||||||
version: 3.31.0(@types/react@19.0.12)(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react@19.0.0)
|
version: 3.31.0(@types/react@19.0.12)(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react@19.0.0)
|
||||||
'@payloadcms/next':
|
'@payloadcms/next':
|
||||||
specifier: ^3.31.0
|
specifier: ^3.31.0
|
||||||
version: 3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
version: 3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
||||||
'@payloadcms/richtext-lexical':
|
'@payloadcms/richtext-lexical':
|
||||||
specifier: ^3.31.0
|
specifier: ^3.31.0
|
||||||
version: 3.31.0(@faceless-ui/modal@3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@faceless-ui/scroll-info@2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@payloadcms/next@3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2))(@types/react@19.0.12)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)(yjs@13.6.24)
|
version: 3.31.0(@faceless-ui/modal@3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@faceless-ui/scroll-info@2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@payloadcms/next@3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2))(@types/react@19.0.12)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)(yjs@13.6.24)
|
||||||
cross-env:
|
cross-env:
|
||||||
specifier: ^7.0.3
|
specifier: ^7.0.3
|
||||||
version: 7.0.3
|
version: 7.0.3
|
||||||
@ -1834,8 +1834,8 @@ packages:
|
|||||||
minimist@1.2.8:
|
minimist@1.2.8:
|
||||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||||
|
|
||||||
monaco-editor@0.52.2:
|
monaco-editor@0.38.0:
|
||||||
resolution: {integrity: sha512-GEQWEZmfkOGLdd3XK8ryrfWz3AIP8YymVXiPHEdewrUq7mh0qrKrfHLNCXcbB6sTnMLnOZ3ztSiKcciFUkIJwQ==}
|
resolution: {integrity: sha512-11Fkh6yzEmwx7O0YoLxeae0qEGFwmyPRlVxpg7oF9czOOCB/iCjdJrG5I67da5WiXK3YJCxoz9TJFE8Tfq/v9A==}
|
||||||
|
|
||||||
ms@2.1.3:
|
ms@2.1.3:
|
||||||
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
|
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
|
||||||
@ -3102,10 +3102,10 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
state-local: 1.0.7
|
state-local: 1.0.7
|
||||||
|
|
||||||
'@monaco-editor/react@4.7.0(monaco-editor@0.52.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)':
|
'@monaco-editor/react@4.7.0(monaco-editor@0.38.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@monaco-editor/loader': 1.5.0
|
'@monaco-editor/loader': 1.5.0
|
||||||
monaco-editor: 0.52.2
|
monaco-editor: 0.38.0
|
||||||
react: 19.0.0
|
react: 19.0.0
|
||||||
react-dom: 19.0.0(react@19.0.0)
|
react-dom: 19.0.0(react@19.0.0)
|
||||||
|
|
||||||
@ -3228,12 +3228,12 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@payloadcms/next@3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)':
|
'@payloadcms/next@3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@dnd-kit/core': 6.0.8(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@dnd-kit/core': 6.0.8(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
'@payloadcms/graphql': 3.31.0(graphql@16.10.0)(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(typescript@5.8.2)
|
'@payloadcms/graphql': 3.31.0(graphql@16.10.0)(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(typescript@5.8.2)
|
||||||
'@payloadcms/translations': 3.31.0
|
'@payloadcms/translations': 3.31.0
|
||||||
'@payloadcms/ui': 3.31.0(@types/react@19.0.12)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
'@payloadcms/ui': 3.31.0(@types/react@19.0.12)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
||||||
busboy: 1.6.0
|
busboy: 1.6.0
|
||||||
dequal: 2.0.3
|
dequal: 2.0.3
|
||||||
file-type: 19.3.0
|
file-type: 19.3.0
|
||||||
@ -3256,7 +3256,7 @@ snapshots:
|
|||||||
- supports-color
|
- supports-color
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@payloadcms/richtext-lexical@3.31.0(@faceless-ui/modal@3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@faceless-ui/scroll-info@2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@payloadcms/next@3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2))(@types/react@19.0.12)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)(yjs@13.6.24)':
|
'@payloadcms/richtext-lexical@3.31.0(@faceless-ui/modal@3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@faceless-ui/scroll-info@2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(@payloadcms/next@3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2))(@types/react@19.0.12)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)(yjs@13.6.24)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@faceless-ui/modal': 3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@faceless-ui/modal': 3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
'@faceless-ui/scroll-info': 2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@faceless-ui/scroll-info': 2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
@ -3270,9 +3270,9 @@ snapshots:
|
|||||||
'@lexical/selection': 0.28.0
|
'@lexical/selection': 0.28.0
|
||||||
'@lexical/table': 0.28.0
|
'@lexical/table': 0.28.0
|
||||||
'@lexical/utils': 0.28.0
|
'@lexical/utils': 0.28.0
|
||||||
'@payloadcms/next': 3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
'@payloadcms/next': 3.31.0(@types/react@19.0.12)(graphql@16.10.0)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
||||||
'@payloadcms/translations': 3.31.0
|
'@payloadcms/translations': 3.31.0
|
||||||
'@payloadcms/ui': 3.31.0(@types/react@19.0.12)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
'@payloadcms/ui': 3.31.0(@types/react@19.0.12)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)
|
||||||
'@types/uuid': 10.0.0
|
'@types/uuid': 10.0.0
|
||||||
acorn: 8.12.1
|
acorn: 8.12.1
|
||||||
bson-objectid: 2.0.4
|
bson-objectid: 2.0.4
|
||||||
@ -3302,7 +3302,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
date-fns: 4.1.0
|
date-fns: 4.1.0
|
||||||
|
|
||||||
'@payloadcms/ui@3.31.0(@types/react@19.0.12)(monaco-editor@0.52.2)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)':
|
'@payloadcms/ui@3.31.0(@types/react@19.0.12)(monaco-editor@0.38.0)(next@15.2.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.77.4))(payload@3.31.0(graphql@16.10.0)(typescript@5.8.2))(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(typescript@5.8.2)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@date-fns/tz': 1.2.0
|
'@date-fns/tz': 1.2.0
|
||||||
'@dnd-kit/core': 6.0.8(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@dnd-kit/core': 6.0.8(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
@ -3310,7 +3310,7 @@ snapshots:
|
|||||||
'@faceless-ui/modal': 3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@faceless-ui/modal': 3.0.0-beta.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
'@faceless-ui/scroll-info': 2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@faceless-ui/scroll-info': 2.0.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
'@faceless-ui/window-info': 3.0.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@faceless-ui/window-info': 3.0.1(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
'@monaco-editor/react': 4.7.0(monaco-editor@0.52.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
'@monaco-editor/react': 4.7.0(monaco-editor@0.38.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
|
||||||
'@payloadcms/translations': 3.31.0
|
'@payloadcms/translations': 3.31.0
|
||||||
bson-objectid: 2.0.4
|
bson-objectid: 2.0.4
|
||||||
date-fns: 4.1.0
|
date-fns: 4.1.0
|
||||||
@ -4227,7 +4227,7 @@ snapshots:
|
|||||||
|
|
||||||
minimist@1.2.8: {}
|
minimist@1.2.8: {}
|
||||||
|
|
||||||
monaco-editor@0.52.2: {}
|
monaco-editor@0.38.0: {}
|
||||||
|
|
||||||
ms@2.1.3: {}
|
ms@2.1.3: {}
|
||||||
|
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
import type { CollectionConfig } from "payload";
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
import type { CollectionConfig } from "payload";
|
|
||||||
|
|
||||||
export const Media: CollectionConfig = {
|
|
||||||
slug: 'media',
|
|
||||||
upload: {
|
|
||||||
staticDir: 'media',
|
|
||||||
imageSizes: [
|
|
||||||
{
|
|
||||||
name: 'thumbnail',
|
|
||||||
width: 400,
|
|
||||||
height: 300,
|
|
||||||
position: 'centre',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'card',
|
|
||||||
width: 768,
|
|
||||||
height: 1024,
|
|
||||||
position: 'centre',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'tablet',
|
|
||||||
width: 1024,
|
|
||||||
height: undefined,
|
|
||||||
position: 'centre',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
adminThumbnail: 'thumbnail',
|
|
||||||
mimeTypes: ['image/*'],
|
|
||||||
},
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
name: 'alt',
|
|
||||||
label: 'Alt Text',
|
|
||||||
type: 'text',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'description',
|
|
||||||
label: 'Description',
|
|
||||||
type: 'textarea',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Documents: CollectionConfig = {
|
|
||||||
slug: 'documents',
|
|
||||||
upload: {
|
|
||||||
staticDir: 'documents',
|
|
||||||
mimeTypes: ['application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],
|
|
||||||
},
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
name: 'title',
|
|
||||||
label: 'Title',
|
|
||||||
type: 'text',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'description',
|
|
||||||
label: 'Description',
|
|
||||||
type: 'textarea',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Data: CollectionConfig = {
|
|
||||||
slug: 'data',
|
|
||||||
upload: {
|
|
||||||
staticDir: 'data',
|
|
||||||
mimeTypes: ['application/json', 'text/csv', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/plain'],
|
|
||||||
},
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
name: 'title',
|
|
||||||
label: 'Title',
|
|
||||||
type: 'text',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'description',
|
|
||||||
label: 'Description',
|
|
||||||
type: 'textarea',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'source',
|
|
||||||
label: 'Source',
|
|
||||||
type: 'text',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
31
src/collections/media/Data.ts
Normal file
31
src/collections/media/Data.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
|
||||||
|
export const Data: CollectionConfig = {
|
||||||
|
slug: 'data',
|
||||||
|
upload: {
|
||||||
|
staticDir: 'data',
|
||||||
|
mimeTypes: ['application/json', 'text/csv', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/plain'],
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'title',
|
||||||
|
label: 'Title',
|
||||||
|
type: 'text',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: 'Description',
|
||||||
|
type: 'textarea',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'source',
|
||||||
|
label: 'Source',
|
||||||
|
type: 'text',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
admin: {
|
||||||
|
group: 'Media',
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/collections/media/Documents.ts
Normal file
25
src/collections/media/Documents.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
|
||||||
|
export const Documents: CollectionConfig = {
|
||||||
|
slug: 'documents',
|
||||||
|
upload: {
|
||||||
|
staticDir: 'media/documents',
|
||||||
|
mimeTypes: ['application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'title',
|
||||||
|
label: 'Title',
|
||||||
|
type: 'text',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: 'Description',
|
||||||
|
type: 'textarea',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
admin: {
|
||||||
|
group: 'Media',
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/collections/media/Images.ts
Normal file
45
src/collections/media/Images.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
|
||||||
|
export const Images: CollectionConfig = {
|
||||||
|
slug: 'images',
|
||||||
|
upload: {
|
||||||
|
staticDir: 'media/images',
|
||||||
|
imageSizes: [
|
||||||
|
{
|
||||||
|
name: 'thumbnail',
|
||||||
|
width: 400,
|
||||||
|
height: 300,
|
||||||
|
position: 'centre',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'card',
|
||||||
|
width: 768,
|
||||||
|
height: 1024,
|
||||||
|
position: 'centre',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'tablet',
|
||||||
|
width: 1024,
|
||||||
|
height: undefined,
|
||||||
|
position: 'centre',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
adminThumbnail: 'thumbnail',
|
||||||
|
mimeTypes: ['image/*'],
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'alt',
|
||||||
|
label: 'Alt Text',
|
||||||
|
type: 'text',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: 'Description',
|
||||||
|
type: 'textarea',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
admin: {
|
||||||
|
group: 'Media',
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user