dkitdkit
dkit:module

Pages (WYSIWYG)

Simple published pages with a rich-text body

npx dkit add pages

Schema only: npx dkit add pages --schema-only · With sample data: npx 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 Read
    Public read for WYSIWYG pages (flat rules — Core-compatible). UI filters published status.
  • read → pages [*]

Requires Directus 11+ (12.2+ recommended). Prefer a staging project before running dkit add against production.

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 dkit add pages --seed

pages2 items

  • Sample: About/aboutpublished
  • Sample: Hello/hellopublished

UI preview

Preview data comes from the module seed — the same JSON as dkit add --seed.

page-detail
WYSIWYG page view with title, excerpt, and body

page-detail

Next · shadcn · dkit