forked from spiffe/spiffe.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
releases.html
91 lines (86 loc) · 4.42 KB
/
releases.html
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{{- $displayReleases := ne (getenv "HIDE_RELEASES") "true" }}
{{- $spireReleasesUrl := "https://api.github.com/repos/spiffe/spire/releases" }}
{{- $downloadUrl := "https://github.com/spiffe/spire/releases/download" }}
{{- if $displayReleases }}
<table class="is-downloads-table">
<thead>
<tr>
<th>
Version
</th>
<th>
Click to copy link to clipboard
</th>
<th>
Click to trigger download
</th>
</tr>
</thead>
<tbody>
{{- $releases := getJSON $spireReleasesUrl }}
{{- range $releases }}
{{- $latest := (index $releases 0).tag_name }}
{{- $hasExtras := (index .assets 2).name }}
{{- $clipboardButtons := .Site.Params.downloads.buttons.clipboard }}
{{- $downloadButtons := .Site.Params.downloads.buttons.download }}
{{- $version := .tag_name }}
{{- $versionUrl := .html_url }}
{{- $isLatest := eq $version $latest }}
{{- $tar := (index .assets 0).name }}
{{- $zip := (index .assets 1).name }}
{{- $extrasChecksumUrl := "" -}}
{{- $extrasTarUrl := "" -}}
{{- if $hasExtras }}
{{- $extras := (index .assets 2).name }}
{{- $extrasChecksum := (index .assets 3).name }}
{{- $extrasTarUrl = printf "%s/%s/%s" $downloadUrl $version $extras }}
{{- $extrasChecksumUrl = printf "%s/%s/%s" $downloadUrl $version $extrasChecksum }}
{{- end }}
{{- $binaryTarUrl := printf "%s/%s/%s" $downloadUrl $version $tar }}
{{- $checksumsUrl := printf "%s/%s/%s" $downloadUrl $version $zip }}
{{- $sourceZipUrl := printf "https://github.com/spiffe/spire/archive/%s.zip" $version }}
{{- $sourceTarUrl := printf "https://github.com/spiffe/spire/archive/%s.tar.gz" $version }}
<tr>
<td>
<a class="is-size-3 is-size-4-mobile has-text-weight-bold is-download-version" href="{{ $versionUrl }}">
{{ $version }}
</a>
{{- if $isLatest }}
<span class="tag is-success">
LATEST
</span>
{{- end }}
</td>
<td>
<div class="buttons">
{{ partial "downloads/download-button.html" (dict "url" $binaryTarUrl "text" "Binaries (.tar.gz)" "isDownloadButton" false "color" "dark") }}
{{ partial "downloads/download-button.html" (dict "url" $checksumsUrl "text" "Checksum (.txt)" "isDownloadButton" false "color" "dark") }}
{{- if $hasExtras -}}
{{ partial "downloads/download-button.html" (dict "url" $extrasTarUrl "text" "Extras (.tar.gz)" "isDownloadButton" false "color" "dark") }}
{{ partial "downloads/download-button.html" (dict "url" $extrasChecksumUrl "text" "Extras Checksum (.txt)" "isDownloadButton" false "color" "dark") }}
{{- end }}
{{ partial "downloads/download-button.html" (dict "url" $sourceZipUrl "text" "Source (.zip)" "isDownloadButton" false "color" "light") }}
{{ partial "downloads/download-button.html" (dict "url" $sourceTarUrl "text" "Source (.tar.gz)" "isDownloadButton" false "color" "light") }}
</div>
</td>
<td>
<div class="buttons">
{{ partial "downloads/download-button.html" (dict "url" $binaryTarUrl "text" "Binaries (.tar.gz)" "isDownloadButton" true "color" "dark") }}
{{ partial "downloads/download-button.html" (dict "url" $checksumsUrl "text" "Checksum (.txt)" "isDownloadButton" true "color" "dark") }}
{{- if $hasExtras -}}
{{ partial "downloads/download-button.html" (dict "url" $extrasTarUrl "text" "Extras (.tar.gz)" "isDownloadButton" true "color" "dark") }}
{{ partial "downloads/download-button.html" (dict "url" $extrasChecksumUrl "text" "Extras Checksum (.txt)" "isDownloadButton" true "color" "dark") }}
{{- end }}
{{ partial "downloads/download-button.html" (dict "url" $sourceZipUrl "text" "Source (.zip)" "isDownloadButton" true "color" "light") }}
{{ partial "downloads/download-button.html" (dict "url" $sourceTarUrl "text" "Source (.tar.gz)" "isDownloadButton" true "color" "light") }}
</div>
</td>
</tr>
{{- end }}
</tbody>
</table>
{{- else }}
<blockquote>
The releases table is not currently displayed because you're running the site in standard development mode. To display the releases table while in development mode, run <code>make serve-with-releases</code> rather than the standard <code>make serve</code>.
</blockquote>
{{- end }}