forked from agultiga/news
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.html
More file actions
89 lines (76 loc) · 2.42 KB
/
Copy pathindex.html
File metadata and controls
89 lines (76 loc) · 2.42 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
---
layout: default
---
{% if site.posts.size == 0 %}
<h2>No post found</h2>
{% endif %}
<ul class="archive">
{% for post in paginator.posts %}
{% unless post.next %}
{% assign today = site.time | date: '%Y-%m-%d' %}
{% capture month %}{{ post.date | date: '%Y-%m-%d' }}{% endcapture %}
{% if month != today %}
<h2>{{ month }}</h2>
{% endif %}
{% else %}
{% capture date %}{{ post.date | date: '%Y-%m-%d' }}{% endcapture %}
{% capture ndate %}{{ post.next.date | date: '%Y-%m-%d' }}{% endcapture %}
{% if date != ndate %}
<h2>{{ post.date | date: '%Y-%m-%d' }}</h2>
{% endif %}
{% endunless %}
<li>
{% if post.link %}
<a href="{{ post.link }}">
{% else %}
<a href="{{ site.baseurl }}{{ post.url }}">
{% endif %}
{{ post.title }}
</a>
<time>{{ post.date | date: "%Y-%m-%d" }}</time>
{% if post.categories %}
<a href="{{ site.url }}{{ site.baseurl }}/categories/#{{ post.categories.last }}" class="tag">
{{ post.categories.last }}
</a>
{% endif %}
{% if post.from %}
<a href="{{ post.from }}" style="font-size:14px;">原文</a>
{% endif %}
{% if post.comments %}
{% if site.disqus %}
{% if post.link %}
<a href="{{ site.url }}{{ post.link }}#disqus_thread" style="font-size:14px;color:teal;">
{% else %}
<a href="{{ site.url }}{{ site.baseurl }}{{ post.url }}#disqus_thread" style="font-size:14px;color:teal;">
{% endif %}
评论
</a>
{% endif %}
{% endif %}
</li>
{% endfor %}
</ul>
<div class="pagination">
{% if paginator.previous_page %}
<span class="prev">
<a href="{{ site.baseurl }}{{ paginator.previous_page_path }}" class="prev">
上一页
</a>
</span>
{% endif %}
{% if paginator.next_page %}
<span class="next">
<a href="{{ site.baseurl}}{{ paginator.next_page_path }}" class="next">
下一页
</a>
</span>
{% endif %}
{% include fab.html %}
<script>
/* post pagination keyboard shortcuts */
document.body.onkeyup = function(e){
if (e.keyCode == '37') { window.location = '{{ site.baseurl }}{{ paginator.previous_page_path }}'; } // left arrow key
if (e.keyCode == '39') { window.location = '{{ site.baseurl}}{{ paginator.next_page_path }}'; } // right arrow key
};
</script>
</div>