{{ $owner := "beyond-all-reason" }} {{ $repo := "RecoilEngine" }} {{ $count := 1000 }} {{ $max_pages := 5 }} {{ $opts := dict }} {{ $gh_token := os.Getenv "HUGO_GH_TOKEN" }} {{ with $gh_token }} {{ $opts = dict "headers" (dict "Authorization" $gh_token) }} {{ end }} {{ $data := slice }} {{ range $max_pages }} {{- $url := printf "https://api.github.com/repos/%s/%s/contributors?per_page=%d&page=%d" $owner $repo $count . }} {{ with try (resources.GetRemote $url $opts) }} {{ with .Err }} {{ warnf "The %q shortcode was unable to fetch github contributors from %s (%s). See %s" .Name $url . .Position }} {{ else }} {{ $deserialized := .Value | transform.Unmarshal }} {{ if not $deserialized }} {{ break }} {{ end }} {{$data = append $data $deserialized }} {{ end }} {{ else }} {{ warnf "The %q shortcode was unable to fetch github contributors from %s (%s). See %s" .Name $url . .Position }} {{ end }} {{ end }} {{ $gh_contributors := slice }} {{ with $data }} {{ range $data }} {{ $gh_contributors = $gh_contributors | append (dict "html_url" .html_url "avatar_url" .avatar_url "login" .login)}} {{ end }} {{ end }} {{ $nonCoders := site.Data.non_coder_contributors }} {{ $allContributors := append $nonCoders ($gh_contributors | uniq) }} {{ $shuffled := shuffle $allContributors }} {{ $img_size := 48 }}