@@ -89,9 +89,7 @@ export default function BlogPostItemFooterWrapper(props: Props): JSX.Element {
8989 month : "short" ,
9090 day : "numeric" ,
9191 } ) . format ( new Date ( metadata . date ) ) ;
92- const metaItems = [ authorHandle , blogDate , readTimeText ]
93- . filter ( Boolean )
94- . join ( META_SEPARATOR ) ;
92+ const metaDateAndTime = [ blogDate , readTimeText ] . filter ( Boolean ) . join ( META_SEPARATOR ) ;
9593
9694 const showAuthorCard = Boolean ( isBlogPostPage && primaryAuthor && authorName ) ;
9795
@@ -111,7 +109,28 @@ export default function BlogPostItemFooterWrapper(props: Props): JSX.Element {
111109 < section ref = { authorCardRef } className = { styles . authorCard } aria-label = "Post author details" >
112110 < div className = { styles . authorBody } >
113111 < div className = { styles . authorAvatarWrapper } >
114- { authorAvatar ? (
112+ { githubUrl ? (
113+ < Link
114+ to = { githubUrl }
115+ className = { styles . authorAvatarLink }
116+ target = "_blank"
117+ rel = "noopener noreferrer"
118+ aria-label = { `${ authorName } on GitHub` }
119+ >
120+ { authorAvatar ? (
121+ < img
122+ className = { styles . authorAvatar }
123+ src = { authorAvatar }
124+ alt = { `${ authorName } profile picture` }
125+ loading = "lazy"
126+ />
127+ ) : (
128+ < div className = { styles . authorAvatarFallback } aria-hidden = "true" >
129+ { authorName ?. charAt ( 0 ) . toUpperCase ( ) }
130+ </ div >
131+ ) }
132+ </ Link >
133+ ) : authorAvatar ? (
115134 < img
116135 className = { styles . authorAvatar }
117136 src = { authorAvatar }
@@ -137,10 +156,40 @@ export default function BlogPostItemFooterWrapper(props: Props): JSX.Element {
137156 </ div >
138157 < div className = { styles . authorIdentity } >
139158 < div className = { styles . authorNameRow } >
140- < p className = { styles . authorName } > { authorName } </ p >
159+ { githubUrl ? (
160+ < Link
161+ to = { githubUrl }
162+ className = { styles . authorName }
163+ target = "_blank"
164+ rel = "noopener noreferrer"
165+ >
166+ { authorName }
167+ </ Link >
168+ ) : (
169+ < p className = { styles . authorName } > { authorName } </ p >
170+ ) }
141171 < span className = { styles . authorBadge } > Author</ span >
142172 </ div >
143- { metaItems ? < p className = { styles . authorMeta } > { metaItems } </ p > : null }
173+ { ( authorHandle || metaDateAndTime ) ? (
174+ < p className = { styles . authorMeta } >
175+ { authorHandle && (
176+ githubUrl ? (
177+ < Link
178+ to = { githubUrl }
179+ className = { styles . authorHandleLink }
180+ target = "_blank"
181+ rel = "noopener noreferrer"
182+ >
183+ { authorHandle }
184+ </ Link >
185+ ) : (
186+ authorHandle
187+ )
188+ ) }
189+ { authorHandle && metaDateAndTime ? META_SEPARATOR : null }
190+ { metaDateAndTime }
191+ </ p >
192+ ) : null }
144193 { authorSummary ? (
145194 < p className = { styles . authorSummary } > { authorSummary } </ p >
146195 ) : null }
0 commit comments