From a2fd9a5483afac9ea7cec2ccd746454d525daba1 Mon Sep 17 00:00:00 2001 From: Alexey S Date: Sun, 19 Apr 2026 23:26:40 +0300 Subject: [PATCH] Fix CSS/JS paths to relative for static file serving Absolute paths (/css/site.css) break when opening _site/ directly via file://. Relative paths work with both the dev server and static hosting. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 2 +- src/_includes/layouts/base.njk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 818ebbc..b07a785 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ The `ui-kit` page uses `layout: ui-kit` and `css: ui-kit` (links `ui-kit.css` in ### CSS paths -All CSS paths in `base.njk` are **absolute** (`/css/site.css`), which requires the 11ty dev server — they will not work when opening `_site/` files directly in a browser via `file://`. +All CSS and JS paths in `base.njk` are **relative** (`css/site.css`, `js/inspector.js`). This works both with the 11ty dev server and when opening `_site/` files directly via `file://`. ### Design tokens diff --git a/src/_includes/layouts/base.njk b/src/_includes/layouts/base.njk index 5c07625..5d060cc 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -7,10 +7,10 @@ - + {{ content | safe }} - +