{{- /* GitLab group. @param {string} (positional parameter 0) Group name on GitLab. @returns {template.HTML} @examples {{< gl-group "9970" >}} */ -}} {{- if (.Get 0) -}} {{ $groups := (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 ($groups) }} {{ $group := (getJSON ($api.gitlab.url) "/groups/" . "?with_projects=0&ts=" ($ts) ($headers)) }} {{ if (eq ($group.visibility) "public") }}
{{ if ($group.avatar_url) }} {{ end }}
{{ (($group.name) | default ($group.path)) }}

{{ (($group.description) | plainify) }}

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