Skip to content

Commit

Permalink
make transistor images work
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Apr 25, 2024
1 parent c1f0f4e commit 68cc9f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/utils/transistor.server.ts
Expand Up @@ -183,6 +183,12 @@ async function createEpisode({
const nameYPosition = -textLines + 5.2
const imageUrl = `https://res.cloudinary.com/kentcdodds-com/image/upload/$th_3000,$tw_3000,$gw_$tw_div_12,$gh_$th_div_12/w_$tw,h_$th,l_kentcdodds.com:social-background/co_white,c_fit,g_north_west,w_$gw_mul_6,h_$gh_mul_2.6,x_$gw_mul_0.8,y_$gh_mul_0.8,l_text:kentcdodds.com:Matter-Medium.woff2_180:${encodedTitle}/c_crop${radius},g_north_west,h_$gh_mul_5.5,w_$gh_mul_5.5,x_$gw_mul_0.8,y_$gh_mul_${avatarYPosition},l_fetch:${encodedAvatar}/co_rgb:a9adc1,c_fit,g_south_west,w_$gw_mul_8,h_$gh_mul_4,x_$gw_mul_0.8,y_$gh_mul_0.8,l_text:kentcdodds.com:Matter-Regular.woff2_120:${encodedUrl}/co_rgb:a9adc1,c_fit,g_south_west,w_$gw_mul_8,h_$gh_mul_4,x_$gw_mul_0.8,y_$gh_mul_${nameYPosition},l_text:kentcdodds.com:Matter-Regular.woff2_140:${encodedName}/c_fit,g_east,w_$gw_mul_11,h_$gh_mul_11,x_$gw,l_kentcdodds.com:illustrations:mic/c_fill,w_$tw,h_$th/kentcdodds.com/social-background.png`

// warm up the image on cloudinary
await fetch(imageUrl, {
method: 'HEAD',
signal: AbortSignal.timeout(2000),
}).catch(() => {})

returnValue.episodeUrl = `${domainUrl}${episodePath}`
returnValue.imageUrl = imageUrl
const updateData: TransistorUpdateEpisodeData = {
Expand Down

0 comments on commit 68cc9f4

Please sign in to comment.