diff --git a/src/pages/api/og.tsx b/src/pages/api/og.tsx index d72d0a6..55322be 100644 --- a/src/pages/api/og.tsx +++ b/src/pages/api/og.tsx @@ -42,6 +42,12 @@ export default async function handler(request: NextRequest) { const titleMaxLength = 66 + const isArticle = contentType === 'article' + const titleFontSize = isArticle && hasImage ? '54px' : '64px' + const subtitleFontSize = isArticle && hasImage ? '32px' : '36px' + const subtitleGap = isArticle && hasImage ? '16px' : '24px' + const subtitleMargin = isArticle && hasImage ? '24px' : '40px' + return new ImageResponse( contentType === LPE.PostTypes.Podcast ? ( -
- - - - - +
+ {isArticle ? ( + + + + + + ) : ( + + + + + + )} {contentType === 'article' && (
- {siteConfigs.title.replace('Logos', '')} + {siteConfigs.title.replace('Logos ', '')}
)}
-
+
-

+ {contentType ?? pagePath.replace(/^\/+/, '').replace(/\/+/, ' | ')} -

- {date &&

} - {date &&

{`${day} ${month} ${year}`}

} + + {date && } + {date && {`${day} ${month} ${year}`}}