-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
93 lines (80 loc) · 2.53 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File Directory</title>
<style>
* {
box-sizing: border-box;
}
body, html {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #f4f4f4;
color: #333;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
#file-list {
list-style-type: none;
padding: 0;
}
#file-list li {
background-color: #fff;
padding: 15px;
margin: 10px 0;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#file-list li a {
text-decoration: none;
color: #333;
font-size: 16px;
}
h1 {
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>File Directory</h1>
<ul id="file-list"></ul>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const owner = 'ArxivPodcastGPT';
const repo = 'ArxivPodcastGPT.github.io';
const branch = 'main';
const apiEndpoint = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}?recursive=1`;
// Fetch the file data from the GitHub API
fetch(apiEndpoint)
.then(response => response.json())
.then(data => {
const fileListElement = document.getElementById('file-list');
// Filter out the directories, only showing files
const files = data.tree.filter(item => item.type === 'blob');
// Populate the file list
files.forEach(file => {
fileListElement.innerHTML += `
<li>
<a href="${file.path}" target="_blank">
${file.path}
</a>
</li>
`;
});
})
.catch(error => console.error('Error fetching the file list:', error));
});
</script>
</body>
</html>