From 9f6f5e98954d70ed6288aa0fd451e199c751b4da Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Wed, 30 Aug 2023 22:09:29 +0900 Subject: [PATCH 1/3] style: adjust og image padding --- src/pages/api/og.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/api/og.tsx b/src/pages/api/og.tsx index 471635d..283f894 100644 --- a/src/pages/api/og.tsx +++ b/src/pages/api/og.tsx @@ -69,7 +69,7 @@ export default async function handler(request: NextRequest) { display: 'flex', flexDirection: 'column', width: hasImage ? '600px' : '100%', - padding: hasImage ? '48px 40px' : '80px', + padding: '56px 48px', justifyContent: 'space-between', height: '100%', position: 'relative', From fe362ddec7439017a841d203ff0693d9121a4115 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Wed, 30 Aug 2023 22:18:38 +0900 Subject: [PATCH 2/3] refactor: update og image path --- src/pages/api/og.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/og.tsx b/src/pages/api/og.tsx index 283f894..7074282 100644 --- a/src/pages/api/og.tsx +++ b/src/pages/api/og.tsx @@ -26,7 +26,7 @@ export default async function handler(request: NextRequest) { contentType == null ? 'LOGOS→PRESS ENGINE' : searchParams.get('title') const image = searchParams.get('image') || '' const alt = searchParams.get('alt') || '' - const pagePath = searchParams.get('pagePath') || '/' + const pagePath = searchParams.get('pagePath') || 'press.logos.co' const date = searchParams.get('date') const imgSrc = image @@ -122,7 +122,7 @@ export default async function handler(request: NextRequest) { fontFamily: 'Inter', }} > -

{contentType ?? pagePath}

+

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

{date &&

} {date &&

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

} From 1a1b6039b019b97b0b4185be9e8dc6c8f021cc34 Mon Sep 17 00:00:00 2001 From: amirhouieh Date: Wed, 30 Aug 2023 17:58:29 +0200 Subject: [PATCH 3/3] fix some design details --- src/pages/api/og.tsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/pages/api/og.tsx b/src/pages/api/og.tsx index 7074282..7d31ba5 100644 --- a/src/pages/api/og.tsx +++ b/src/pages/api/og.tsx @@ -2,6 +2,7 @@ import { LPE } from '@/types/lpe.types' import { ImageResponse } from '@vercel/og' import { handleMethodNotAllowedResponse } from 'next/dist/server/future/route-modules/helpers/response-handlers' import { NextRequest } from 'next/server' +import { siteConfigs } from '@/configs/site.configs' export const config = { runtime: 'edge', @@ -69,7 +70,7 @@ export default async function handler(request: NextRequest) { display: 'flex', flexDirection: 'column', width: hasImage ? '600px' : '100%', - padding: '56px 48px', + padding: '48px', justifyContent: 'space-between', height: '100%', position: 'relative', @@ -97,6 +98,20 @@ export default async function handler(request: NextRequest) { fill="white" /> + {contentType === 'article' && ( +
+ {siteConfigs.title.replace('Logos', '')} +
+ )}
-

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

+

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

{date &&

} {date &&

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

}