A full course — 3 notes. The headless CMS: a hosted document store, a query language of its own, and a schema that doubles as the editing UI.
Sanity is the implementation; the framework-agnostic half — what a headless CMS is for, and how to model content — lives in 04 — content modelling and headless CMS. Read that first if you’ve never modelled content before.
The notes
- 01 — The Sanity Model — [Beginner → Intermediate] — projects, datasets and the API version that’s a date, schemas as JS,
useCdnand when it must befalse, singletons as convention,required()is a form check, not a constraint, the embedded Studio - 02 — GROQ ⭐ — [Beginner → Intermediate] — the three parts of every query,
->as the entire join story, the projection is the optimisation, parameters vs. injection, conditional filters,count()and pagination - 03 — Portable Text and Images — [Intermediate] — why rich text isn’t HTML, blocks/spans/marks/
markDefsindirection, the four renderer buckets, asset references, hotspots, the URL builder, stacking two CDNs
The one idea
Sanity is a hosted document database whose schema is written in JavaScript and generates its own admin UI. It has no opinion about presentation — that split is what “headless” means, and everything else follows from it.
Three consequences worth holding onto:
- Your schema is three artifacts at once — validation, the editor’s form, and the only documentation a non-technical editor will ever read. A skipped
descriptionis an instruction never delivered. required()is enforced by the Studio, not the API. Anything written by a script or a migration can violate it. Guard in the query withdefined().- The projection, not the filter, is where query performance lives. GROQ returns the shape you ask for; ask for less.
Where the material actually is
~7,000 words against real code — 16 document types, 24 queries, and 434 posts migrated in from Wix:
- munakalati — Sanity (5 notes)
- munakalati — the Wix→Sanity migration (5 notes) — the harder half
Related
- content modelling and headless CMS — the concepts this implements
- Next.js — the framework it’s usually paired with
- frameworks/
Software engineering
Infrastructure & security
Computer science
Hardware & engineering