mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
build(config): switch to local Fontsource fonts for offline Blume builds
This commit is contained in:
1 parent
bf0ac34a43
commit
717feb7f70
3 files changed
+34
No files matched your search
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user