♻️ Refactor: Use universal json and move styles out of line

This commit is contained in:
Served Smart
2025-06-22 04:08:11 +02:00
parent 8d940881a4
commit cc2e90233a
9 changed files with 44 additions and 1627 deletions

View File

@@ -1,7 +1,6 @@
{{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }}
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}}
{{- $githubColors := .Site.Data.githubColors -}}
{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
{{- $showThumbnail := .Get "showThumbnail" | default true -}}
@@ -38,13 +37,12 @@
</p>
<div class="m-0 mt-2 flex items-center">
{{ $className := "color-repo-fallback" }}
{{ if .language }}
{{ $className = printf "color-repo-%s" (md5 .language) }}
{{ end }}
<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 {{ $className }}"></span>
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
</div>