Designing Sanity schemas for brochure sites
Document types, portable text, SEO field groups, and the singleton pattern.
Document types vs objects
In Sanity, document types are top-level content entities — things that exist independently, have their own page in the Studio, and can be queried directly. Objects are reusable shapes embedded inside documents. For a brochure site, your document types are pages, blog posts, and services. Your objects are things like an SEO field group, a feature item, or a carousel card.
Portable Text
Portable Text is Sanity's rich text format — a structured JSON representation of formatted content. Unlike HTML or Markdown stored as strings, Portable Text keeps formatting instructions separate from content. This means you can render the same content into HTML for web, into plain text for summaries, or into any format your frontend needs. Custom marks and custom blocks slot in cleanly.
SEO field groups
Every content document on this site includes an seo object with metaTitle, metaDescription, ogImage, canonicalUrl, and noIndex fields. Grouping these as a typed object means you define the fields once and reuse them across all document types. The Astro SEO component accepts this shape and renders the corresponding head tags, falling back to site-level defaults when page-level values are absent.
The singleton pattern
Some documents should only ever have one instance — site settings, the home page, the about page. The singleton pattern disables the New Document button for these types in the desk structure, and pins each singleton to a fixed document ID so your queries always find exactly one result. All navigation, footer content, and global SEO defaults live in the siteSettings singleton.