Pages (WYSIWYG)
Simple published pages with a rich-text body
npx @kurbo/dkit add pages
Interactive install multi-selects UI components (defaults pre-selected). Schema only: npx @kurbo/dkit add pages --schema-only · With sample data: npx @kurbo/dkit add pages --seed
Schema
Collections and fields from this module's snapshot.json (dkit.rest). Names below are logical; dkit add applies your collection prefix.
Access
- dkit Pages Public ReadPublic read for WYSIWYG pages (flat rules — Core-compatible). UI filters published status.
- read → pages [*]
Services
Fetch and write helpers installed as lib/dkit/pages.ts. Import from @/lib/dkit/pages. See Services.
async function getPageById(id: string): Promise<SitePage | null>async function getPageBySlug( slug: string, options: GetPageBySlugOptions = {} ): Promise<SitePage | null>Pages module list helper.
async function getPages(options: GetPagesOptions = {}): Promise<SitePage[]>
Flows & seed
Optional Directus extras from services/. Flows apply on dkit add; seed only with --seed.
Seed
services/seed.json — import with npx @kurbo/dkit add pages --seedpages2 items
- Sample: About
/aboutpublished - Sample: Hello
/hellopublished
UI preview
Preview data comes from the module seed — the same JSON as dkit add --seed.
npx @kurbo/dkit add page-detail
page-detail
WYSIWYG page view with title, excerpt, and body
Loading preview…