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(
16
16
// Image generation
17
17
export async function GET ( req : NextRequest ) {
18
18
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'
24
19
25
- const hasDescription = searchParams . has ( 'description' )
20
+ const title = searchParams . get ( 'title' ) ?. slice ( 0 , 100 ) || 'Nitric Docs'
26
21
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.'
30
25
31
26
return new ImageResponse (
32
27
(
@@ -76,15 +71,15 @@ export async function GET(req: NextRequest) {
76
71
textAlign : 'left' ,
77
72
} }
78
73
>
79
- { title }
74
+ { decodeURIComponent ( title ) }
80
75
< div
81
76
style = { {
82
77
color : '#A1A1AA' ,
83
78
fontSize : '28px' ,
84
79
fontWeight : 500 ,
85
80
} }
86
81
>
87
- { description }
82
+ { decodeURIComponent ( description ) }
88
83
</ div >
89
84
</ div >
90
85
< br />
You can’t perform that action at this time.
0 commit comments