forked from SeleniumHQ/seleniumhq.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgh-contributors.html
More file actions
50 lines (47 loc) · 1.22 KB
/
gh-contributors.html
File metadata and controls
50 lines (47 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<style type="text/css">
.ghContributors {
display: flex;
flex-flow: wrap;
align-content: flex-start;
}
.ghContributors > div {
width: 50%;
display: inline-flex;
margin-bottom: 5px;
}
.ghContributors > div label {
padding-left: 4px;
}
.ghContributors > div span {
font-size: x-small;
padding-left: 4px;
}
</style>
{{ $githubToken := (getenv "SELENIUM_CI_TOKEN") }}
{{ if $githubToken }}
<div class="ghContributors">
{{ $url := .Get 0 }}
{{ $toReplace := printf "://%s@" $githubToken }}
{{ $tokenInUrl :=cond (eq $githubToken "") "://" $toReplace }}
{{ $url := replace $url "://" $tokenInUrl }}
{{ $contributorJson := resources.GetRemote $url }}
{{ $contributors := $contributorJson | transform.Unmarshal }}
{{ range $contributors }}
<div style="padding: 10px;">
<img
src="{{.avatar_url}}"
class="inline"
width="100"
height="100"
style="height: 100px;height: 100px;margin-bottom:.25em; vertical-align:middle; "
/>
<label
><a href="{{.html_url}}">@{{.login}}</a></label
>
<span class="contributions">{{.contributions}} commits</span>
</div>
{{ end }}
</div>
{{ else }}
{{ partial "github-content.html" }}
{{ end }}