Add clickable host bios linking to host detail pages on Nuggets; v2.0.21
Publish Container / docker (push) Has been cancelled
Publish Container / docker (push) Has been cancelled
Each host card on /nuggets now links to /nuggets/hosts/:hostId showing the host's full photo, bio, and listen links. Archived hosts return a graceful "not found" page with a back link. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4607532440
commit
b35605f411
4 files changed
+86
-5
No files matched your search
+65
-2
@@ -1933,7 +1933,7 @@ function NuggetsPage({ content }: { content: SiteContent }) {
|
||||
<p className="eyebrow">Meet the Hosts</p>
|
||||
<div className="nuggets-hosts-list">
|
||||
{activeHosts.map(host => (
|
||||
<div key={host.id} className="nuggets-host-card">
|
||||
<Link key={host.id} to={`/nuggets/hosts/${host.id}`} className="nuggets-host-card nuggets-host-card--link">
|
||||
<div className="nuggets-host-card-header">
|
||||
{host.imageUrl && <img src={host.imageUrl} alt={host.name} className="nuggets-host-card-img" loading="lazy" />}
|
||||
<div className="nuggets-host-card-meta">
|
||||
@@ -1942,7 +1942,8 @@ function NuggetsPage({ content }: { content: SiteContent }) {
|
||||
</div>
|
||||
</div>
|
||||
{host.bio && <p className="nuggets-host-card-bio">{host.bio}</p>}
|
||||
</div>
|
||||
<p className="nuggets-host-card-cta">View Profile →</p>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
@@ -1992,6 +1993,67 @@ function NuggetsPage({ content }: { content: SiteContent }) {
|
||||
)
|
||||
}
|
||||
|
||||
function NuggetsHostDetailPage({ content }: { content: SiteContent }) {
|
||||
const { hostId } = useParams<{ hostId: string }>()
|
||||
const nuggets = content.nuggets ?? DEFAULTS.nuggets
|
||||
const siteTitle = content.seo?.title || DEFAULTS.seo.title
|
||||
const host = (nuggets.hosts ?? []).find(h => h.id === hostId && !h.archived)
|
||||
|
||||
usePageMeta(
|
||||
host ? `${host.name} | ${nuggets.title} | ${siteTitle}` : `Host | ${nuggets.title} | ${siteTitle}`,
|
||||
host?.bio || `Meet ${host?.name}, a host on ${nuggets.title}.`,
|
||||
)
|
||||
|
||||
if (!host) {
|
||||
return (
|
||||
<div className="site">
|
||||
<SiteHeader content={content} />
|
||||
<SiteSearchBar content={content} />
|
||||
<PageBanner eyebrow="Nuggets" title="Host Not Found" desc="This host profile doesn't exist or has been removed." />
|
||||
<section className="section-nuggets-body" style={{ textAlign: 'center', paddingBottom: '4rem' }}>
|
||||
<Link to="/nuggets" className="btn-secondary">← Back to Nuggets</Link>
|
||||
</section>
|
||||
<SiteFooter content={content} />
|
||||
<AnalyticsConsentBanner content={content} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="site">
|
||||
<SiteHeader content={content} />
|
||||
<SiteSearchBar content={content} />
|
||||
<PageBanner eyebrow={nuggets.title} title={host.name} desc={host.role} />
|
||||
<section className="section-nuggets-body" aria-label={`${host.name} profile`}>
|
||||
<div className="section-inner nuggets-host-detail-layout">
|
||||
<div className="nuggets-host-detail-photo-col">
|
||||
{host.imageUrl && (
|
||||
<img src={host.imageUrl} alt={host.name} className="nuggets-host-detail-photo" />
|
||||
)}
|
||||
</div>
|
||||
<div className="nuggets-host-detail-body">
|
||||
{host.bio && <p className="nuggets-host-detail-bio">{host.bio}</p>}
|
||||
{(nuggets.spotifyUrl || nuggets.appleUrl) && (
|
||||
<div className="nuggets-host-detail-listen">
|
||||
<p className="eyebrow" style={{ marginBottom: '0.75rem' }}>Listen to {nuggets.title}</p>
|
||||
<div className="nuggets-platform-links">
|
||||
{nuggets.spotifyUrl && <a href={nuggets.spotifyUrl} target="_blank" rel="noopener noreferrer" className="btn-primary">Listen on Spotify</a>}
|
||||
{nuggets.appleUrl && <a href={nuggets.appleUrl} target="_blank" rel="noopener noreferrer" className="btn-secondary">Listen on Apple Podcasts</a>}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div style={{ marginTop: '2rem' }}>
|
||||
<Link to="/nuggets" className="nuggets-host-detail-back">← Back to {nuggets.title}</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<SiteFooter content={content} />
|
||||
<AnalyticsConsentBanner content={content} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function BooksAndResourcesSection({ content }: { content: SiteContent }) {
|
||||
const books = (content.customLinks ?? []).filter(link => link.placement === 'books')
|
||||
const recommended = (content.customLinks ?? []).filter(link => link.placement === 'recommended')
|
||||
@@ -3131,6 +3193,7 @@ export default function App() {
|
||||
<Route path="/episodes" element={<EpisodesPage content={content} />} />
|
||||
<Route path="/episodes/:id" element={<EpisodeDetailPage content={content} />} />
|
||||
<Route path="/nuggets" element={<NuggetsPage content={content} />} />
|
||||
<Route path="/nuggets/hosts/:hostId" element={<NuggetsHostDetailPage content={content} />} />
|
||||
<Route path="/resources" element={<ResourcesPage content={content} />} />
|
||||
<Route path="/downloads/:id" element={<DownloadDetailPage content={content} />} />
|
||||
<Route path="/about" element={<AboutPage content={content} />} />
|
||||
|
||||
Reference in new issue
Block a user