-
Notifications
You must be signed in to change notification settings - Fork 1
/
page.html
executable file
·84 lines (84 loc) · 3.89 KB
/
page.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
<!DOCTYPE html>
<html>
<head>
{{template "head" .}}
<meta name="keywords" content="{{.Site.Subtitle}}">
<meta name="description" content="{{.Site.Subtitle}}">
<title>{{.Site.Title}}</title>
</head>
<body>
<!--[if lt IE 8]>
<div class="browsehappy" role="dialog">当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>.</div>
<![endif]-->
{{template "header" .}}
<div id="body" class="clearfix">
<div class="container-fluid">
<div class="row">
<div id="main" role="main">
<ul class="post-list clearfix">
{{range .Articles}}
<li class="post-item grid-item" itemscope itemtype="http://schema.org/BlogPosting">
<a class="post-link" href="{{$.Site.Root}}/{{.Link}}">
<h3 class="post-title">
<time class="index-time" datetime="{{.Date}}" itemprop="datePublished"></time>
<br>
{{.Title}}
</h3>
<div class="post-meta">
{{index .Tags 0}} </div>
</a>
</li>
{{end}}
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="nav-page">
<ol class="page-navigator">
{{if .Prev}}
<li class="prev">
<a href="{{.Site.Root}}/{{.Prev}}">«</a>
</li>
{{end}}
<!--生成页数-->
<script>
var currentpagenum = {{.Page}};
var totalpagenum = {{.Total}};
for(var i=1;i<=totalpagenum;i++) {
if (i==currentpagenum) {
document.write('<li class="current"><a href="');
if (i==1) {
document.write('/');
}
else {
document.write('page'+i+'.html');
}
document.write('">'+i+'</a></li>');
}
else {
document.write('<li><a href="');
if (i==1) {
document.write('/');
}
else {
document.write('page'+i+'.html');
}
document.write('">'+i+'</a></li>');
}
}
</script>
{{if .Next}}
<li class="next">
<a href="{{.Site.Root}}/{{.Next}}">»</a>
</li>
{{end}}
</ol>
</div>
</div>
</div>
</div><!-- end #body -->
{{template "footer" .}}
</body>
</html>