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

{{ .description | markdownify }}

{{ 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 "forgejo shortcode: unable to fetch %q: %s" $forgejoURL .Position }} {{- end -}}