Skip to content

Commit cd1b99f

Browse files
2u841rclaude
andcommitted
Fall back to X/Twitter photo for guests without GitHub
Guests with no GitHub handle were showing a broken image. Falls back to unavatar.io/twitter for guests with a Twitter handle, and github.com/ghost.png for the rare case of neither. Closes #2182 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 47a126c commit cd1b99f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/routes/(site)/guests/+page.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const load = async function () {
1616
name_slug: true,
1717
id: true,
1818
github: true,
19+
twitter: true,
1920
url: true,
2021
social: true
2122
}

src/routes/(site)/guests/+page.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@
7070
<div>
7171
<a href="/guest/{guest.name_slug}">
7272
<img
73-
src="https://github.com/{guest.github || 'null'}.png"
73+
src={guest.github
74+
? `https://github.com/${guest.github}.png`
75+
: guest.twitter
76+
? `https://unavatar.io/twitter/${guest.twitter}`
77+
: `https://github.com/ghost.png`}
7478
alt={guest.name}
7579
width="460"
7680
height="460"

0 commit comments

Comments
 (0)