-
Notifications
You must be signed in to change notification settings - Fork 354
/
Copy pathdl.tmpl
148 lines (130 loc) · 4.48 KB
/
dl.tmpl
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
{{define "layout"}}
<article class="Downloads Article">
<h1>{{.title}}</h1>
{{with .dl}}
<p>
After downloading a binary release suitable for your system,
please follow the <a href="/doc/install">installation instructions</a>.
</p>
<p>
If you are building from source,
follow the <a href="/doc/install/source">source installation instructions</a>.
</p>
<p>
See the <a href="/doc/devel/release.html">release history</a> for more
information about Go releases.
</p>
<p>
As of Go 1.13, the go command by default downloads and authenticates
modules using the Go module mirror and Go checksum database run by Google. See
<a href="https://proxy.golang.org/privacy">https://proxy.golang.org/privacy</a>
for privacy information about these services and the
<a href="/cmd/go/">go command documentation</a>
for configuration details including how to disable the use of these servers or use
different ones.
</p>
{{with .Featured}}
<h2 id="featured">Featured downloads</h2>
<div class="downloadWrapper">
{{range .}}
{{template "download" .}}
{{end}}
{{end}}
</div>
<div style="clear: both;"></div>
{{with .Stable}}
<h2 id="stable">Stable versions</h2>
{{template "download-releases" .}}
{{end}}
{{with .Unstable}}
<h2 id="unstable">Unstable version</h2>
{{template "download-releases" .}}
{{end}}
{{with .Archive}}
<div class="toggle" id="archive">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show versions">Archived versions <span class="toggleText">Show</span></h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide versions">Archived versions <span class="toggleText">Hide</span></h2>
{{template "download-releases" .}}
</div>
</div>
{{end}}
{{end}}
</article>
{{end}}
{{define "download-releases"}}
{{range .}}
<div class="toggle{{if .Visible}}Visible{{end}}" id="{{.Version}}">
<div class="collapsed">
<h3 class="toggleButton" title="Click to show downloads for this version">
<span>{{.Version}}</span>
<img class="toggleButton-img" src="/images/icons/arrow-down.svg" width="18" height="18" aria-hidden="true" />
<img class="toggleButton-img toggleButton-img-dark" src="/images/icons/arrow-down-dark.svg" width="18" height="18" aria-hidden="true" />
</h3>
</div>
<div class="expanded">
<h3 class="toggleButton" title="Click to hide downloads for this version">
<span>{{.Version}}</span>
<img class="toggleButton-img" src="/images/icons/arrow-down.svg" width="18" height="18" aria-hidden="true" />
<img class="toggleButton-img toggleButton-img-dark" src="/images/icons/arrow-down-dark.svg" width="18" height="18" aria-hidden="true" />
</h3>
{{if .Stable}}{{else}}
<p>This is an <b>unstable</b> version of Go. Use with caution.</p>
<p>If you already have Go installed, you can install this version by running:</p>
<pre>
go install golang.org/dl/{{.Version}}@latest
</pre>
<p>Then, use the <code>{{.Version}}</code> command instead of the <code>go</code> command to use {{.Version}}.</p>
{{end}}
{{template "download-files" .}}
</div>
</div>
{{end}}
{{end}}
{{define "download-files"}}
<div style="overflow:auto;">
<table class="downloadtable">
<thead>
<tr class="first">
<th>File name</th>
<th>Kind</th>
<th>OS</th>
<th>Arch</th>
<th>Size</th>
{{/* Use the checksum type of the first file for the column heading. */}}
<th>{{(index .Files 0).ChecksumType}} Checksum</th>
</tr>
</thead>
{{if .SplitPortTable}}
{{range .Files}}{{if .PrimaryPort}}{{template "download-file" .}}{{end}}{{end}}
{{/* TODO(cbro): add a link to an explanatory doc page */}}
<tr class="first js-togglePorts" aria-expanded="false"><th colspan="6" class="first">Other Ports</th></tr>
{{range .Files}}{{if not .PrimaryPort}}{{template "download-file" .}}{{end}}{{end}}
{{else}}
{{range .Files}}{{template "download-file" .}}{{end}}
{{end}}
</table>
</div>
{{end}}
{{define "download-file"}}
<tr class="{{if .Highlight}}highlight{{end}} {{if not .PrimaryPort}}secondary{{end}}">
<td class="filename"><a class="download" href="{{.URL}}">{{.Filename}}</a></td>
<td>{{.PrettyKind}}</td>
<td>{{.PrettyOS}}</td>
<td>{{.PrettyArch}}</td>
<td>{{.PrettySize}}</td>
<td><tt>{{.PrettyChecksum}}</tt></td>
</tr>
{{end}}
{{define "download"}}
<a class="download downloadBox" href="{{.URL}}">
<div class="platform">{{.Platform}}</div>
{{with .Requirements}}<div class="reqs">{{.}}</div>{{end}}
<div class="filename">
<img src="/images/icons/download.svg" aria-hidden="true" width="14" height="13" />
<span>{{.Filename}}</span>
</div>
</a>
{{end}}