@wptom/content-model
v0.1.2
Published
Describes a template's Zod content schemas as a neutral field tree, so every CMS adapter (Keystatic, Sanity, …) edits exactly the same content model.
Readme
@wptom/content-model
Reads a WPTom template's content model (src/content/model.ts, Zod schemas) into a plain
description of its fields, so every CMS integration (Keystatic, Sanity, EmDash) generates its
schema, forms and validation from the same source. Part of the WPTom
integrations; you rarely use it directly.
describe(schema): one field as a node:text,number,boolean,date,select,multiselect,image,object,listorblocks(page sections), with its label, help text, default and rules (optional, pattern, length, min/max, integer) taken from the schema.describeFields(schema): every field of an object schema, by key.humanize(key): the label a field gets when the model doesn't set one (heroImage→ "Hero image").
No dependencies. MIT License.
