From 9e0ad31ec8232af89d39980c90e4aa17c112e761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20von=20E=C3=9Fen?= Date: Fri, 6 Mar 2026 16:27:23 +0100 Subject: [PATCH] fix: skip null colors in repoColors when generating repo-cards CSS Languages with null entries in repoColors.json caused Go's fmt.Sprintf to emit '%!s()' as the color value, producing invalid CSS and browser parse errors. Add a nil guard to skip those entries, letting them fall back to the default dot color. Fixes #2824 --- layouts/partials/vendor.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/partials/vendor.html b/layouts/partials/vendor.html index d2beff6f..ba685c10 100644 --- a/layouts/partials/vendor.html +++ b/layouts/partials/vendor.html @@ -134,7 +134,9 @@ {{ $cssRules = $cssRules | append ".language-dot[data-language=\"model\"] { background-color: #ff6b35; }" }} {{ range $lang, $color := $repoColors }} - {{ $cssRules = $cssRules | append (printf ".language-dot[data-language=\"%s\"] { background-color: %s; }" $lang $color) }} + {{ if $color }} + {{ $cssRules = $cssRules | append (printf ".language-dot[data-language=\"%s\"] { background-color: %s; }" $lang $color) }} + {{ end }} {{ end }} {{ $repoCardCSS := resources.FromString "css/repo-cards.css" (delimit $cssRules "\n") | minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512")