-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
41 lines (35 loc) · 1.08 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>nlab</title>
<style>
#gh img {
height: 23px;
width: 20px;
margin-bottom: -7px;
}
#coverage {
margin-top: 10px;
}
</style>
</head>
<body>
<a href="javascript:void(0)" id="gh"><img src="https://github.githubassets.com/favicons/favicon.svg" /></a> |
<a href="coverage">coverage</a> | <a href="jasmine/index.html">browser tests</a>
<br />
<img id="coverage" />
<script>
const [_, user, repo] = [...location.href.match(/^https?:\/\/([^\.]+)\.github\.io\/([^\/]+).*/)];
console.log(`user >${user}< repo >${repo}<`);
const gh = `https://github.com`;
let href = gh;
if (user && repo) {
href = `${gh}/${user}/${repo}`;
}
document.getElementById("gh").setAttribute("href", href);
document.getElementById("coverage").setAttribute("src", `/${repo}/coverage/coverage-badge.svg`);
</script>
</body>
</html>