This commit is contained in:
Matt Kane
2026-04-01 11:51:57 +01:00
parent c8e318da5c
commit ca3c2b77e1
88 changed files with 313 additions and 481 deletions

View File

@@ -261,17 +261,17 @@ The `"."` export has the descriptor. The `"./sandbox"` export has the implementa
Each feature is optional. Add only what your plugin needs:
| Feature | Where | Standard | Native | Purpose |
| ------------------- | ---------------------------- | -------- | ------ | ------------------------------------------------------- |
| **Hooks** | `definePlugin({ hooks })` | Yes | Yes | React to content/media/lifecycle events |
| **Storage** | descriptor `storage` | Yes | Yes | Document collections with indexed queries |
| **KV** | `ctx.kv` in hooks/routes | Yes | Yes | Key-value store for internal state |
| Feature | Where | Standard | Native | Purpose |
| ------------------- | ---------------------------- | -------- | ------ | ----------------------------------------------------- |
| **Hooks** | `definePlugin({ hooks })` | Yes | Yes | React to content/media/lifecycle events |
| **Storage** | descriptor `storage` | Yes | Yes | Document collections with indexed queries |
| **KV** | `ctx.kv` in hooks/routes | Yes | Yes | Key-value store for internal state |
| **API Routes** | `definePlugin({ routes })` | Yes | Yes | REST endpoints at `/_emdash/api/plugins/<id>/<route>` |
| **Admin Pages** | Block Kit `admin` route | Yes | Yes | Admin pages via Block Kit (JSON blocks) |
| **Widgets** | Block Kit `admin` route | Yes | Yes | Dashboard cards via Block Kit |
| **React Admin** | `admin.entry` + React export | No | Yes | React-based admin pages and widgets (native only) |
| **PT Blocks** | `admin.portableTextBlocks` | No | Yes | Custom block types in the Portable Text editor |
| **Site Components** | `componentsEntry` | No | Yes | Astro components for rendering blocks on the site |
| **Admin Pages** | Block Kit `admin` route | Yes | Yes | Admin pages via Block Kit (JSON blocks) |
| **Widgets** | Block Kit `admin` route | Yes | Yes | Dashboard cards via Block Kit |
| **React Admin** | `admin.entry` + React export | No | Yes | React-based admin pages and widgets (native only) |
| **PT Blocks** | `admin.portableTextBlocks` | No | Yes | Custom block types in the Portable Text editor |
| **Site Components** | `componentsEntry` | No | Yes | Astro components for rendering blocks on the site |
See the reference files for detailed syntax:

View File

@@ -66,8 +66,8 @@ definePlugin({
## Route URLs
| Plugin ID | Route Name | URL |
| --------- | --------------- | ------------------------------------------ |
| Plugin ID | Route Name | URL |
| --------- | --------------- | ---------------------------------------- |
| `forms` | `status` | `/_emdash/api/plugins/forms/status` |
| `forms` | `submissions` | `/_emdash/api/plugins/forms/submissions` |
| `seo` | `settings/save` | `/_emdash/api/plugins/seo/settings/save` |

View File

@@ -14,11 +14,11 @@ The admin UI is at `http://localhost:4321/_emdash/admin`.
| File | Purpose |
| ------------------------ | ---------------------------------------------------------------------------------- |
| `astro.config.mjs` | Astro config with `emdash()` integration, database, and storage |
| `src/live.config.ts` | EmDash loader registration (boilerplate -- don't modify) |
| `astro.config.mjs` | Astro config with `emdash()` integration, database, and storage |
| `src/live.config.ts` | EmDash loader registration (boilerplate -- don't modify) |
| `seed/seed.json` | Schema definition + demo content (collections, fields, taxonomies, menus, widgets) |
| `emdash-env.d.ts` | Generated types for collections (auto-regenerated on dev server start) |
| `src/layouts/Base.astro` | Base layout with EmDash wiring (menus, search, page contributions) |
| `emdash-env.d.ts` | Generated types for collections (auto-regenerated on dev server start) |
| `src/layouts/Base.astro` | Base layout with EmDash wiring (menus, search, page contributions) |
| `src/pages/` | Astro pages -- all server-rendered |
## Skills