Configured Sanity studio

How the toolkit configures the Sanity studio

Sanity is extremely flexible, but configuring it from scratch can be a challenge. We draw on 5 years of using it to set-up several starting points to speed up you development:

  • Use the sanity-plugin-media (opens in a new tab) by default for easier asset management
    • See the form property in app/sanity/sanity.config.ts
  • Only enable the Vision plugin (opens in a new tab) during development. It's used for testing & running queries.
    • See the plugins array in app/sanity/sanity.config.ts
  • Backlinks as custom views in the document editor
    • Document types can be configured to display their backlinks through the custom.backlinks array in their schemas
    • This is provided by @tinloof/sanity-toolkit's resolveDocumentNode function, which we call in getDefaultDocumentNode in app/sanity/deskStructure.ts
  • Helpers for the A/B testing feature - refer to docs on A/B testing
  • Localization helpers - refer to docs on localization
  • Embedding of the studio inside of the Remix app (under the /manage route)
    • We don't include Remix's <Links /> in this route to prevent including the front-end CSS styles into the studio, slightly improving performance
  • Several battle-tested schemas, like the link, cta, seo, publishStatus, etc.
  • A basic implementation of the sharing image generator
💡

You're of course, welcome and expected to change these defaults to suit your needs. We've tried to make it as easy as possible to do so.