From 97683799c6f76f1f3f049f9c4460c71d6077f0ca Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Sun, 10 May 2026 17:21:06 +0200 Subject: [PATCH] perf: inline CSS into to remove render-blocking request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The external was the only render-blocking resource on every page (~110 ms per Lighthouse on GitHub Pages). Inlining it into a . Font preloads stay; favicon stays. The full CSS is also still copied to public/assets/style.css for any direct consumer (PDF builds, hot-linking). Local Lighthouse desktop preset, post-change: - index.html 100 / 100 / 100 / 100, render-blocking savings 0 ms - cv-executive.de 100 / 100 / 100 / 100, render-blocking savings 0 ms - cv-technical.de 100 / 100 / 100 / 100, render-blocking savings 0 ms Cache-TTL insight stays unaddressed: GitHub Pages hard-codes Cache-Control: max-age=600 and we have no header override available. Forced-reflow [unattributed] insight is not from us — pages ship zero JavaScript. Signed-off-by: Sebastian Mendel --- scripts/build.py | 37 +++++++++++++++++++++++++++++++++---- templates/base.html.j2 | 5 ++++- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/scripts/build.py b/scripts/build.py index 63d7ad8..d88e529 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -98,6 +98,21 @@ def render_md(body: str) -> str: return md.convert(body) +def load_inline_css() -> str: + """Load assets/style.css and rewrite font URLs for inlining into HTML. + + The source CSS sits at assets/style.css and references fonts as + `url("fonts/...")` (relative to the CSS). When the same CSS is inlined + into a `