File tree Expand file tree Collapse file tree 9 files changed +45
-1627
lines changed
Expand file tree Collapse file tree 9 files changed +45
-1627
lines changed File renamed without changes.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4545 {{ if $cssCustom }}
4646 {{ $assets.Add "css" (slice $cssCustom) }}
4747 {{ end }}
48+
49+ {{ $repoShortcodeExists := false }}
50+ {{ range .Site.Pages }}
51+ {{ if or (.Page.HasShortcode "codeberg") (.Page.HasShortcode "forgejo") (.Page.HasShortcode "gitea") (.Page.HasShortcode "github") }}
52+ {{ $repoShortcodeExists = true }}
53+ {{ end }}
54+ {{ end }}
55+ {{ if $repoShortcodeExists }}
56+ {{ $colorsRepos := .Site.Data.colorsRepos }}
57+ {{ range $language, $color := $colorsRepos }}
58+ {{ if not $color }}
59+ {{ $color = "" }}
60+ {{ end }}
61+ {{ $className := printf "color-repo-%s" (md5 $language) }}
62+ {{ $cssColorRepos := printf ".%s { background-color: %s; }" $className $color }}
63+ {{ $cssColorRepos = $cssColorRepos | resources.FromString "css/color-repo.css" }}
64+ {{ $assets.Add "css" (slice $cssColorRepos) }}
65+ {{ end }}
66+ {{ $color := "#0077b6" }}
67+ {{ $className := "color-repo-fallback" }}
68+ {{ $cssColorRepos := printf ".%s { background-color: %s; }" $className $color }}
69+ {{ $cssColorRepos = $cssColorRepos | resources.FromString "css/color-repo.css" }}
70+ {{ $assets.Add "css" (slice $cssColorRepos) }}
71+ {{ end }}
72+
4873 {{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint
4974 (.Site.Params.fingerprintAlgorithm | default "sha512") }}
5075 < link type ="text/css " rel ="stylesheet " href ="{{ $bundleCSS.RelPermalink }} "
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+ {{ $className := "color-repo-fallback" }}
26+ {{ if .language }}
27+ {{ $className = printf "color-repo-%s" (md5 .language) }}
28+ {{ end }}
2629 < 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 >
30+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
3331 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
3432 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
3533 </ 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+ {{ $className := "color-repo-fallback" }}
26+ {{ if .language }}
27+ {{ $className = printf "color-repo-%s" (md5 .language) }}
28+ {{ end }}
2629 < 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 >
30+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
3331 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
3432 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
3533 </ 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+ {{ $className := "color-repo-fallback" }}
26+ {{ if .language }}
27+ {{ $className = printf "color-repo-%s" (md5 .language) }}
28+ {{ end }}
2629 < 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 >
30+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
3331 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
3432 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
3533 </ 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+ {{ $className := "color-repo-fallback" }}
41+ {{ if .language }}
42+ {{ $className = printf "color-repo-%s" (md5 .language) }}
43+ {{ end }}
4144 < 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 >
45+ class ="mr-1 inline-block h-3 w-3 rounded-full {{ $className }} "> </ span >
4846 < div class ="m-0 mr-5 text-md text-neutral-800 dark:text-neutral ">
4947 {{ if .language }}{{ .language }}{{ else }}null{{ end }}
5048 </ div >
You can’t perform that action at this time.
0 commit comments