forked from zxysilent/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
50 lines (50 loc) · 2.05 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>{{.basic.Title}}</title>
<link rel="canonical" href="{{.basic.SiteUrl}}" />
{{template "tpl-linker.html" .}}
</head>
<body>
{{template "tpl-naver.html" .}}
<div id="main">
<section id="page-index">
{{ range $k, $v := .Posts }}
<article class="post">
<div class="meta">
<div>
<!-- $. 在循环里面访问外部变量 -->
<span class="author">{{$.global.Author}}</span>
<span>发布于</span>
<span class="date">{{ unix $v.Created "2006-01-02" }}</span>
</div>
<div class="comment">
<a href="/posts/{{$v.Path}}.html#comments">comments</a>
</div>
</div>
<h1 class="title">
<a href="/posts/{{$v.Path}}.html">{{$v.Title}}</a>
</h1>
<div class="entry-content">
{{ str2html $v.Summary }}
<p class="more">
<a href="/posts/{{$v.Path}}.html">阅读全文 »</a>
</p>
</div>
</article>
{{ end }}
<nav class="pagination">
{{ if ne .Naver.Prev ""}}
<a href="{{.Naver.Prev}}" class="prev">« 上一页</a>
{{end}}
<div class="center"><a href="/archives">博客归档</a></div>
{{ if ne .Naver.Next ""}}
<a href="{{.Naver.Next}}" class="next">下一页 »</a>
{{end}}
</nav>
</section>
{{template "tpl-footer.html" .}}
</div>
{{template "tpl-script.html" .}}
</body>
</html>