Sanity Starter
Sanity starter with localization utils, presentation tool and types generation
README
Sanity Starter
A starter template for Sanity projects with built-in localization utilities, presentation tool, and automatic types generation.
Features
Localization utilities for multilingual content
- Types: localeBlock, localeSlug, localeString, localeText
- Utils: Languages array -> localization.ts
Presentation tool for custom document views
Automatic TypeScript types generation from Sanity schemas
Plugins Used
@sanity/language-filter: Language filter for Sanity Studiosanity-plugin-media-i18n: Internationalization for media fields (For translated altTexts)
Scripts
dev: Start Sanity Studio in development modebuild: Build the Studio and generate typesdeploy: Deploy the Studiogenerate-types: Extract schema and generate TypeScript types
Getting Started
- Install dependencies:
bun install - Set .env variables:
SANITY_STUDIO_ID="ID_HERE" SANITY_STUDIO_PREVIEW_URL="STUDIO_URL_HERE" SANITY_STUDIO_DATASET="production" - Start the development server:
bun run dev - Generate types:
bun run generate-types
License
MIT