-
Notifications
You must be signed in to change notification settings - Fork 2
/
html.go
175 lines (164 loc) · 4.28 KB
/
html.go
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package main
const (
tmpl = `<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>GitHub Releases</title>
<style>
html {
display: block;
}
body{
font-family: Consolas, Inconsolata, monospace;
display: block;
margin: 0;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
@media (min-width: 1200px) .container {
max-width: 1140px;
}
@media (min-width: 992px) .container {
max-width: 960px;
}
@media (min-width: 768px) .container {
max-width: 720px;
}
@media (min-width: 576px) .container {
max-width: 540px;
}
.container {
max-width: 100%;
padding: 1rem;
margin: auto;
}
table {
background-color: transparent;
border-color: transparent;
border-collapse: collapse;
border-spacing: 2px;
border-color: grey;
text-align: inherit;
font-size: .75rem;
margin-bottom: 20px;
}
thead {
display: table-header-group;
vertical-align: middle;
border-color: inherit;
}
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}
thead th {
vertical-align: bottom;
border-bottom: 2px solid #dee2e6;
}
td, th {
padding: .75rem;
vertical-align: top;
border-top: 1px solid #dee2e6;
display: table-cell;
}
tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
</style>
</head>
<body>
<div class="container">
<h1>Latest Releases</h1>
<p>This only shows the hashes and download links for linux amd64. For other archs click the tag
to view the release page.</p>
<p><small>If you wish to modify this page, the repo is: <a href="https://github.com/genuinetools/releases" target="_blank">genuinetools/releases</a></small></p>
<table>
<thead>
<tr>
<th>Project</th>
<th>Release</th>
<th>download</th>
<th>sha256</th>
<th>released</th>
<th>download count</th>
</tr>
</thead>
<tbody>
{{range .}}
<tr>
<td><a href="{{.Repository.HTMLURL}}" target="_blank">{{.Repository.FullName}}</a></td>
<td><a href="{{.Release.HTMLURL}}" target="_blank">{{.Release.TagName}}</a></td>
<td><a href="{{.BinaryURL}}" target="_blank"><code>{{.BinaryName}}</code></a></td>
<td><code>{{.BinarySHA256}}</code></td>
<td>{{.BinarySince}} ago</td>
<td><bold>{{.BinaryDownloadCount}}</bold></td>
</tr>
{{end}}
</tbody>
</table>
</div>
<script>
(function () {
'use strict';
var devtools = {
open: false,
orientation: null
};
var threshold = 160;
var emitEvent = function (state, orientation) {
window.dispatchEvent(new CustomEvent('devtoolschange', {
detail: {
open: state,
orientation: orientation
}
}));
};
setInterval(function () {
var widthThreshold = window.outerWidth - window.innerWidth > threshold;
var heightThreshold = window.outerHeight - window.innerHeight > threshold;
var orientation = widthThreshold ? 'vertical' : 'horizontal';
if (!(heightThreshold && widthThreshold) &&
((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) || widthThreshold || heightThreshold)) {
if (!devtools.open || devtools.orientation !== orientation) {
emitEvent(true, orientation);
}
devtools.open = true;
devtools.orientation = orientation;
} else {
if (devtools.open) {
emitEvent(false, null);
}
devtools.open = false;
devtools.orientation = null;
}
}, 500);
if (typeof module !== 'undefined' && module.exports) {
module.exports = devtools;
} else {
window.devtools = devtools;
}
})();
</script>
<script>
var gt = " _ __ __\n" +
" ____ ____ ____ __ __(_)___ ___ / /_____ ____ / /____\n" +
" / __ ` + "`" + `/ _ \\/ __ \\/ / / / / __ \\/ _ \\ / __/ __ \\/ __ \\/ / ___/\n" +
" / /_/ / __/ / / / /_/ / / / / / __/ / /_/ /_/ / /_/ / (__ )\n" +
" \\__, /\\___/_/ /_/\\__,_/_/_/ /_/\\___/ \\__/\\____/\\____/_/____/\n" +
"/____/"
var printed = false;
window.addEventListener('devtoolschange', function (e) {
if(e.detail.open) { printed = true; console.log(gt); }
});
</script>
</body>
</html>`
)