File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 11import { ImageResponse } from '@vercel/og'
22
3- import { ogImageSchema } from '@/lib/validations/og'
43import siteMetadata from '@/data/siteMetadata'
54
65export 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 (
You can’t perform that action at this time.
0 commit comments