File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
packages/gitbook/src/routes Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,14 @@ export async function serveIcon(context: GitBookSiteContext, req: Request) {
30
30
const options = getOptions ( req . url ) ;
31
31
const size = SIZES [ options . size ] ;
32
32
33
-
34
-
35
33
const { site, customization } = context ;
36
34
const customIcon = 'icon' in customization . favicon ? customization . favicon . icon : null ;
37
35
38
- console . log ( 'icon: serveIcon' , req . url , customIcon ? 'custom' : 'emoji' in customization . favicon ? 'emoji' : 'fallback' ) ;
36
+ console . log (
37
+ 'icon: serveIcon' ,
38
+ req . url ,
39
+ customIcon ? 'custom' : 'emoji' in customization . favicon ? 'emoji' : 'fallback'
40
+ ) ;
39
41
// If the site has a custom icon, redirect to it
40
42
if ( customIcon ) {
41
43
const iconUrl = options . theme === 'light' ? customIcon . light : customIcon . dark ;
@@ -50,8 +52,8 @@ export async function serveIcon(context: GitBookSiteContext, req: Request) {
50
52
const contentTitle = site . title ;
51
53
52
54
// Load the font locally to prevent the shared instance used by ImageResponse.
53
- const font = await fetch ( new URL ( '../fonts/Inter/Inter-Regular.ttf' , import . meta. url ) ) . then ( ( res ) =>
54
- res . arrayBuffer ( )
55
+ const font = await fetch ( new URL ( '../fonts/Inter/Inter-Regular.ttf' , import . meta. url ) ) . then (
56
+ ( res ) => res . arrayBuffer ( )
55
57
) ;
56
58
57
59
return new ImageResponse (
@@ -88,8 +90,8 @@ export async function serveIcon(context: GitBookSiteContext, req: Request) {
88
90
name : 'Inter' ,
89
91
weight : 400 ,
90
92
style : 'normal' ,
91
- }
92
- ]
93
+ } ,
94
+ ] ,
93
95
}
94
96
) ;
95
97
}
You can’t perform that action at this time.
0 commit comments