-
Notifications
You must be signed in to change notification settings - Fork 0
Content Model
Everything lives in cms-core as typed pydantic models. The portable source of truth is the JSON/Markdown export — never the database.
- EN is the source. Target languages: PT-PT, ES, FR, DE (configurable subset).
- Every translatable entity records, per translation, the checksum of the source content it was translated from. States are derived, never stored:
-
missing— no translation exists -
outdated— the source changed after the translation was made -
complete— the translation matches the current source checksum
-
- Editing the source automatically flips its translations to
outdated— no manual bookkeeping, ever. - Publishing requires
completein every required language (therequired-translationsrule: warnings inreview, errors inpublished).
Content moves through draft → review → published → archived. Only published content reaches builds and exports; review/published are validated for language parity.
Article: permanent id (slug), status, timestamps, category (declared slug), sorted unique tags (slugs), optional cover (media id). ArticleContent per language: title (required), summary, body_markdown (CommonMark, raw HTML disabled at render time), optional per-language slug (falls back to the article id).
Page: id, status, timestamps, its own translatable PageContent (title, description, required slug) plus an ordered list of typed sections.
Section: key (unique per page), kind (names the theme template that renders it — the theme owns the meaning), and free-form SectionContent: a fields name→value map plus a media id list. Sections translate independently.
A page's aggregate language state is the worst state across its own content and all its sections — one untranslated section keeps the whole page unpublished in that language.
A section whose fields include a menu entry contributes a home-anchor menu item.
MediaAsset: id, filename, MIME type, dimensions for images, mandatory EN alt text, translatable alt per language. Validation checks every referenced asset exists and that images carry alt text.
| Rule | Severity | What it checks |
|---|---|---|
required-translations |
error (published) / warning (review) | complete translations in every required language |
unique-slugs |
error | no URL collisions within any language |
media-references |
error | covers/section media point at existing assets |
media-alt-coverage |
error/warning | EN alt mandatory; translated alt coverage |
known-categories |
error | article categories are declared in config |
Rules are composable: any object with a name and check(content, context) is a rule; RuleSet runs the enabled ones and aggregates a Report (errors, warnings, ok). Publishing is gated on zero errors.
Sardine CMS — multilingual, static-first CMS framework · Repository · Live demo · Apache-2.0