How SanityPress Works
The Schema and the Studio
The SchemaΒΆ
DocumentsΒΆ
π /src/sanity/schemaTypes/documents
High-level standalone data types, typically found in the sidebar of the Sanity Studio.
Read more in the blog post here. π£οΈ
Global dataΒΆ
- Site β a singleton data type used for global data such as logo(s) and copyright info, etc.
Page & blog data (routes)ΒΆ
- Page β a Next.js route with a unique slug (permalink) composed of modules (
/*
). - Blog post β like page documents but solely for blog content (
/blog/*
). - Blog category β useful for filtering blog posts.
Menus & redirectsΒΆ
- Navigation β a collection of links (header/footers menus and social links, etc).
- Redirect β URL rewrites.
MiscellaneousΒΆ
A collection of reusable content that can be referenced within other documents and modules, such as:
- Announcement β schedule-able hotline banners displayed above the site header. Make sure to register them in the site document.
- Logos β used in the Logo list module, etc.
- Person β used as blog authors, as employee lists, etc.
- Pricing tiers β used in the Pricing list module.
- Reputation β set a GitHub repo to automatically retrieve the star and fork counts.
- Testimonials β used in the Testimonial-list and Testimonial (featured) modules.
ObjectsΒΆ
π /src/sanity/schemaTypes/objects
A collection of primitive fields, typically found to compose modules or documents.
- CTA β call-to-action; a wrapper around the link object with additional.
- Link β a collection of fields used to reference internal pages or link to external URLs.
- Link list βΒ an array of links, used in navigation documents.
- Metadata β a collection of fields used for SEO purposes (title, description, slug, no-indexing, etc).
- Module options β helpful fields that can be assigned per module; include a
hidden
field (module visibility) and auid
field (used for jump links and selectors for custom CSS).
ModulesΒΆ
π /src/sanity/schemaTypes/modules
Document schema types are composed of Next.js components called modules (a.k.a. "sections" or "building blocks") that can be re-used and re-ordered. Modules are meant to be added and customized to suit your needs.
Each module has a Next.js component file(s) and a corresponding Sanity schema file.
Find a list of all built-in modules (with live examples) here. π§±
Learn how to schedule content with the Schedule module.
The StudioΒΆ
yourwebsite.com/admin
(replace with your domain)
Hitting "publish" on any document in the Studio will instantly update on your live site. Read more about the Sanity's Live Content API in this blog post.
Screenshots of the Sanity Studio can be found here. πΌοΈ