{{- /* GitLab repository. @param {string} (positional parameter 0) Repository name on GitLab. @returns {template.HTML} @examples {{< gl-repo "278964" >}} */ -}} {{- if (.Get 0) -}} {{ $projects := (split (.Get 0) "|") }} {{ $api := (site.Params.api) }} {{ $ts := (now.Unix) }} {{ $headers := (dict "User-Agent" ($api.user_agent) "Authorization" (printf "Bearer %s" (($api.gitlab.token) | base64Decode)) ) }}
{{ range ($projects) }} {{ $project := (getJSON ($api.gitlab.url) "/projects/" . "?license=1&ts=" ($ts) ($headers)) }}
{{ if (or ($project.avatar_url) ($project.namespace.avatar_url)) }} {{ end }}
{{ (($project.name) | default ($project.path)) }}
{{ if ($project.owner.name) }}
{{ . }}
{{ end }} {{ if ($project.description) }}

{{ (. | plainify) }}

{{ end }}
{{ end }}
{{- else -}} {{ (partial "alerts/no_params" .) }} {{- end -}}