Skip to content

Commit

Permalink
refactor: gh
Browse files Browse the repository at this point in the history
  • Loading branch information
stopsopa committed Aug 23, 2023
1 parent fd7802b commit 79bb0f3
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>nlab</title>
</head>
<body>
<style>
#gh img {
height: 23px;
width: 20px;
margin-bottom: -7px;
}
</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>
</body>
</html>
<script>
document.getElementById("gh").setAttribute(
"href",
(function ([_, user, repo]) {
const gh = `https://github.com`;
if (user && repo) {
return `${gh}/${user}/${repo}`;
}
return gh;
})([...location.href.match(/^https?:\/\/([^\.]+)\.github\.io\/([^\/]+).*/)]),
);
</script>
</body>
</html>

0 comments on commit 79bb0f3

Please sign in to comment.