-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
39 lines (35 loc) · 1.19 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
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Ryan Shaw's website" />
<title>Ryan Shaw's Website</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<!-- https://stackoverflow.com/questions/39048654/how-to-enable-directory-indexing-on-github-pages -->
<!-- directory listing script stolen from this stackoverflow post -->
<script>
(async () => {
const response = await fetch(
"https://api.github.com/repos/ryshaw/ryshaw.github.io/contents/"
);
const data = await response.json();
let htmlString = "<h1>ryshaw games and webpages</h1><ul>";
for (let file of data) {
if (
file.name != "README.md" &&
file.name != "index.html" &&
file.name != "styles.css"
) {
htmlString += `<li><a href="${file.path}">${file.name}</a></li>`;
}
}
htmlString += "</ul>";
document.getElementsByTagName("body")[0].innerHTML = htmlString;
})();
</script>
</body>
</html>