Skip to content

Commit b19bdc0

Browse files
committed
[Init] Initial test
0 parents  commit b19bdc0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Python File Viewer</title>
7+
</head>
8+
<body>
9+
<h1>Python File Viewer</h1>
10+
<ul id="file-list"></ul>
11+
12+
<script>
13+
// GitHub API를 통해 Repository의 파일 목록을 가져옵니다.
14+
fetch('https://api.github.com/repos/Code-Study/Code-Study.github.io/contents/')
15+
.then(response => response.json())
16+
.then(data => {
17+
// 파일 목록을 순회하며 Python 파일인 경우 링크를 생성합니다.
18+
const fileList = document.getElementById('file-list');
19+
data.forEach(file => {
20+
if (file.name.endsWith('.py')) {
21+
const listItem = document.createElement('li');
22+
const link = document.createElement('a');
23+
link.href = file.html_url;
24+
link.textContent = file.name;
25+
listItem.appendChild(link);
26+
fileList.appendChild(listItem);
27+
}
28+
});
29+
})
30+
.catch(error => console.error('Error fetching file list:', error));
31+
</script>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)