-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
28 lines (28 loc) · 1007 Bytes
/
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
<!-- Inspired by https://stackoverflow.com/a/53218452 -->
<html>
<body>
Loading...
<script>
(async () => {
const response = await fetch('https://api.github.com/repos/Logius-standaarden/Publicatie-Preview/contents/');
const data = await response.json();
let htmlString = '<ul>';
for (let file of data) {
if (file.type == 'dir') {
htmlString += `<li>${file.path}</a></li>`;
htmlString += '<ul>';
document.getElementsByTagName('body')[0].innerHTML = `Loading <i>${file.name}</i>`;
const response = await fetch(file.url);
const data = await response.json();
for (let file of data) {
htmlString += `<li><a href="${file.path}">${file.name}</a></li>`;
}
htmlString += '</ul>';
}
}
htmlString += '</ul>';
document.getElementsByTagName('body')[0].innerHTML = htmlString;
})()
</script>
<body>
</html>