Step by step: how a field definition in TypeScript becomes an editable CMS form automatically.
AstroForge's schema pipeline ensures developers never have to spend time manually configuring CMS forms. The idea is simple: define the organism in TypeScript, and the CMS forms generate themselves.
src/lib/config/organism-schemas.ts contains field definitions for each organism. An example definition:
Hero: {
label: 'Hero Section',
fields: [
{ key: 'badge', type: 'text', label: 'Badge' },
{ key: 'headline', type: 'text', label: 'Headline' },
{ key: 'items', type: 'repeater', label: 'Items',
fields: [
{ key: 'title', type: 'text', label: 'Title' }
]
}
]
}schema-integration.ts, running as an Astro integration hook, reads organism-schemas.ts and pages.config.ts at the start of every build. It generates src/content/schema/page-*.schema.json files for each page. These are the schema files the CMS uses to build its form UI.
Schema files are generated during the build but not automatically committed to Git. The CMS reads these files directly from GitHub. So for a schema change to reach the CMS, these steps are required:
npm run build — schema files are generatedgit add src/content/schema/ cms.config.jsongit commit && git pushIf this step is skipped, the CMS sees the old schema and new fields don't appear.
For collection organisms, the schema pipeline automatically generates three tabs: General (title, slug, excerpt, body, thumbnail + organism scalar fields), SEO (meta fields), and additional tabs for organism-specific set/repeater fields. This order is fixed for every collection.
Astro SSG: Why Static Sites Belong Here | AstroForge Blog
2025-05-10How Multi-Tenant CMS Works | AstroForge Blog
2025-04-18Git-Backed Content Management | AstroForge Blog
2025-03-25The Organism System: From Component to Page | AstroForge Blog
2025-02-14Choosing a Template Engine for Your Agency | AstroForge Blog
2025-01-30