22 * V13: Brand Left Panel — Left 1/4 is a dense circuit panel with SemiAnalysis brand colors.
33 * Blue accent bar on border. Gold nodes at intersections. Right 3/4 is content.
44 */
5+ import { readFile } from 'node:fs/promises' ;
6+ import { join } from 'node:path' ;
7+
58import { ImageResponse } from 'next/og' ;
69
710import type { BlogPostMeta } from '@/lib/blog' ;
@@ -14,8 +17,9 @@ const TEAL = '#3A7A7A';
1417const BG = '#131416' ;
1518const PANEL_BG = '#0F1214' ;
1619
17- export function renderOgImage ( meta : BlogPostMeta ) {
18- const titleSize = meta . title . length > 60 ? 40 : meta . title . length > 40 ? 48 : 56 ;
20+ export async function renderOgImage ( meta : BlogPostMeta ) {
21+ const logoSrc = `data:image/png;base64,${ ( await readFile ( join ( process . cwd ( ) , 'public/logo.png' ) ) ) . toString ( 'base64' ) } ` ;
22+ const titleSize = meta . title . length > 60 ? 48 : meta . title . length > 40 ? 56 : 64 ;
1923
2024 return new ImageResponse (
2125 < div
@@ -185,13 +189,8 @@ export function renderOgImage(meta: BlogPostMeta) {
185189 padding : '48px 55px' ,
186190 } }
187191 >
188- < div
189- style = { { display : 'flex' , alignItems : 'center' , gap : 10 , fontSize : 19 , color : '#B4B9BC' } }
190- >
191- < span style = { { color : BLUE , fontWeight : 700 } } > InferenceX</ span >
192- < span > Blog</ span >
193- < span style = { { color : `${ GOLD } 80` } } > —</ span >
194- < span > SemiAnalysis</ span >
192+ < div style = { { display : 'flex' , alignItems : 'center' , gap : 10 } } >
193+ < img src = { logoSrc } height = { 32 } />
195194 </ div >
196195
197196 < div style = { { display : 'flex' , flexDirection : 'column' , gap : 14 } } >
@@ -200,19 +199,19 @@ export function renderOgImage(meta: BlogPostMeta) {
200199 </ div >
201200 < div
202201 style = { {
203- fontSize : 21 ,
202+ fontSize : 28 ,
204203 color : '#C9CACB' ,
205204 lineHeight : 1.4 ,
206- maxHeight : 60 ,
205+ maxHeight : 80 ,
207206 overflow : 'hidden' ,
208207 } }
209208 >
210- { meta . excerpt . length > 130 ? meta . excerpt . slice ( 0 , 130 ) + '…' : meta . excerpt }
209+ { meta . excerpt . length > 110 ? meta . excerpt . slice ( 0 , 110 ) + '…' : meta . excerpt }
211210 </ div >
212211 </ div >
213212
214213 < div
215- style = { { display : 'flex' , gap : 20 , fontSize : 16 , color : '#B4B9BC' , alignItems : 'center' } }
214+ style = { { display : 'flex' , gap : 20 , fontSize : 24 , color : '#B4B9BC' , alignItems : 'center' } }
216215 >
217216 < span > { meta . author } </ span >
218217 < span style = { { color : `${ GOLD } 60` } } > ·</ span >
@@ -234,9 +233,9 @@ export function renderOgImage(meta: BlogPostMeta) {
234233 backgroundColor : `${ GOLD } 18` ,
235234 border : `1px solid ${ GOLD } 30` ,
236235 color : GOLD ,
237- padding : '3px 12px ' ,
236+ padding : '4px 14px ' ,
238237 borderRadius : 9999 ,
239- fontSize : 12 ,
238+ fontSize : 20 ,
240239 } }
241240 >
242241 { tag }
0 commit comments