Posts And Content
Posts owns the CMS, Editor.js canvas, content validation, public rendering, legal pages, and public content routes.
On this page
Content routes
| Content type | Dashboard path | Public path |
|---|---|---|
| Blog post | /content/posts | /blog/[slug] |
| Case study | /content/case-studies | /case-studies and /blog/case-studies/[slug] |
| Page | /content/pages | /privacy, /terms, /disclaimer, and managed pages |
| FAQ | /content/faq | /faq |
| Changelog | /content/changelog | /changelog and /changelog/[version]/[slug] |
| Team member | /content/team | /team and /team/[id] |
| SEO | /content/seo | Public metadata and content metadata |
Where to look
| Area | Paths |
|---|---|
| Editor routes | src/app/(editor)/content/editor/[kind]/[id], preview |
| CMS UI | src/features/posts/ui/cms |
| Public UI | src/features/posts/ui/blog, src/features/posts/ui/legal |
| Server | src/features/posts/server |
| Shared helpers | src/features/posts/shared/kind.ts, editor-submit.ts, cover-image.ts, share.ts, cms |
| Styles | src/app/styles/post-editor.css, src/app/styles/post-content.css |
Code-backed content map
CMS and editor actions
Editor routes, actions, queries, and upsert services keep content validation and persistence server-owned.
src/features/posts/server/posts/actions/editor.tssrc/features/posts/server/posts/queries/editor.tssrc/features/posts/server/posts/services/editor-upsert.ts
Editor canvas
Editor UI, canvas state, history, validation, and local recovery stay inside the posts feature.
src/features/posts/ui/cms/editor.tsxsrc/features/posts/shared/cms/canvas/state.tssrc/features/posts/shared/cms/canvas/history.tssrc/features/posts/ui/cms/hooks/use-local-recovery.ts
Public rendering
Public post queries, content rendering, legal layouts, and route-kind helpers keep public output consistent.
src/features/posts/server/posts/queries/public-posts.tssrc/features/posts/ui/blog/content-renderer.tsxsrc/features/posts/ui/legal/legal-document-layout.tsxsrc/features/posts/shared/kind.ts
Content publishing flow
- 1
Edit client-side canvas state
The editor manages block state, selection, history, recovery, and validation before submit.
src/features/posts/ui/cms/editor.tsxsrc/features/posts/shared/cms/canvas/state.tssrc/features/posts/shared/cms/validation/validation.ts
- 2
Submit through server actions
Editor actions validate payloads and delegate persistence to content-owned services.
src/features/posts/server/posts/actions/editor.tssrc/features/posts/server/posts/services/editor-upsert.ts
- 3
Revalidate public routes
Maintenance actions keep published content routes in sync with database changes.
src/features/posts/server/posts/actions/maintenance.ts
- 4
Render public content
Public queries and renderers map stored content kinds into blog, FAQ, changelog, case study, page, legal, and team surfaces.
src/features/posts/server/posts/queries/public-posts.tssrc/features/posts/ui/blog/content-renderer.tsxsrc/features/posts/shared/kind.ts
Editor validation items
Source: src/features/posts/shared/cms/validation/validation.ts
Validation errors are projected into stable field labels for the editor UI.
export function buildValidationItems(
fieldErrors: Record<string, string | undefined> | null,
): ValidationItem[] {
if (!fieldErrors) return [];
return Object.entries(fieldErrors)
.filter(([, message]) => Boolean(message))
.map(([key, message]) => ({
key,
label: labelForField(key),
message: message ?? "",
}));
}Publishing rules
- Keep editor state, validation, rendering, and persistence separate.
- Require valid scheduled times for scheduled posts.
- Preview public output before publishing important content.
- Use content-owned metadata for SEO fields.
- Keep remote image URL upload disabled unless you intentionally add that trust boundary.