From 93bc04b334b504e3fa6e0f9c71b10d54c68929f2 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Tue, 26 May 2026 23:19:04 +0200 Subject: [PATCH] fix(docs): fix font 404 on GitHub Pages (../../fonts/ path in custom.css) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hextra's production build bundles assets/css/custom.css into css/compiled/main.css. The original '../fonts/' relative path resolved correctly from css/custom.css (dev) but landed at css/fonts/ in production — one directory too deep. Fix: use '../../fonts/' so the URL resolves correctly from every output location browsers may encounter: dev: /css/custom.css → ../../fonts/ → /fonts/ production: /css/compiled/main.css → ../../fonts/ → /fonts/ GH Pages: /Bose-SoundTouch/css/compiled/main.css → ../../fonts/ → /Bose-SoundTouch/fonts/ Browsers clamp traversal at the origin root, so going two levels up from /css/custom.css still reaches /fonts/ — safe in dev, correct in production. Co-Authored-By: Claude Sonnet 4.6 --- docs/assets/css/custom.css | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css index d06b7cc..c51b7c6 100644 --- a/docs/assets/css/custom.css +++ b/docs/assets/css/custom.css @@ -1,9 +1,16 @@ +/* Font paths use ../../fonts/ (two levels up) so the URL resolves correctly + regardless of where the CSS is served from: + - dev: /css/custom.css → ../../fonts/ → /fonts/ + - production: /css/compiled/main.css → ../../fonts/ → /fonts/ + - GH Pages: /Bose-SoundTouch/css/compiled/main.css + → ../../fonts/ → /Bose-SoundTouch/fonts/ */ + @font-face { font-family: 'Noto Sans'; font-style: normal; font-weight: 400; font-display: swap; - src: url('../fonts/noto-sans-v42-latin-regular.woff2') format('woff2'); + src: url('../../fonts/noto-sans-v42-latin-regular.woff2') format('woff2'); } @font-face { @@ -11,7 +18,7 @@ font-style: italic; font-weight: 400; font-display: swap; - src: url('../fonts/noto-sans-v42-latin-italic.woff2') format('woff2'); + src: url('../../fonts/noto-sans-v42-latin-italic.woff2') format('woff2'); } @font-face { @@ -19,7 +26,7 @@ font-style: normal; font-weight: 700; font-display: swap; - src: url('../fonts/noto-sans-v42-latin-700.woff2') format('woff2'); + src: url('../../fonts/noto-sans-v42-latin-700.woff2') format('woff2'); } @font-face { @@ -27,7 +34,7 @@ font-style: italic; font-weight: 700; font-display: swap; - src: url('../fonts/noto-sans-v42-latin-700italic.woff2') format('woff2'); + src: url('../../fonts/noto-sans-v42-latin-700italic.woff2') format('woff2'); } :root {