{{ $id := delimit (slice "gitea" (partial "functions/uid.html" .)) "-" }} {{- $giteaURL := print (.Get "server" | default .Site.Params.giteaDefaultServer) "/api/v1/repos/" (.Get "repo") -}} {{- $repoColors := .Site.Data.repoColors -}} {{- $giteaData := dict -}} {{- with try (resources.GetRemote $giteaURL) -}} {{- with .Err -}} {{- warnf "gitea shortcode: failed to fetch remote resource from %q: %s" $giteaURL $.Position -}} {{- else with .Value -}} {{- $giteaData = . | transform.Unmarshal -}} {{- else -}} {{- warnf "gitea shortcode: unable to get remote resource from %q: %s" $giteaURL $.Position -}} {{- end -}} {{- end -}} {{- with $giteaData -}}
{{ partial "icon.html" "gitea" }}
{{ .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 "gitea shortcode: unable to fetch %q: %s" $giteaURL .Position }} {{- end -}}