Replace Spotify show embed on /episodes with custom player; v1.1.6
LatestEpisodePlayer fetches the most recent episode from /api/episodes (Anchor RSS) and renders it with the centered cinematic layout. The Spotify show iframe is removed; platform buttons and HeadlinerWidget remain below as before. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "siteforge",
|
"name": "siteforge",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.1.5",
|
"version": "1.1.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
+22
-11
@@ -1578,6 +1578,27 @@ function FinishedSeriesPage({ content }: { content: SiteContent }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function LatestEpisodePlayer({ content }: { content: SiteContent }) {
|
||||||
|
const [audioUrl, setAudioUrl] = useState('')
|
||||||
|
const [title, setTitle] = useState('')
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetch('/api/episodes')
|
||||||
|
.then(r => r.ok ? r.json() : Promise.reject())
|
||||||
|
.then((data: { episodes?: { title: string; audioUrl: string }[] }) => {
|
||||||
|
const latest = data.episodes?.[0]
|
||||||
|
if (latest?.audioUrl) {
|
||||||
|
setAudioUrl(latest.audioUrl)
|
||||||
|
setTitle(latest.title)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
if (!audioUrl) return <div className="episode-embed-skeleton" aria-label="Loading player…" style={{ height: 152 }} />
|
||||||
|
return <EpisodeAudioPlayer src={audioUrl} title={title} size="full" spotifyUrl={content.platformSpotifyUrl} />
|
||||||
|
}
|
||||||
|
|
||||||
function EpisodesPage({ content }: { content: SiteContent }) {
|
function EpisodesPage({ content }: { content: SiteContent }) {
|
||||||
const siteTitle = content.seo?.title || DEFAULTS.seo.title
|
const siteTitle = content.seo?.title || DEFAULTS.seo.title
|
||||||
usePageMeta(
|
usePageMeta(
|
||||||
@@ -1596,17 +1617,7 @@ function EpisodesPage({ content }: { content: SiteContent }) {
|
|||||||
{content.episodesSeoIntro || 'Verse by Verse with Nate is an expository Bible teaching podcast where we go through Scripture one verse at a time. Each episode digs into the text carefully and practically, helping you understand what the Bible says, what it means, and how to live it out. New episodes released regularly — subscribe on Spotify or your favorite podcast platform.'}
|
{content.episodesSeoIntro || 'Verse by Verse with Nate is an expository Bible teaching podcast where we go through Scripture one verse at a time. Each episode digs into the text carefully and practically, helping you understand what the Bible says, what it means, and how to live it out. New episodes released regularly — subscribe on Spotify or your favorite podcast platform.'}
|
||||||
</p>
|
</p>
|
||||||
<div className="embed-wrap">
|
<div className="embed-wrap">
|
||||||
<iframe
|
<LatestEpisodePlayer content={content} />
|
||||||
data-testid="embed-iframe"
|
|
||||||
style={{ borderRadius: '12px' }}
|
|
||||||
src={`https://open.spotify.com/embed/show/0Gq1TzoJOdReSZ1gYQi8Xl?utm_source=generator&si=fb1f6de857424592`}
|
|
||||||
width="100%"
|
|
||||||
height="352"
|
|
||||||
frameBorder="0"
|
|
||||||
allowFullScreen
|
|
||||||
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<PlatformButtons content={content} />
|
<PlatformButtons content={content} />
|
||||||
<HeadlinerWidget />
|
<HeadlinerWidget />
|
||||||
|
|||||||
Reference in New Issue
Block a user