-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (36 loc) · 1.18 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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Activities - Raspberry Pi Foundation</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<style>
#activities li {
text-transform: capitalize;
}
</style>
</head>
<body>
<main>
<section class="py-4 mx-5 container">
<h1>AI Activities </h1>
<ul id="activities"></ul>
</section>
</main>
<script>
// dynamic listing of directories
(async () => {
const response = await fetch('https://api.github.com/repos/RaspberryPiFoundation/ai-activities/contents/');
const data = await response.json();
let htmlString = '';
for (let file of data) {
if (file.type === 'dir') { // only include directories
htmlString += `<li><a href="${file.path}">${file.name.replace(/-/g, ' ')}</a></li>`;
}
}
document.getElementById('activities').innerHTML = htmlString;
})();
</script>
</body>
</html>