Skip to content

Commit ac8fa7d

Browse files
less size
1 parent 0e71e4a commit ac8fa7d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/api/og/route.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ImageResponse } from '@vercel/og'
22

3-
import { ogImageSchema } from '@/lib/validations/og'
43
import siteMetadata from '@/data/siteMetadata'
54

65
export const runtime = 'edge'
@@ -24,7 +23,7 @@ export async function GET(req: Request) {
2423
// const fontBold = await interBold
2524

2625
const url = new URL(req.url)
27-
const values = ogImageSchema.parse(Object.fromEntries(url.searchParams))
26+
const values = Object.fromEntries(url.searchParams)
2827
const heading =
2928
values.heading.length > 140 ? `${values.heading.substring(0, 140)}...` : values.heading
3029

@@ -33,10 +32,10 @@ export async function GET(req: Request) {
3332

3433
// Dynamic font size calculation
3534
const getFontSize = (length: number) => {
36-
if (length < 40) return 'text-[100px]'
37-
if (length < 80) return 'text-[80px]'
38-
if (length < 120) return 'text-[60px]'
39-
return 'text-[50px]'
35+
if (length < 40) return 'text-[90px]'
36+
if (length < 80) return 'text-[70px]'
37+
if (length < 120) return 'text-[50px]'
38+
return 'text-[40px]'
4039
}
4140

4241
return new ImageResponse(

0 commit comments

Comments
 (0)