22import { PortableText } from " astro-portabletext" ;
33import { urlForImage } from " @/utils/sanity" ;
44import ContentCard from " ./ContentCard.astro" ;
5+ import Avatar from " ./Avatar.astro" ;
6+ import Badge from " ./Badge.astro" ;
57
68interface Props {
79 person: any ;
@@ -21,34 +23,45 @@ function getHostname(url: string): string {
2123---
2224
2325<div class =" flex flex-col md:flex-row gap-8 mb-12" >
24- { coverUrl && (
26+ { coverUrl ? (
2527 <img
2628 src = { coverUrl }
2729 alt = { person .title }
2830 width = { 400 }
2931 height = { 400 }
3032 class = " w-48 h-48 rounded-full object-cover flex-shrink-0"
3133 />
34+ ) : (
35+ <Avatar name = { person .title } size = " xl" />
3236 )}
3337 <div >
34- <h1 class =" text-4xl font-bold mb-4" >{ person .title } </h1 >
38+ <h1 class =" text-4xl font-bold text-[--text] mb-2" >{ person .title } </h1 >
39+
40+ { /* Company & Role for guests */ }
41+ { (person .company || person .role ) && (
42+ <p class = " text-lg text-[--text-secondary] mb-2" >
43+ { [person .role , person .company ].filter (Boolean ).join (" at " )}
44+ </p >
45+ )}
46+
3547 { person .excerpt && (
36- <p class = " text-gray-600 text-lg mb-4" >{ person .excerpt } </p >
48+ <p class = " text-[--text-secondary] text-lg mb-4" >{ person .excerpt } </p >
3749 )}
50+
3851 { person .socials && (
3952 <div class = " flex flex-wrap gap-3" >
4053 { person .socials .twitter && (
41- <a href = { ` https://twitter.com/${person .socials .twitter } ` } target = " _blank" rel = " noopener noreferrer" class = " text-blue-500 hover:underline " >
54+ <a href = { ` https://twitter.com/${person .socials .twitter } ` } target = " _blank" rel = " noopener noreferrer" class = " text-[--text-secondary] hover:text-primary transition-colors " >
4255 Twitter
4356 </a >
4457 )}
4558 { person .socials .github && (
46- <a href = { ` https://github.com/${person .socials .github } ` } target = " _blank" rel = " noopener noreferrer" class = " text-gray-700 hover:underline " >
59+ <a href = { ` https://github.com/${person .socials .github } ` } target = " _blank" rel = " noopener noreferrer" class = " text-[--text-secondary] hover:text-primary transition-colors " >
4760 GitHub
4861 </a >
4962 )}
5063 { person .socials .linkedin && (
51- <a href = { person .socials .linkedin } target = " _blank" rel = " noopener noreferrer" class = " text-blue-700 hover:underline " >
64+ <a href = { person .socials .linkedin } target = " _blank" rel = " noopener noreferrer" class = " text-[--text-secondary] hover:text-primary transition-colors " >
5265 LinkedIn
5366 </a >
5467 )}
@@ -57,7 +70,7 @@ function getHostname(url: string): string {
5770 { person .websites && person .websites .length > 0 && (
5871 <div class = " flex flex-wrap gap-3 mt-2" >
5972 { person .websites .map ((site : string ) => (
60- <a href = { site } target = " _blank" rel = " noopener noreferrer" class = " text-blue-600 hover:underline text-sm " >
73+ <a href = { site } target = " _blank" rel = " noopener noreferrer" class = " text-sm text-[--text-secondary] hover:text-primary transition-colors " >
6174 { getHostname (site )}
6275 </a >
6376 ))}
@@ -67,7 +80,16 @@ function getHostname(url: string): string {
6780</div >
6881
6982{ person .content && (
70- <div class = " prose prose-lg max-w-none mb-12" >
83+ <div class = " prose prose-lg prose-invert max-w-none mb-12
84+ prose-headings:text-[--text] prose-headings:font-bold
85+ prose-p:text-[--text-secondary]
86+ prose-a:text-primary prose-a:no-underline hover:prose-a:underline
87+ prose-strong:text-[--text]
88+ prose-code:text-primary prose-code:bg-[--surface] prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded
89+ prose-pre:bg-[--surface] prose-pre:border prose-pre:border-[--border] prose-pre:rounded-xl
90+ prose-blockquote:border-primary prose-blockquote:text-[--text-secondary]
91+ prose-li:text-[--text-secondary]
92+ " >
7193 <PortableText value = { person .content } />
7294 </div >
7395)}
@@ -76,15 +98,20 @@ function getHostname(url: string): string {
7698 <>
7799 { person .related .podcast && person .related .podcast .length > 0 && (
78100 <section class = " mb-12" >
79- <h2 class = " text-2xl font-bold mb-6" >Related Podcasts</h2 >
80- <div class = " grid gap-6 md:grid-cols-2 lg:grid-cols-4" >
101+ <div class = " flex items-center gap-3 mb-6" >
102+ <Badge type = " podcast" />
103+ <h2 class = " text-2xl font-bold text-[--text]" >Related Podcasts</h2 >
104+ </div >
105+ <div class = " grid gap-6 sm:grid-cols-2 lg:grid-cols-4" >
81106 { person .related .podcast .map ((p : any ) => (
82107 <ContentCard
83108 title = { p .title }
84- slug = { ` /podcast/${p .slug } ` }
85- coverImage = { p .coverImage }
86- excerpt = { p .excerpt }
87- date = { p .date }
109+ url = { ` /podcast/${p .slug } ` }
110+ type = " podcast"
111+ thumbnail = { p .coverImage }
112+ authorName = { p .authorName }
113+ authorImage = { p .authorImage }
114+ metadata = { p .date ? new Date (p .date ).toLocaleDateString (" en-US" , { month: " short" , day: " numeric" , year: " numeric" }) : undefined }
88115 />
89116 ))}
90117 </div >
@@ -93,15 +120,20 @@ function getHostname(url: string): string {
93120
94121 { person .related .post && person .related .post .length > 0 && (
95122 <section class = " mb-12" >
96- <h2 class = " text-2xl font-bold mb-6" >Related Posts</h2 >
97- <div class = " grid gap-6 md:grid-cols-2 lg:grid-cols-4" >
123+ <div class = " flex items-center gap-3 mb-6" >
124+ <Badge type = " blog" />
125+ <h2 class = " text-2xl font-bold text-[--text]" >Related Posts</h2 >
126+ </div >
127+ <div class = " grid gap-6 sm:grid-cols-2 lg:grid-cols-4" >
98128 { person .related .post .map ((p : any ) => (
99129 <ContentCard
100130 title = { p .title }
101- slug = { ` /post/${p .slug } ` }
102- coverImage = { p .coverImage }
103- excerpt = { p .excerpt }
104- date = { p .date }
131+ url = { ` /post/${p .slug } ` }
132+ type = " blog"
133+ thumbnail = { p .coverImage }
134+ authorName = { p .authorName }
135+ authorImage = { p .authorImage }
136+ metadata = { p .date ? new Date (p .date ).toLocaleDateString (" en-US" , { month: " short" , day: " numeric" , year: " numeric" }) : undefined }
105137 />
106138 ))}
107139 </div >
0 commit comments