This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,12 @@ const font = fetch(new URL('../../assets/Sora-Bold.ttf', import.meta.url)).then(
1616// Image generation
1717export async function GET ( req : NextRequest ) {
1818 const { searchParams } = req . nextUrl
19- // ?title=<title>
20- const hasTitle = searchParams . has ( 'title' )
21- const title = hasTitle
22- ? searchParams . get ( 'title' ) ?. slice ( 0 , 100 )
23- : 'Nitric Docs'
2419
25- const hasDescription = searchParams . has ( 'description' )
20+ const title = searchParams . get ( 'title' ) ?. slice ( 0 , 100 ) || 'Nitric Docs'
2621
27- const description = hasDescription
28- ? searchParams . get ( 'description' ) ?. slice ( 0 , 100 )
29- : 'Docs for the Nitric cloud application framework.'
22+ const description =
23+ searchParams . get ( 'description' ) ?. slice ( 0 , 100 ) ||
24+ 'Docs for the Nitric cloud application framework.'
3025
3126 return new ImageResponse (
3227 (
@@ -76,15 +71,15 @@ export async function GET(req: NextRequest) {
7671 textAlign : 'left' ,
7772 } }
7873 >
79- { title }
74+ { decodeURIComponent ( title ) }
8075 < div
8176 style = { {
8277 color : '#A1A1AA' ,
8378 fontSize : '28px' ,
8479 fontWeight : 500 ,
8580 } }
8681 >
87- { description }
82+ { decodeURIComponent ( description ) }
8883 </ div >
8984 </ div >
9085 < br />
You can’t perform that action at this time.
0 commit comments