-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (78 loc) · 2.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>编程小记</title>
<link href="static/css/materialicons.css" rel="stylesheet">
<link href="static/css/materialize.min.css" rel="stylesheet">
<link href="static/css/index.css" rel="stylesheet" />
<script type="text/javascript" src="static/js/jquery-3.2.1.js"></script>
</head>
<body>
<header>
<div class="container">
<ul id="nav-mobile" class="side-nav fixed" style="width:250px;transform: translateX(0px);">
<br>
<br>
<br>
<br>
<br>
<br>
<li class="logo left-nav-logo center">
<img src="static/img/head.jpg" style="width: 100px;height: 100px;border-radius: 10px;">
<br>
</li>
<li class="logo left-nav-logo center">
<h5 class="text-center center">编程小记</h5>
</li>
<br>
</ul>
</div>
</header>
<main>
<div class="container">
<div class="section">
<br>
<div class="row" id="bloglist">
</div>
</div>
</div>
</main>
</body>
<script type="text/javascript">
window.onload = function () {
getBlogList();
}
function getBlogList() {
$.ajax({
type: 'GET',
url: 'list.txt',
success: function (response) {
var fileList = response.split('\n');
var htmlStr = '';
for (var i = 0; i < fileList.length; i++) {
var fileName = fileList[i]
if (fileName.length != 0) {
fileName = fileName.trim();
htmlStr += "<div class='col s6 m4'>\
<a target='_blank' href='blog.html?title="+ fileName + "'>\
<ul class='collection mian-card-col-coll hoverable'>\
<li class='collection-item'>\
<span class='title truncate'>"+ fileName + "</span>\
</li>\
</ul>\
</a>\
</div>"
}
}
document.getElementById("bloglist").innerHTML = htmlStr;
},
error: function (err) {
console.log(err);
}
})
}
</script>
</html>