Skip to Content
DocumentationFeaturesPlatformPage types & schemas

Page types & schemas

Every page in the mesh has a page type — a typed contract that says both how to write it and what shape it must take. A page type is always a pair: a template and a schema.

What it is

Each entry under page_types in gtmesh.config.yaml names a template and a schema:

  • The template (templates/<type>.md) is the prose theory — the editorial guidance the article-writer follows when filling the body.
  • The schema (schemas/<type>.schema.yaml) is the structure — a JSON Schema that apply scaffolds an empty skeleton from, and that validate/seal enforce with ajv. The SSG renders against the same contract.

Two schema systems, never conflated: zod validates the registry; JSON Schema / ajv validates page YAML structure. Page types live entirely in the second world.

Why it matters

Typed contracts are what keep programmatic content consistent at scale. The schema guarantees a review page always carries a rubric and a verdict block, a comparison always carries its entity pair, and so on — so a thousand generated pages share one shape the SSG can render and AI answer engines can parse. The template guarantees they share one voice. Because the schema is checked at seal, a page that doesn’t conform simply cannot ship.

How it works

Selection is deterministic. Each page type carries a when predicate (usually a section, sometimes a role) and plan picks the type whose predicate matches — first match wins, so specific rules sit above catch-alls. A kind: commercial_* project selects the money-layer types (product, tool, directory, trust); a content site selects entity-hub, educational, guide, and friends.

Every page validates as the {type, meta, content} envelope (additionalProperties: false, with type as a const discriminator). meta is the render projection — slug is apply-owned, the editorial fields (metaTitle/title/navTitle/metaDescription) are writer-authored. content is the typed body.

A type can also carry schema variantsschema_variants plus variant_when lets one type resolve to a different schema by context. The scaffold’s educational type, for example, renders thin when a sibling hub exists in the same product cluster and full otherwise; plan resolves which one applies.

Key files & flags

ThingWhat it is
gtmesh.config.yaml page_typesThe list of types: each idtemplate + schema + when
templates/<type>.mdProse theory for the writer
schemas/<type>.schema.yamlThe structural contract (JSON Schema)
schemas/common.schema.yamlShared types, merged then locally $ref-ed
schema_variants / variant_whenResolve one type to a variant schema by context
gtmesh validate <slug>Check a page against its schema (ajv) + editorial lints
Last updated on