-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
149 lines (143 loc) · 5.04 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
layout: page
description: "砥砺前行"
---
<!-- 置顶文章 -->
{% for post in paginator.posts %}
{% if post.stickie != true %}
{% continue %}
{% endif %}
<div class="post-preview">
<a href="{{ post.url | prepend: site.baseurl }}">
<h2 class="post-title">
{{ post.title }}
</h2>
{% if post.subtitle %}
<h3 class="post-subtitle">
{{ post.subtitle }}
</h3>
{% endif %}
<!-- <div class="post-content-preview">
{{ post.content | strip_html | truncate:200 }}
</div> -->
</a>
<p class="post-meta">
<strong style="color: #B6C29A;margin-left: -9px">【置顶】</strong>
{% if post.rkupdate %}
[更新:{% include updatetime.html roofdate=post.rkupdate %}]
{% endif %}
</p>
</div>
<hr>
{% endfor %}
<div style="font-size: 16px;width: 100%;height: 10px;"></div>
<!-- <hr style="width: 100%;height: 6px;background-color: #B6C29A"> -->
<!-- 普通文章 -->
{% for post in paginator.posts %}
{% if post.stickie == true %}
{% continue %}
{% endif %}
{% assign year = post.date | date:'%Y' %}
<div class="post-preview">
<a href="{{ post.url | prepend: site.baseurl }}">
<h2 class="post-title">
{{ post.title }}
</h2>
{% if post.subtitle %}
<h3 class="post-subtitle">
{{ post.subtitle }}
</h3>
{% endif %}
<div class="post-content-preview">
{{ post.content | strip_html | truncate:200 }}
</div>
</a>
<!-- <p class="post-meta">
Posted by {% if post.author %}{{ post.author }}{% else %}{{ site.title }}{% endif %} on {{ post.date | date: "%B %-d, %Y" }}
</p> -->
<!-- <p class="post-meta">{% if post.author %}{{ post.author }}{% else %}{{ site.title }}{% endif %} on {{ post.date | date: "%m %-d, %Y" }}
</p> -->
<p class="post-meta">{{ post.date | date: "%Y/%-m/%-d %H:%M" }}</p>
</div>
<hr>
{% endfor %}
<!-- Pager -->
{% if paginator.total_pages > 1 %}
<ul class="pager">
<!-- 上一页 -->
{% if paginator.previous_page %}
<li class="previous">
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">←上一页</a>
</li>
{% else %}
<li class="previous">
<span class="page-nosel">上一页</span>
</li>
{% endif %}
<!-- 中间 -->
<!-- <span class="page_num pagination__page-number">{{ paginator.page }} / {{ paginator.total_pages }}</span> -->
<span class="pager-show-less">{{ paginator.page }} / {{ paginator.total_pages }}</span>
<span class="pager-show-greater">
{% for page in (1..paginator.total_pages) %}
{% if page == 1 %}
<li class="pagelist">
{% if page == paginator.page %}
<span class="pagesel">
<a class="pagelist-cur-first" onclick="return false">{{ page }}</a>
</span>
{% else %}
<a class="pagelist-first" href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}
</a>
{% endif %}
</li>
{% elsif page == paginator.total_pages %}
<li class="pagelist">
{% if page == paginator.page %}
<span class="pagesel">
<a class="pagelist-cur-last" onclick="return false">{{ page }}</a>
</span>
{% else %}
<a class="pagelist-last" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
{% endif %}
</li>
{% else %}
<li class="pagelist">
{% if page == paginator.page %}
<span class="pagesel">
<a class="pagelist-cur" onclick="return false">{{ page }}</a>
</span>
{% else %}
<a class="pagelist-other" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}
</a>
{% endif %}
</li>
{% endif %}
{% endfor %}
</span>
<!-- 下一页 -->
{% if paginator.next_page %}
<li class="next">
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">下一页→</a>
</li>
{% else %}
<li class="next">
<span class="page-nosel">下一页</span>
</li>
{% endif %}
</ul>
{% endif %}
<script type="text/javascript">
var less = document.getElementsByClassName("pager-show-less")[0];
var greater = document.getElementsByClassName("pager-show-greater")[0];
var w_width = document.body.clientWidth;
//console.log('===='+less+'------'+greater+'000000---'+w_width);
// var lessStyle = window.getComputedStyle(less);
// var greaterStyle = window.getComputedStyle(greater);
if(w_width >= 400){
greater.style.display = "";
less.style.display = "none";
}else{
less.style.display = "";
greater.style.display = "none";
}
</script>