-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
90 lines (77 loc) · 1.54 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
---
layout: default
title: Taber
---
<style>
/*
@名称: index
@功能: 首页样式
*/
h2 {
font-size:18px;
font-weight:bold;
color:black;
}
#article,
#aboutme {
margin:30px auto 0;
}
#article ul,
#aboutme p {
margin:0 2em;
}
#article time {
color:#999;
}
#article ul {
line-height:1.8;
}
#aboutme {
line-height:2.2;
}
#aboutme span {
font-weight:bold;
margin-right:10px;
}
#aboutme a {
margin-right:15px;
}
</style>
<section id="article">
<h2>Article</h2>
<ul>
{% for post in site.posts %}
<li><time datetime="{{ post.date | date: "%Y-%m-%d" }}">{{ post.date | date_to_string }}</time> » <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</section>
<section id="aboutme">
<h2>About me</h2>
<p>技术爱好者.正在努力前进中</p>
<p><span>E-mail:</span>taber.huang#gmail.com</p>
</section>
<script>
function moveSection(hash) {
var body, elem, value;
if (!hash) return;
hash = hash.match(/#[^#]*/g);
for (var i = 0, len = hash.length; i < len; i++) {
value = hash[i];
if (value.indexOf('#anchor-') > -1) {
elem = document.getElementById(value.replace(/#anchor-/, ''));
break;
}
}
body = document.getElementById('main');
body.insertBefore(elem, body.firstElementChild || body.firstChild);
}
moveSection(location.hash);
if (location.pathname === '/') {
document.getElementById('link-article').onclick = goTo;
document.getElementById('link-aboutme').onclick = goTo;
}
function goTo(e) {
moveSection(this.href);
return false;
}
</script>