Merge pull request #2466 from ZhenShuo2021/feat/repo-card-csp

 Feat(repo-card): remove inline style
This commit is contained in:
Nuno C.
2025-09-15 23:08:42 +01:00
committed by GitHub
6 changed files with 66 additions and 34 deletions

View File

@@ -2,7 +2,7 @@
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
{{- $showThumbnail := .Get "showThumbnail" | default true -}}
{{- $githubColors := .Site.Data.repoColors -}}
{{- $repoColors := .Site.Data.repoColors -}}
{{- $githubData := dict -}}
{{- with try (resources.GetRemote $githubURL) -}}
{{- with .Err -}}
@@ -46,13 +46,12 @@
</p>
<div class="m-0 mt-2 flex items-center">
{{ $language := cond .language .language "default" }}
{{ $currentLangs := $.Page.Store.Get "repoCardLanguages" | default slice }}
{{ $.Page.Store.Set "repoCardLanguages" ($currentLangs | append $language) }}
<span
class="mr-1 inline-block h-3 w-3 rounded-full"
style="background-color: {{ if .language }}
{{- index $githubColors .language -}}
{{ else }}
#0077b6
{{ end }}"></span>
class="mr-1 inline-block h-3 w-3 rounded-full language-dot"
data-language="{{ $language }}"></span>
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
</div>