- New collections: Locations, Reviews, BirthdayPackages - New lib: getHomeData() — single cache-wrapped data fetch for homepage - All sections now read from CMS with static fallbacks - Header dropdown auto-populates 5 locations from Locations collection - Seed API at /api/admin/seed creates all collections + uploads media - docker-compose.prod.yml: replaced nginx/certbot with Traefik labels (shumi.ai-impress.com) - Fixed image assignments: Locations 3-5 use gallery images (not news-bg) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import type { GlobalConfig } from 'payload'
|
|
import { isAdminOrEditor } from '@/access/isAdminOrEditor'
|
|
import { revalidateGlobalAfterChange } from '@/hooks/revalidatePath'
|
|
|
|
export const Header: GlobalConfig = {
|
|
slug: 'header',
|
|
access: { read: () => true, update: isAdminOrEditor },
|
|
hooks: { afterChange: [revalidateGlobalAfterChange] },
|
|
fields: [
|
|
{ name: 'logo', type: 'upload', relationTo: 'media' },
|
|
{ name: 'logoAlt', type: 'text' },
|
|
{ name: 'ctaLabel', type: 'text' },
|
|
{ name: 'ctaHref', type: 'text' },
|
|
{
|
|
name: 'navLinks',
|
|
type: 'array',
|
|
fields: [
|
|
{ name: 'label', type: 'text' },
|
|
{ name: 'href', type: 'text' },
|
|
{ name: 'openInNewTab', type: 'checkbox', defaultValue: false },
|
|
{
|
|
name: 'autoChildrenFrom',
|
|
type: 'select',
|
|
options: [
|
|
{ label: 'None', value: 'none' },
|
|
{ label: 'Locations (auto)', value: 'locations' },
|
|
],
|
|
defaultValue: 'none',
|
|
},
|
|
{
|
|
name: 'children',
|
|
type: 'array',
|
|
fields: [
|
|
{ name: 'label', type: 'text' },
|
|
{ name: 'href', type: 'text' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|