Skip to content

Commit 0718502

Browse files
committed
fix: load VTCDuBois fonts directly from Vercel Blob
In SSR/dynamic rendering mode, the Node.js server handles all requests before Vercel's rewrite layer fires. Since VTCDuBois font files are gitignored and not in the deployment, the server returns 404 before the rewrite to Blob can kick in. Fix by pointing @font-face src and preload links directly to the Blob URL. Remove the now-unnecessary vercel.json rewrite. Split from #447.
1 parent 39d246a commit 0718502

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/pages/_layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,14 @@ export default function Layout(props: React.PropsWithChildren) {
447447
)}
448448
<link
449449
rel="preload"
450-
href="/fonts/VTCDuBois-Regular.woff2"
450+
href="https://wgfdjv2jfqz2dlpx.public.blob.vercel-storage.com/fonts/VTCDuBois-Regular.woff2"
451451
as="font"
452452
type="font/woff2"
453453
crossOrigin="anonymous"
454454
/>
455455
<link
456456
rel="preload"
457-
href="/fonts/VTCDuBois-Bold.woff2"
457+
href="https://wgfdjv2jfqz2dlpx.public.blob.vercel-storage.com/fonts/VTCDuBois-Bold.woff2"
458458
as="font"
459459
type="font/woff2"
460460
crossOrigin="anonymous"

src/pages/_root.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@
3131

3232
@font-face {
3333
font-family: "VTC Du Bois";
34-
src: url("/fonts/VTCDuBois-Regular.woff2") format("woff2");
34+
src: url("https://wgfdjv2jfqz2dlpx.public.blob.vercel-storage.com/fonts/VTCDuBois-Regular.woff2")
35+
format("woff2");
3536
font-weight: 400;
3637
font-style: normal;
3738
font-display: swap;
3839
}
3940

4041
@font-face {
4142
font-family: "VTC Du Bois";
42-
src: url("/fonts/VTCDuBois-Bold.woff2") format("woff2");
43+
src: url("https://wgfdjv2jfqz2dlpx.public.blob.vercel-storage.com/fonts/VTCDuBois-Bold.woff2")
44+
format("woff2");
4345
font-weight: 700;
4446
font-style: normal;
4547
font-display: swap;

vercel.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,5 @@
66
"destination": "https://mpp.dev/:path",
77
"permanent": true
88
}
9-
],
10-
"rewrites": [
11-
{
12-
"source": "/fonts/VTCDuBois-:path*",
13-
"destination": "https://wgfdjv2jfqz2dlpx.public.blob.vercel-storage.com/fonts/VTCDuBois-:path*"
14-
}
159
]
1610
}

0 commit comments

Comments
 (0)