-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.html
55 lines (51 loc) · 1.8 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
---
layout: page
title: 首页
---
{% include JB/setup %}
<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1>
<p class="info">
<span class="info-item date">发表于<a href="{{ post.url }}">{{ post.date | date: "%Y年%m月%d日"}}</a></span>
<span class="info-item">
分类:
{% for category in post.categories %}
<a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category }}-ref">{{ category | join: "/" }}</a>
{% endfor %}
</span>
<span class="info-item">
标签:
{% for tag in post.tags %}
<a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag }}-ref">{{ tag }}</a>
{% endfor %}
</span>
</p>
<div class="content">
{{ post.excerpt | markdownify }}
</div>
<p><a href="{{ post.url }}" class="more-link">更多<span class="meta-nav">→</span></a></p>
{% endfor %}
{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« 上一页</a>
{% else %}
<span>« 上一页</span>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
<a href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
{% else %}
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">下一页 »</a>
{% else %}
<span>下一页 »</span>
{% endif %}
</div>
{% endif %}