feat(repo-card): fix inline style CSP issue

This commit is contained in:
ZhenShuo Leo
2025-09-07 06:46:55 +08:00
parent 9cc808ea93
commit 2ff90348e7
5 changed files with 34 additions and 39 deletions

View File

@@ -53,13 +53,12 @@
<div class="m-0 mt-2 flex items-center">
<span
class="mr-1 inline-block h-3 w-3 rounded-full"
style="background-color: {{ if eq $type "model" }}
#ff6b35
{{ else }}
#0077b6
{{ end }}"></span>
{{ $languageDotColor := cond (eq $type "model") "#ff6b35" "#0077b6" }}
{{ $css := resources.FromString (printf "css/%s.css" $id) (printf ".language-dot-%s{background-color:%s}" $id $languageDotColor)
| minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512")
}}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
<span class="mr-1 inline-block h-3 w-3 rounded-full language-dot-{{ $id }}"></span>
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ if eq $type "model" }}
{{ if .pipeline_tag }}{{ .pipeline_tag }}{{ else }}model{{ end }}