Homepage Configuration
Homepage Configuration
Section titled “Homepage Configuration”Configure your podcast homepage sections, layout, and content directly in Sanity CMS without modifying code.
Quick Start
Section titled “Quick Start”- Open Sanity Studio
- Click “Homepage Config” in sidebar
- Click “Create new Homepage Config”
- Configure sections
- Toggle “Is Active” ON
- Click “Publish”
Available Sections
Section titled “Available Sections”Hero Section
Section titled “Hero Section”Homepage hero with title, subtitle, and call-to-action.
Fields:
- Enabled: Show/hide hero
- Title: Main hero title
- Subtitle: Supporting text
- CTA Text: Button text
- CTA Link: Button destination
Example:
Title: "Welcome to Strange Water"Subtitle: "Deep conversations about Ethereum and Web3"CTA Text: "Listen Now"CTA Link: "/episodes"Featured Episodes Section
Section titled “Featured Episodes Section”Show featured episodes carousel or grid.
Fields:
- Enabled: Show/hide section
- Title: Section heading
- Layout: Carousel or grid
- Limit: Max episodes to show
Example:
Title: "Featured Episodes"Layout: CarouselLimit: 3Episodes marked with featured: true appear here.
Recent Episodes Section
Section titled “Recent Episodes Section”Show recent episodes.
Fields:
- Enabled: Show/hide section
- Title: Section heading
- Layout: Grid or list
- Limit: Max episodes to show (default: 6)
Example:
Title: "Latest Episodes"Layout: GridLimit: 6Shows 6 most recent episodes automatically.
About Section
Section titled “About Section”Brief about section on homepage.
Fields:
- Enabled: Show/hide section
- Title: Section heading
- Content: Rich text content (block content)
- CTA Text: Optional button text
- CTA Link: Optional button link
Example:
Title: "About the Show"Content: [Block content with podcast description]CTA Text: "Learn More"CTA Link: "/about"Newsletter Section
Section titled “Newsletter Section”Newsletter signup CTA.
Fields:
- Enabled: Show/hide section
- Title: Section heading
- Description: Supporting text
- Show Only If Active: Only show for active podcasts
Example:
Title: "Never Miss an Episode"Description: "Get weekly episodes delivered to your inbox"Show Only If Active: trueCustom Sections
Section titled “Custom Sections”Add unlimited custom sections with block content.
Fields:
- Title: Section heading
- Content: Rich text content
- Order: Display order (lower numbers first)
- Background Color: Optional background (light/dark)
Example Custom Section:
Title: "Community"Content: [Block content about community]Order: 4Background: lightConfiguration Example
Section titled “Configuration Example”{ _type: 'homepageConfig', title: 'Homepage', isActive: true,
hero: { enabled: true, title: 'Welcome to Strange Water', subtitle: "Ethereum's podcast", ctaText: 'Listen Now', ctaLink: '/episodes' },
featuredEpisodes: { enabled: true, title: 'Featured Episodes', layout: 'carousel', limit: 3 },
recentEpisodes: { enabled: true, title: 'Recent Episodes', layout: 'grid', limit: 6 },
about: { enabled: true, title: 'About the Show', content: [ { _type: 'block', children: [{ text: 'Strange Water brings you...' }] } ], ctaText: 'Learn More', ctaLink: '/about' },
newsletter: { enabled: true, title: 'Never Miss an Episode', description: 'Get episodes delivered to your inbox', showOnlyIfActive: true },
customSections: [ { title: 'Join Our Community', content: [...], order: 5, background: 'light' } ]}Using Configuration in Code
Section titled “Using Configuration in Code”---import { getPodcast, getHomepageConfig, getFeatured, getEpisodes } from '@rejected-media/podcast-framework-core';
const podcast = await getPodcast();const config = await getHomepageConfig();const featured = config?.featuredEpisodes?.enabled ? await getFeatured(config.featuredEpisodes.limit) : null;const recent = config?.recentEpisodes?.enabled ? await getEpisodes() : null;---
{config?.hero?.enabled && ( <section class="hero"> <h1>{config.hero.title}</h1> <p>{config.hero.subtitle}</p> {config.hero.ctaText && ( <a href={config.hero.ctaLink}>{config.hero.ctaText}</a> )} </section>)}
{config?.featuredEpisodes?.enabled && featured && ( <FeaturedEpisodesCarousel episodes={featured} title={config.featuredEpisodes.title} />)}
{config?.recentEpisodes?.enabled && recent && ( <section> <h2>{config.recentEpisodes.title}</h2> <div class="grid grid-cols-3 gap-6"> {recent.slice(0, config.recentEpisodes.limit || 6).map(episode => ( <EpisodeCard episode={episode} /> ))} </div> </section>)}Section Ordering
Section titled “Section Ordering”Control section order with custom sections:
1. Hero (fixed, always first)2. Featured Episodes3. Recent Episodes4. About5. Custom Section (order: 5)6. Custom Section (order: 6)7. Newsletter (fixed, near end)Customize order:
customSections: [ { title: 'Community', order: 3 }, // Shows before Recent Episodes { title: 'Sponsors', order: 10 } // Shows after everything]Fallback Content
Section titled “Fallback Content”If no Homepage Config exists, pages use fallback content:
{config ? ( <!-- CMS-configured content --> <Hero {...config.hero} />) : ( <!-- Fallback content --> <section class="hero"> <h1>Welcome to {podcast?.name}</h1> </section>)}This ensures your site always works, even without configuration.
Best Practices
Section titled “Best Practices”1. Start Simple
Section titled “1. Start Simple”Enable only essential sections first:
✅ Hero✅ Featured Episodes (3-5 episodes)✅ Recent Episodes (6 episodes)✅ Newsletter (if active)Add custom sections later.
2. Keep Hero Concise
Section titled “2. Keep Hero Concise”✅ "Welcome to Strange Water"✅ "Ethereum's podcast"
❌ "Welcome to Strange Water, the best podcast about Ethereum..." (too long for hero)3. Limit Featured Episodes
Section titled “3. Limit Featured Episodes”✅ 3-5 featured episodes (manageable)❌ 20 featured episodes (overwhelming)4. Test Mobile Layout
Section titled “4. Test Mobile Layout”Preview on mobile:
- Hero stacks vertically
- Grids become single column
- CTAs full-width
Troubleshooting
Section titled “Troubleshooting”Configuration not applying
Section titled “Configuration not applying”Check 1: Config is active
- Open Homepage Config
- Verify “Is Active” is ON
Check 2: Only one config is active
- Search for “Homepage Config”
- Ensure only one has
isActive: true
Check 3: Rebuild site
npm run buildSections not showing
Section titled “Sections not showing”Check enabled field:
hero: { enabled: true // ← Must be true}Images not loading in custom sections
Section titled “Images not loading in custom sections”Upload images to Sanity:
- In block content, click image icon
- Upload image
- Click “Insert”
Related
Section titled “Related”- About Page Configuration - Configure about page
- Theme Configuration - Visual theme
- Content Management - Manage content
Next Steps
Section titled “Next Steps”- About Page Configuration - Configure about page
- Custom Sections - Add custom sections
- Components - Use components in sections