-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (39 loc) · 1.49 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>
<head>
<title>Sablier File Hosting</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<meta name="theme-color" content="#f77423" />
</head>
<body>
<h1>Sablier Files</h1>
<p>
Sablier uses this GitHub Pages site to host various files, such as the Sablier logo, the Terms of Service, and the
Privacy Policy.
</p>
<ul id="fileList"></ul>
<script>
const owner = "sablier-labs";
const repo = "sablier-labs.github.io";
fetch(`https://api.github.com/repos/${owner}/${repo}/contents`)
.then((response) => response.json())
.then((data) => {
const list = document.getElementById("fileList");
data.forEach((file) => {
// Return early if the file name matches any of the specified names
if ([".prettierrc.yml", "CNAME", "README.md"].includes(file.name)) {
return; // Skip this file
}
// Proceed with adding the file to the list if it doesn't match the excluded names
const li = document.createElement("li");
const a = document.createElement("a");
a.setAttribute("href", `https://files.sablier.com/${file.name}`);
a.setAttribute("target", "_blank");
a.textContent = file.name;
li.appendChild(a);
list.appendChild(li);
});
})
.catch((error) => console.error("Error fetching repo contents:", error));
</script>
</body>
</html>