church-website/src/globals/SiteConfig.ts
2026-03-09 11:49:13 +01:00

103 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { GlobalConfig } from 'payload'
import { isAdmin } from '@/collections/access/admin'
import { revalidateTag } from 'next/cache'
export const SiteConfigGlobal: GlobalConfig = {
slug: 'site-config',
label: {
de: 'Website-Einstellungen',
},
admin: {
description:
'Hier können Sie den Namen, die Beschreibung und andere allgemeine Einstellungen der Website konfigurieren.',
hidden: args => args.user?.roles === "user"
},
fields: [
{
name: 'name',
type: 'text',
label: { de: 'Name der Pfarrei' },
required: true,
defaultValue:
'Katholische Pfarrei Heilige Drei Könige Berlin',
},
{
name: 'shortName',
type: 'text',
label: { de: 'Kurzname' },
required: true,
defaultValue: 'Hl. Drei Könige',
admin: {
description:
'Wird im Browser-Tab als Suffix verwendet (z.B. "Seite | Hl. Drei Könige").',
},
},
{
name: 'description',
type: 'textarea',
label: { de: 'Beschreibung' },
required: true,
defaultValue:
'Katholische Pfarrei Heilige Drei Könige in Berlin Gottesdienste, Veranstaltungen, Sakramente und Gemeindeleben.',
admin: {
description: 'Meta-Beschreibung für Suchmaschinen.',
},
},
{
name: 'url',
type: 'text',
label: { de: 'Website-URL' },
required: true,
defaultValue: 'https://dreikoenige.berlin',
},
{
name: 'ogImage',
type: 'text',
label: { de: 'Open Graph Bild' },
defaultValue: '/og-logo.svg',
admin: {
description:
'Pfad zum Vorschaubild für soziale Medien.',
},
},
{
name: 'email',
type: 'email',
label: { de: 'Kontakt-E-Mail' },
required: true,
defaultValue: 'kontakt@dreikoenige.berlin',
admin: {
description:
'Standard-E-Mail-Adresse für Kontaktformulare.',
},
},
{
name: 'keywords',
type: 'array',
label: { de: 'Schlüsselwörter' },
labels: {
singular: { de: 'Schlüsselwort' },
plural: { de: 'Schlüsselwörter' },
},
admin: {
description:
'SEO-Schlüsselwörter für Suchmaschinen.',
},
fields: [
{
name: 'keyword',
type: 'text',
required: true,
label: { de: 'Schlüsselwort' },
},
],
},
],
access: {
read: () => true,
update: isAdmin(),
},
hooks: {
afterChange: [() => revalidateTag('site-config')],
},
}