From 2ff6b0e8bd1ff8e3f7b5a3d1e3d3598eaacc4937 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Sun, 13 Jul 2025 20:55:38 +0800 Subject: [PATCH] fix: repo card language color is missed --- layouts/partials/head.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a1db6860..08f93a41 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -54,6 +54,15 @@ {{ $cssZoom := resources.Get "lib/zoom/style.css" }} {{ $assets.Add "css" (slice $cssZoom) }} {{ end }} + {{ $repoLanguages := partial "functions/repo-languages.html" }} + {{ $repoColors := .Site.Data.repoColors }} + {{ range $repoLanguages }} + {{ $color := index $repoColors . | default "#0077b6" }} + {{ $className := printf "background-color-%s" (md5 .) }} + {{ $cssRepoColor := printf ".%s { background-color: %s; }" $className $color }} + {{ $cssRepoColor = $cssRepoColor | resources.FromString (printf "css/background-color.css") }} + {{ $assets.Add "css" (slice $cssRepoColor) }} + {{ end }} {{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}