Overview
Payload CMS
Build from Payload CMS
Overview
When SITE_SLUG (or SITE_ID) is set, [slug].paths.ts fetches pages and settings from the Payload API instead of loading a local site.
Setup
SITE_SLUG=your-site
PAYLOAD_API_URL=http://localhost:3000/api
PAYLOAD_API_KEY=optional
payload-api.ts calls getPages(). site-settings-api.ts calls getSiteSettings(). Payload must be running and the site must exist.
Block processing
processBlocks() in generate-content.ts runs on each page's blocks:
- Lexical → HTML — richText, accordion items, tabs, imageText content
- URL conversion — Payload image URLs → R2 public URLs (using
R2_PUBLIC_URL)
Applied to: image, hero, testimonials, ctaCards, ctaSection, iconCardsGrid, contentListing, pricingTable, linkTree, upcomingEvents.
Event split
addUpcomingEventsPreSplit() in eventSplit.ts splits upcomingEvents blocks: events with dateEnd in the past go to a pastEvents array. The component renders "Upcoming" and "Past" sections.
Next: Deployment