68 lines
1.7 KiB
TypeScript
68 lines
1.7 KiB
TypeScript
// storage-adapter-import-placeholder
|
|
import { postgresAdapter } from '@payloadcms/db-postgres'
|
|
import { payloadCloudPlugin } from '@payloadcms/payload-cloud'
|
|
import { FixedToolbarFeature, HorizontalRuleFeature, lexicalEditor, UploadFeature } from '@payloadcms/richtext-lexical'
|
|
import path from 'path'
|
|
import { buildConfig } from 'payload'
|
|
import { fileURLToPath } from 'url'
|
|
import sharp from 'sharp'
|
|
|
|
import { Users } from './collections/Users'
|
|
import { Media } from './collections/Media'
|
|
import { Page } from './collections/Page'
|
|
import { Projects } from './collections/Projects'
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
|
|
export default buildConfig({
|
|
admin: {
|
|
user: Users.slug,
|
|
importMap: {
|
|
baseDir: path.resolve(dirname),
|
|
},
|
|
},
|
|
collections: [Page, Projects, Users, Media],
|
|
editor: lexicalEditor({
|
|
features: ({ defaultFeatures, rootFeatures }) => [
|
|
...defaultFeatures,
|
|
FixedToolbarFeature({
|
|
applyToFocusedEditor: true
|
|
}),
|
|
HorizontalRuleFeature(),
|
|
UploadFeature({
|
|
collections: {
|
|
uploads: {
|
|
fields: [
|
|
{
|
|
name: 'caption',
|
|
type: 'text',
|
|
label: 'Caption',
|
|
},
|
|
{
|
|
name: 'alt',
|
|
type: 'text',
|
|
label: 'Alt Text',
|
|
},
|
|
]
|
|
}
|
|
}
|
|
})
|
|
]
|
|
}),
|
|
secret: process.env.PAYLOAD_SECRET || '',
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
|
},
|
|
db: postgresAdapter({
|
|
pool: {
|
|
connectionString: process.env.DATABASE_URI || '',
|
|
},
|
|
}),
|
|
sharp,
|
|
plugins: [
|
|
payloadCloudPlugin(),
|
|
// storage-adapter-placeholder
|
|
],
|
|
})
|