{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }} {{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}} {{- $repoColors := .Site.Data.repoColors -}} {{- $codebergData := dict -}} {{- with try (resources.GetRemote $codebergURL) -}} {{- with .Err -}} {{- warnf "codeberg shortcode: failed to fetch remote resource from %q: %s" $codebergURL $.Position -}} {{- else with .Value -}} {{- $codebergData = . | transform.Unmarshal -}} {{- else -}} {{- warnf "codeberg shortcode: unable to get remote resource from %q: %s" $codebergURL $.Position -}} {{- end -}} {{- end -}} {{- with $codebergData -}}
{{ partial "icon.html" "codeberg" }}
{{ .full_name | markdownify }}

{{ .description | markdownify }}

{{ $language := cond .language .language "default" }} {{ $currentLangs := $.Page.Store.Get "repoCardLanguages" | default slice }} {{ $.Page.Store.Set "repoCardLanguages" ($currentLangs | append $language) }}
{{ if .language }}{{ .language }}{{ else }}null{{ end }}
{{ partial "icon.html" "star" }}
{{ .stars_count }}
{{ partial "icon.html" "fork" }}
{{ .forks_count }}
{{ $fetchRepo := resources.Get "js/fetch-repo.js" }} {{ $fetchRepo = $fetchRepo | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
{{- else -}} {{ warnf "codeberg shortcode: unable to fetch %q: %s" $codebergURL .Position }} {{- end -}}