Sanity Schemas
Sanity Schemas
Section titled “Sanity Schemas”Podcast Framework provides 8 pre-built Sanity schemas that cover all common podcast website needs. All schemas are extensible - add custom fields without modifying framework code.
Available Schemas
Section titled “Available Schemas”Core Content (4 schemas)
Section titled “Core Content (4 schemas)”- Episode - Individual podcast episodes
- Guest - Podcast guests
- Host - Podcast hosts
- Podcast - Podcast metadata (one document)
Configuration (3 schemas)
Section titled “Configuration (3 schemas)”- Theme - Visual theme configuration
- Homepage Config - Homepage section configuration
- About Page Config - About page content configuration
User Content (1 schema)
Section titled “User Content (1 schema)”- Contribution - Community contributions
Episode Schema
Section titled “Episode Schema”The most important schema - represents individual podcast episodes.
Fields
Section titled “Fields”Core Metadata:
title(string, required) - Episode titleslug(slug, required) - URL-safe slug (auto-generated from title)episodeNumber(number, required) - Episode number (1, 2, 3, …)publishDate(date, required) - Publish dateduration(string) - Duration in HH:MM:SS or MM:SS formatdescription(text, required) - Episode description
Content:
showNotes(block content) - Rich text show notestranscript(text) - Full episode transcripttranscriptSegments(array) - Timestamped segments (advanced)
People:
hosts(reference array) - References to Host documentsguests(reference array) - References to Guest documents
Media:
coverImage(image) - Episode cover artaudioUrl(url) - Direct MP3 URL
Platform Links:
spotifyLink(url) - Spotify episode URLapplePodcastLink(url) - Apple Podcasts episode URLyoutubeLink(url) - YouTube episode URL
Features:
featured(boolean) - Mark as featured episode
Example Document:
{ _type: 'episode', _id: 'episode-42', title: 'The Future of Ethereum', slug: { current: 'the-future-of-ethereum' }, episodeNumber: 42, publishDate: '2024-01-15', duration: '1:23:45', description: 'Deep dive into Ethereum scaling solutions...', showNotes: [ { _type: 'block', children: [{ text: 'In this episode...' }] } ], hosts: [{ _ref: 'host-rex' }], guests: [{ _ref: 'guest-vitalik' }], coverImage: { asset: { _ref: 'image-xyz' } }, spotifyLink: 'https://open.spotify.com/episode/...', featured: true, transcript: '**Speaker A:** Welcome to the show...'}Guest Schema
Section titled “Guest Schema”Represents podcast guests.
Fields
Section titled “Fields”Core:
name(string, required) - Guest nameslug(slug, required) - URL-safe slugbio(text) - Guest biographyphoto(image) - Guest photo
Social Links:
twitter(string) - Twitter/X handle (without @)website(url) - Personal or company websitelinkedin(url) - LinkedIn profile URL
Example Document:
{ _type: 'guest', _id: 'guest-vitalik', name: 'Vitalik Buterin', slug: { current: 'vitalik-buterin' }, bio: 'Co-founder of Ethereum...', photo: { asset: { _ref: 'image-abc' } }, twitter: 'VitalikButerin', website: 'https://vitalik.ca'}Host Schema
Section titled “Host Schema”Similar to Guest schema but for podcast hosts.
Fields
Section titled “Fields”Same as Guest schema:
name,slug,bio,phototwitter,website,linkedin
Difference: Referenced in Episode’s hosts field instead of guests.
Podcast Schema
Section titled “Podcast Schema”Podcast-level metadata (create only ONE document).
Fields
Section titled “Fields”Core:
name(string, required) - Podcast nametagline(string) - Short taglinedescription(text) - Full descriptionisActive(boolean) - Currently releasing episodes?logo(image) - Podcast logofavicon(image) - Browser favicon
Platform Links:
spotifyShowId(string) - Spotify show IDspotifyUrl(url) - Spotify show URLapplePodcastsUrl(url) - Apple Podcasts URLyoutubeUrl(url) - YouTube channel URLrssUrl(url) - RSS feed URL
Social:
twitterUrl(url) - Twitter/X profilediscordUrl(url) - Discord server
Newsletter:
newsletterEnabled(boolean) - Enable newsletter signupsconvertKitApiKey(string) - ConvertKit API secretconvertKitFormId(string) - ConvertKit form ID
Example:
{ _type: 'podcast', name: 'Strange Water', tagline: "Ethereum's podcast", description: 'Deep conversations about Ethereum...', isActive: false, // Concluded podcast spotifyUrl: 'https://open.spotify.com/show/...', applePodcastsUrl: 'https://podcasts.apple.com/...', newsletterEnabled: false // No new episodes}Contribution Schema
Section titled “Contribution Schema”Community contributions (episode ideas, guest recommendations, questions, feedback).
Fields
Section titled “Fields”Core:
contributionType(string) - Type of contributionsubmitterName(string) - Optional submitter namesubmitterEmail(string) - Optional emailstatus(string) - Processing statussubmittedAt(datetime) - Submission timestamp
Type-Specific Fields:
- Episode ideas:
episodeTopic,episodeDescription,episodeRationale - Guest recommendations:
guestName,guestBackground,guestRationale,guestContact - Questions:
question,questionContext - Feedback:
feedbackType,feedbackContent
Created Automatically by ContributionService.
Theme Schema
Section titled “Theme Schema”Visual theme configuration.
Fields
Section titled “Fields”Colors:
- Primary, secondary, accent
- Background, text
- Header background/text
- Footer background/text
Typography:
- Font family
- Heading font
Layout:
- Border radius (Tailwind class)
- Spacing preference
See: Theme Configuration for details.
Homepage Config Schema
Section titled “Homepage Config Schema”Configure homepage sections via CMS.
Fields:
- Hero section settings
- Featured episodes section
- Recent episodes section
- Custom sections (array)
See: Homepage Configuration for details.
About Page Config Schema
Section titled “About Page Config Schema”Configure about page content via CMS.
Fields:
- About section
- Hosts section (layout, content)
- Mission section
- Custom sections (array)
See: About Page Configuration for details.
Schema Extension
Section titled “Schema Extension”Extend any schema with custom fields:
Example: Add Sponsor Field
Section titled “Example: Add Sponsor Field”import { extendEpisodeSchema } from '@rejected-media/podcast-framework-sanity-schema';import { defineField } from 'sanity';
const episodeWithSponsor = extendEpisodeSchema([ defineField({ name: 'sponsor', title: 'Episode Sponsor', type: 'reference', to: [{ type: 'sponsor' }] }), defineField({ name: 'sponsorAdUrl', title: 'Sponsor Ad URL', type: 'url' })]);
export const schemaTypes = [ episodeWithSponsor, // Use extended schema guestSchema, // ... other schemas];Example: Add Custom Guest Field
Section titled “Example: Add Custom Guest Field”import { extendGuestSchema } from '@rejected-media/podcast-framework-sanity-schema';
const guestWithCompany = extendGuestSchema([ defineField({ name: 'company', title: 'Company', type: 'string' }), defineField({ name: 'role', title: 'Role/Title', type: 'string' })]);Schema Validation
Section titled “Schema Validation”Schemas include built-in validation:
// Episode Numbervalidation: Rule => Rule.required().positive().integer()// → Must be positive integer (1, 2, 3, ...)
// Slugvalidation: Rule => Rule.required()// → Required field
// Durationdescription: 'Format: HH:MM:SS or MM:SS'// → Validates format manuallyDocument Preview
Section titled “Document Preview”Episode Preview
Section titled “Episode Preview”Shows in document list:
Episode 42: The Future of Ethereum[Cover image thumbnail]Guest Preview
Section titled “Guest Preview”Vitalik Buterin[Photo thumbnail]Custom Preview
Section titled “Custom Preview”Customize document preview:
// In schema definitionpreview: { select: { title: 'title', episodeNumber: 'episodeNumber', media: 'coverImage' }, prepare(selection) { return { title: `Ep ${selection.episodeNumber}: ${selection.title}`, media: selection.media }; }}Related
Section titled “Related”- Setup - Initial Sanity configuration
- Content Management - Add content to Sanity
Next Steps
Section titled “Next Steps”- Content Management - Start adding content
- Theme Configuration - Customize theme