/platform edits the public Platform marketing pages (what-is-matters,
how-it-works, why-matters) with no code change. It follows the
CPT-backed module pattern: content is stored as
JSON in content.raw of the private WordPress platform CPT, and writes bust the
platform cache tag so the public site revalidates.
| Route | Purpose | Guard |
|---|---|---|
/platform (workspace) | CptDocEditor list + JSON editor | org:content:view (layout.tsx) |
/platform/[slug] (public, root app) | Rendered marketing page (flow/hero templates) | Public (no login) |
The workspace
page.tsx
is a client component rendering CptDocEditor with apiBase="/api/workspace/platform"
and an EMPTY_PLATFORM template (background, heroSections, featuresSections); the
layout.tsx
gates on requirePermission("org:content:view") with dynamic = "force-dynamic".
| Route | Purpose | Clearance |
|---|---|---|
GET /api/workspace/platform | List platform CPT pages | org:content:view |
POST /api/workspace/platform | Create one (cptUpsertSchema) | org:content:edit |
GET / PUT / DELETE /api/workspace/platform/[id] | Fetch (by numeric id or slug), update, trash | view / edit / delete (falls back to edit) |
Handlers use the shared PLATFORM_CPT descriptor and the same cpt.service.ts
helpers as Key Features.
app/platform/[slug]/page.tsx (root app) fetches
`${env.WORDPRESS_URL}/wp-json/wp/v2/platform?slug=${slug}&context=edit&status=any`
with next: { revalidate: 3600, tags: ["platform"] }, parses content.raw as
PlatformPageData, resolves content assets, and composes the hero, feature-flow,
tech-stack, and CTA sections. Drafts and trashed posts return 404. The three core
slugs (what-is-matters, how-it-works, why-matters) exist as checked-in pages.
Related: CPT pattern · Key Features · Content Studio