-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnon-working-js-page.html
43 lines (39 loc) · 1.32 KB
/
non-working-js-page.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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width intial-scale=1">
<title>page</title>
<link rel="icon" type="image/png" href="styles/favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles/main-style.css">
</head>
<body>
<div class="flex-container">
<header>
<p>header</p>
</header>
<nav>
<p>nav</p>
</nav>
<main>
<p>main</p>
</main>
<footer>
<p>footer</p>
</footer>
</div>
</body>
<script>
/*
* The few lines below let us use the default GitHub Pages URL to find info about the repo, and build the page on the fly.
* This is a nice trick, but if you change the URL, it will break this system.
* ...However, if you're changing the URL: I assume you can figure out a workaround for this too...
*/
let _url = window.location.href;
let gh_user = _url.split('/')[2].split('.')[0] //a little tricky, but pulls the github user from the url
let gh_repo = _url.split('/')[3] //a little tricky, but pulls the github repo from the url
console.log(gh_user);
console.log(gh_repo);
</script>
</html>