--- import MainLayout from '../layouts/MainLayout.astro'; import { getChurchName, fetchSermonsJson, fetchLivestreamArchiveJson } from '../lib/bindings.js'; let churchName = 'Church'; let sermons = []; let livestreams = []; try { churchName = getChurchName(); // Get regular sermons const sermonsJson = fetchSermonsJson(); const parsedSermons = JSON.parse(sermonsJson); sermons = Array.isArray(parsedSermons) ? parsedSermons : (parsedSermons.items || []); // Get livestream archive const livestreamsJson = fetchLivestreamArchiveJson(); const parsedLivestreams = JSON.parse(livestreamsJson); livestreams = Array.isArray(parsedLivestreams) ? parsedLivestreams : (parsedLivestreams.items || []); } catch (e) { console.error('Failed to load sermons:', e); } // Combine all content for display const allContent = [...sermons, ...livestreams]; --- Sermons Be inspired and encouraged through messages from God's Word Sermons LiveStream Archive Recent Messages {allContent.length > 0 ? ( {allContent.map(item => { const isLivestream = livestreams.includes(item); const category = isLivestream ? 'livestream' : 'sermon'; // Hide non-sermon items by default since "Sermons" tab is active const hideByDefault = category !== 'sermon'; return ( {item.title} {item.speaker && ( {item.speaker} )} {item.date && ( {item.date} )} {item.duration && ( {item.duration} )} {livestreams.includes(item) && ( LiveStream Archive )} {item.description && ( {item.description} )} {item.videoUrl && ( Watch )} {item.audioUrl && ( Listen )} {item.downloadUrl && ( )} ) })} ) : ( No Sermons Available Check back soon for new messages from God's Word Watch Live Services )} Stay Connected Don't miss our weekly messages. Join us for live services or subscribe to our updates. Watch Live View Events
Be inspired and encouraged through messages from God's Word
{item.description}
Check back soon for new messages from God's Word
Don't miss our weekly messages. Join us for live services or subscribe to our updates.