The weeb for the next gen discord boat - Wamellow wamellow.com
bot discord
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf: preload fonts in og images

Luna 084b5a3b e218d4da

+11 -4
+11 -4
app/leaderboard/[guildId]/open-graph.png/route.tsx
··· 18 18 19 19 export const revalidate = 3_600; // 1 hour 20 20 21 + const fonts = { 22 + regular: await readFile(new URL("../../../../assets/Poppins-Regular.ttf", import.meta.url)), 23 + medium: await readFile(new URL("../../../../assets/Poppins-Medium.ttf", import.meta.url)), 24 + semiBold: await readFile(new URL("../../../../assets/Poppins-SemiBold.ttf", import.meta.url)), 25 + extraBold: await readFile(new URL("../../../../assets/Poppins-ExtraBold.ttf", import.meta.url)) 26 + }; 27 + 21 28 export async function GET(request: NextRequest, { params }: Props) { 22 29 const { guildId } = await params; 23 30 ··· 92 99 fonts: [ 93 100 { 94 101 name: "Poppins", 95 - data: await readFile(process.cwd() + "/assets/Poppins-Regular.ttf"), 102 + data: fonts.regular, 96 103 style: "normal", 97 104 weight: 400 98 105 }, 99 106 { 100 107 name: "Poppins", 101 - data: await readFile(process.cwd() + "/assets/Poppins-Medium.ttf"), 108 + data: fonts.medium, 102 109 style: "normal", 103 110 weight: 500 104 111 }, 105 112 { 106 113 name: "Poppins", 107 - data: await readFile(process.cwd() + "/assets/Poppins-SemiBold.ttf"), 114 + data: fonts.semiBold, 108 115 style: "normal", 109 116 weight: 600 110 117 }, 111 118 { 112 119 name: "Poppins", 113 - data: await readFile(process.cwd() + "/assets/Poppins-ExtraBold.ttf"), 120 + data: fonts.extraBold, 114 121 style: "normal", 115 122 weight: 800 116 123 }