-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
94 lines (84 loc) · 1.78 KB
/
index.html
File metadata and controls
94 lines (84 loc) · 1.78 KB
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
94
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>我的博客</title>
<!-- 引入 marked.js CDN -->
<script src="libs/marked.min.js"></script>
<style>
/* 页面整体样式 */
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
max-width: 900px;
margin: 40px auto;
line-height: 1.6;
color: #333;
background-color: #fdfdfd;
padding: 0 20px;
}
/* 主标题 */
h1 {
text-align: center;
font-size: 2.2em;
margin-bottom: 30px;
color: #2c3e50;
}
/* 分类标题 */
h2 {
color: #2980b9;
border-bottom: 2px solid #2980b9;
padding-bottom: 5px;
margin-top: 30px;
}
/* 链接样式 */
a {
color: #3498db;
text-decoration: none;
transition: color 0.2s;
}
a:hover {
color: #e74c3c;
text-decoration: underline;
}
/* 列表样式 */
ul {
list-style-type: disc;
padding-left: 20px;
}
li {
margin-bottom: 10px;
}
/* 代码块样式 */
pre {
background-color: #f6f8fa;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
code {
font-family: monospace;
}
/* 加载提示 */
#content {
min-height: 100px;
}
</style>
</head>
<body>
<h1>我的博客导航</h1>
<div id="content">加载中...</div>
<script>
fetch("README.md")
.then(res => {
if (!res.ok) throw new Error("无法加载 README.md");
return res.text();
})
.then(text => {
document.getElementById("content").innerHTML = marked.parse(text);
})
.catch(err => {
document.getElementById("content").innerHTML = "加载失败:" + err;
});
</script>
</body>
</html>