From 717feb7f702c46e43a2c8210dd9d931e9b6dae0b Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Thu, 24 Sep 2026 16:07:17 -0400 Subject: [PATCH] build(config): switch to local Fontsource fonts for offline Blume builds --- apps/docs/blume.config.ts | 22 ++++++++++++++++++++++ apps/docs/package.json | 4 ++++ bun.lock | 8 ++++++++ 3 files changed, 34 insertions(+) diff --git a/apps/docs/blume.config.ts b/apps/docs/blume.config.ts index c4aa654..422da35 100644 --- a/apps/docs/blume.config.ts +++ b/apps/docs/blume.config.ts @@ -1,5 +1,24 @@ import { defineConfig } from "blume"; +// Blume's defaults (`inter`, `ibm-plex-mono`) are fetched from fonts.gstatic.com +// on every build, which has timed out on the Pages runner and, fully offline, +// silently ships no fonts at all. The same two families from Fontsource, as +// local files, keep the build network-free. Blume resolves `src` from this +// directory; the workspace links these packages under ./node_modules. +const inter = { + name: "Inter", + variants: [ + { src: "./node_modules/@fontsource-variable/inter/files/inter-latin-wght-normal.woff2", weight: "100..900" }, + ], +}; +const plexMono = { + name: "IBM Plex Mono", + variants: [ + { src: "./node_modules/@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-400-normal.woff2", weight: 400 }, + { src: "./node_modules/@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-500-normal.woff2", weight: 500 }, + ], +}; + export default defineConfig({ title: "Leetcode", description: "Documentation for LeetCode solutions", @@ -11,6 +30,9 @@ export default defineConfig({ content: { root: "content", }, + theme: { + fonts: { display: inter, body: inter, mono: plexMono }, + }, navigation: { sidebar: { display: "flat", // "flat" | "group" | "page" diff --git a/apps/docs/package.json b/apps/docs/package.json index 0ab8247..5096d43 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -11,5 +11,9 @@ "blume": "^2.0.1", "react": "^19.2.8", "react-dom": "^19.2.8" + }, + "devDependencies": { + "@fontsource-variable/inter": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0" } } diff --git a/bun.lock b/bun.lock index ad8c098..89d48a3 100644 --- a/bun.lock +++ b/bun.lock @@ -33,6 +33,10 @@ "react": "^19.2.8", "react-dom": "^19.2.8", }, + "devDependencies": { + "@fontsource-variable/inter": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", + }, }, "apps/videos": { "name": "videos", @@ -296,6 +300,10 @@ "@eslint/plugin-kit": ["@eslint/plugin-kit@0.2.8", "", { "dependencies": { "@eslint/core": "^0.13.0", "levn": "^0.4.1" } }, "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA=="], + "@fontsource-variable/inter": ["@fontsource-variable/inter@5.3.0", "", {}, "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA=="], + + "@fontsource/ibm-plex-mono": ["@fontsource/ibm-plex-mono@5.3.0", "", {}, "sha512-eTgnZjZEGk1QtD3ZstF+Vclo2HLAni8YMy34/DxllwZvyz1lR/1RF/xTiAquOBO7MvqBx8D2Ig2WCPMVfdZu7Q=="], + "@hono/node-server": ["@hono/node-server@2.1.1", "", { "peerDependencies": { "hono": "^4" } }, "sha512-ELuehkj5VCBdgEw9zs+ivkKwyzzUCSQuE96YmiPvn1ECBoZCczbFXJLeEGMTYjphP6gydh4pHMqEYPVMYUVgQg=="], "@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="],