Files
anouma/collections/Posts.ts
T
maro 45261a0461 Initial commit: ANOUMA website with Payload CMS, WebRTC meetings, and booking system
- Next.js 16 App Router site with the ANOUMA design system
- Payload CMS (PostgreSQL) for offers, events, posts and page content
- WebRTC video-call system with custom signaling server
- SMTP email reminders and booking-request notifications
- Customer accounts, calendar-based availability, and booking workflow
2026-08-25 16:40:51 +02:00

69 lines
1.4 KiB
TypeScript

import type { CollectionConfig } from "payload";
import { isAdmin, publishedOrAdmin } from "@/access";
import { slugField } from "@/fields/slug";
export const Posts: CollectionConfig = {
slug: "posts",
labels: {
singular: "Beitrag",
plural: "Beiträge",
},
admin: {
useAsTitle: "title",
defaultColumns: ["title", "publishDate", "_status"],
group: "Inhalte",
description: "Neuigkeiten und Beiträge für die Seite „Aktuelles“.",
},
versions: {
drafts: {
autosave: { interval: 1500 },
},
},
access: {
read: publishedOrAdmin,
create: isAdmin,
update: isAdmin,
delete: isAdmin,
},
fields: [
{
name: "title",
type: "text",
label: "Titel",
required: true,
},
slugField(),
{
name: "teaser",
type: "textarea",
label: "Teaser",
required: true,
admin: {
description: "Kurzer Anrisstext für die Übersicht.",
},
},
{
name: "content",
type: "richText",
label: "Inhalt",
required: true,
},
{
name: "coverImage",
type: "upload",
relationTo: "media",
label: "Titelbild",
},
{
name: "publishDate",
type: "date",
label: "Veröffentlichungsdatum",
defaultValue: () => new Date().toISOString(),
admin: {
position: "sidebar",
date: { pickerAppearance: "dayOnly", displayFormat: "dd.MM.yyyy" },
},
},
],
};