diff --git a/.env.example b/.env.example index 8eac48f..6fb382e 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,5 @@ # Database connection string -DATABASE_URI=mongodb://127.0.0.1/your-database-name - -# Or use a PG connection string -#DATABASE_URI=postgresql://127.0.0.1:5432/your-database-name +DATABASE_URI=postgres://ogb:ogb_dev_password@localhost:5432/ogb_web # Used to encrypt JWT tokens PAYLOAD_SECRET=YOUR_SECRET_HERE diff --git a/docker-compose.yml b/docker-compose.yml index 4c9fc51..af3a66d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,31 +1,15 @@ -version: '3' - services: - payload: - image: node:18-alpine + postgres: + image: postgres:17-alpine + environment: + POSTGRES_USER: ogb + POSTGRES_PASSWORD: ogb_dev_password + POSTGRES_DB: ogb_web ports: - - '3000:3000' + - '5432:5432' volumes: - - .:/home/node/app - - node_modules:/home/node/app/node_modules - working_dir: /home/node/app/ - command: sh -c "yarn install && yarn dev" - depends_on: - - mongo - env_file: - - .env - - mongo: - image: mongo:latest - ports: - - '27017:27017' - command: - - --storageEngine=wiredTiger - volumes: - - data:/data/db - logging: - driver: none + - postgres_data:/var/lib/postgresql/data + restart: unless-stopped volumes: - data: - node_modules: + postgres_data: diff --git a/src/plugins/index.ts b/src/plugins/index.ts index f210a28..63e3835 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -10,14 +10,15 @@ import { FixedToolbarFeature, HeadingFeature, lexicalEditor } from '@payloadcms/ import { searchFields } from '@/search/fieldOverrides' import { beforeSyncWithSearch } from '@/search/beforeSync' -import { Page, Post } from '@/payload-types' +import { Page, Post, Project } from '@/payload-types' import { getServerSideURL } from '@/utilities/getURL' -const generateTitle: GenerateTitle = ({ doc }) => { - return doc?.title ? `${doc.title} | Payload Website Template` : 'Payload Website Template' +const generateTitle: GenerateTitle = ({ doc }) => { + const title = doc?.title || (doc as Project)?.name + return title ? `${title} | OGB Solutions` : 'OGB Solutions' } -const generateURL: GenerateURL = ({ doc }) => { +const generateURL: GenerateURL = ({ doc }) => { const url = getServerSideURL() return doc?.slug ? `${url}/${doc.slug}` : url