File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ {{ $repoColors := site.Data.repoColors }}
2+ {{ $classNameMap := dict }}
3+ {{ range $language, $unused := $repoColors }}
4+ {{ $className := printf "background-color-%s" (md5 $language) }}
5+ {{ $classNameMap = merge $classNameMap (dict $className $language) }}
6+ {{ end }}
7+
8+ {{ $repoLanguages := slice }}
9+ {{ range site.Pages }}
10+ {{ $matchedClasses := findRE `background-color-[a-f0-9]{32}` .Content }}
11+ {{ range $matchedClasses }}
12+ {{ with index $classNameMap . }}
13+ {{ $repoLanguages = $repoLanguages | append . }}
14+ {{ else }}
15+ {{ $repoLanguages = $repoLanguages | append "fallback" }}
16+ {{ end }}
17+ {{ end }}
18+ {{ end }}
19+
20+ {{ return (uniq $repoLanguages) }}
Original file line number Diff line number Diff line change 8585 {{ end }}
8686 {{ end }}
8787
88+ {{ $repoLanguages := partial "functions/repo-languages.html" }}
89+ {{ $repoColors := .Site.Data.repoColors }}
90+ {{ range $repoLanguages }}
91+ {{ $color := index $repoColors . | default "#0077b6" }}
92+ {{ $className := printf "background-color-%s" (md5 .) }}
93+ {{ $cssRepoColor := printf ".%s { background-color: %s; }" $className $color }}
94+ {{ $cssRepoColor = $cssRepoColor | resources.FromString (printf "css/background-color.css") }}
95+ {{ $assets.Add "css" (slice $cssRepoColor) }}
96+ {{ end }}
97+
8898 {{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint
8999 (.Site.Params.fingerprintAlgorithm | default "sha512")
90100 }}
Original file line number Diff line number Diff line change 11{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }}
22{{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}}
33{{- $codebergData := resources.GetRemote $codebergURL | transform.Unmarshal -}}
4- {{- $codebergColors := .Site.Data.codebergColors -}}
54{{- with $codebergData -}}
65 < div class ="codeberg-card-wrapper ">
76 < a id ="{{ $id }} " target ="_blank " href ="{{ .html_url }} " class ="cursor-pointer ">
2322 </ p >
2423
2524 < div class ="m-0 mt-2 flex items-center ">
25+ {{ $language := .language | default "fallback" }}
26+ {{ $className := printf "background-color-%s" (md5 $language) }}
2627 < span
27- class ="mr-1 inline-block h-3 w-3 rounded-full "
28- style ="background-color: {{ if .language }}
29- {{- index $codebergColors .language -}}
30- {{ else }}
31- #0077b6
32- {{ end }} "> </ span >
28+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
3329 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
3430 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
3531 </ div >
Original file line number Diff line number Diff line change 11{{ $id := delimit (slice "forgejo" (partial "functions/uid.html" .)) "-" }}
22{{- $forgejoURL := print (.Get "server" | default .Site.Params.forgejoDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
33{{- $forgejoData := resources.GetRemote $forgejoURL | transform.Unmarshal -}}
4- {{- $forgejoColors := .Site.Data.forgejoColors -}}
54{{- with $forgejoData -}}
65 < div class ="forgejo-card-wrapper ">
76 < a id ="{{ $id }} " target ="_blank " href ="{{ .html_url }} " class ="cursor-pointer ">
2322 </ p >
2423
2524 < div class ="m-0 mt-2 flex items-center ">
25+ {{ $language := .language | default "fallback" }}
26+ {{ $className := printf "background-color-%s" (md5 $language) }}
2627 < span
27- class ="mr-1 inline-block h-3 w-3 rounded-full "
28- style ="background-color: {{ if .language }}
29- {{- index $forgejoColors .language -}}
30- {{ else }}
31- #0077b6
32- {{ end }} "> </ span >
28+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
3329 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
3430 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
3531 </ div >
Original file line number Diff line number Diff line change 11{{ $id := delimit (slice "gitea" (partial "functions/uid.html" .)) "-" }}
22{{- $giteaURL := print (.Get "server" | default .Site.Params.giteaDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
33{{- $giteaData := resources.GetRemote $giteaURL | transform.Unmarshal -}}
4- {{- $giteaColors := .Site.Data.giteaColors -}}
54{{- with $giteaData -}}
65 < div class ="gitea-card-wrapper ">
76 < a id ="{{ $id }} " target ="_blank " href ="{{ .html_url }} " class ="cursor-pointer ">
2322 </ p >
2423
2524 < div class ="m-0 mt-2 flex items-center ">
25+ {{ $language := .language | default "fallback" }}
26+ {{ $className := printf "background-color-%s" (md5 $language) }}
2627 < span
27- class ="mr-1 inline-block h-3 w-3 rounded-full "
28- style ="background-color: {{ if .language }}
29- {{- index $giteaColors .language -}}
30- {{ else }}
31- #0077b6
32- {{ end }} "> </ span >
28+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
3329 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
3430 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
3531 </ div >
Original file line number Diff line number Diff line change 11{{ $id := delimit (slice "github" (partial "functions/uid.html" .)) "-" }}
22{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
33{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}}
4- {{- $githubColors := .Site.Data.githubColors -}}
54{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
65{{- $showThumbnail := .Get "showThumbnail" | default true -}}
76
3837 </ p >
3938
4039 < div class ="m-0 mt-2 flex items-center ">
40+ {{ $language := .language | default "fallback" }}
41+ {{ $className := printf "background-color-%s" (md5 $language) }}
4142 < span
42- class ="mr-1 inline-block h-3 w-3 rounded-full "
43- style ="background-color: {{ if .language }}
44- {{- index $githubColors .language -}}
45- {{ else }}
46- #0077b6
47- {{ end }} "> </ span >
43+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
4844 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
4945 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
5046 </ div >
7672 data-repo-id ="{{ $id }} "> </ script >
7773 </ a >
7874 {{- end -}}
79-
8075</ div >
You can’t perform that action at this time.
0 commit comments