-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
141 lines (133 loc) · 4.98 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
---
layout: default
class: home
comments: false
menu: cd ~
---
<style>
.my-pagination {
margin-right: .0em;
border-radius: .3em !important;
}
.substation-link {
}
.substation {
height: 20px;
line-height: 20px;
font-size: 18px;
}
.substation span {
display: inline-block;
vertical-align: middle;
}
.substation-ico {
height: 20px;
vertical-align: middle;
margin-right: 5px;
}
@media all {
.substation {
height: 1em;
line-height: 1em;
font-size: 1em;
}
.substation-ico {
height: 1em;
}
}
</style>
<link rel="stylesheet" href="{{ site.cdn }}/assets/css/pages/index.css">
<section class="banner">
<div class="collection-head">
<div class="container">
<div class="collection-title">
<div class="collection-info"></div>
</div>
</div>
</div>
</section>
<!-- /.banner -->
<section class="container content">
<div class="columns">
<div class="column two-thirds" >
<ol class="repo-list">
{% for post in paginator.posts %}
<li class="repo-list-item">
<h3 class="repo-list-name">
<a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a>
</h3>
<p class="repo-list-description">
{{ post.excerpt | strip_html | strip }}
</p>
<p class="repo-list-meta">
<span class="meta-info">
<span class="octicon octicon-calendar"></span> {{ post.date | date: "%Y/%m/%d" }}
</span>
{% for cat in post.categories %}
<span class="meta-info">
<span class="octicon octicon-file-directory"></span>
<a href="{{ site.url }}/categories/#{{ cat }}" title="{{ cat }}">{{ cat }}</a>
</span>
{% endfor %}
</p>
</li>
{% endfor %}
</ol>
</div>
<div class="column one-third">
{% include sidebar-search.html %}
</div>
</div>
<div class="pagination text-align">
<div class="btn-group">
{% if 1 != paginator.page %}
<a href="{{ site.url }}" class="my-pagination btn btn-outline">First</a>
{% else %}
<button disabled="disabled" href="javascript:;" class="my-pagination btn btn-outline">First</button>
{% endif %}
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<a href="{{ site.url }}/" class="my-pagination btn btn-outline">Prev</a>
{% else %}
<a href="{{ site.url }}/page{{paginator.previous_page}}/" class="my-pagination btn btn-outline">Prev</a>
{% endif %}
{% else %}
<button disabled="disabled" href="javascript:;" class="my-pagination btn btn-outline">Prev</button>
{% endif %}
<a href="javascript:;" class="my-pagination active btn btn-outline">{{ paginator.page }}</a>
{% if paginator.next_page %}
<a href="{{ site.url }}/page{{paginator.next_page}}/" class="my-pagination btn btn-outline">Next</a>
{% else %}
<button disabled="disabled" href="javascript:;" class="my-pagination btn btn-outline">Next</button>
{% endif %}
{% if paginator.total_pages != paginator.page %}
<a href="{{ site.url }}/page{{paginator.total_pages}}/" data-page="{{ paginator.total_pages }}" id="lastpage" class="my-pagination btn btn-outline">Last</a>
{% else %}
<button disabled="disabled" href="javascript:;" data-page="{{ paginator.total_pages }}" id="lastpage" class="my-pagination btn btn-outline">Last</button>
{% endif %}
<input type="number" id="pagenum" class="my-pagination" max="999" style="width: 50px" placeholder="Page">
<input type="hidden" id="siteurl" value="{{ site.url }}">
</div>
</div>
<!-- /pagination -->
</section>
<!-- /section.content -->
<script>
// 分页
var page = document.getElementById('pagenum');
var lastpage = Number(document.getElementById('lastpage').getAttribute('data-page'));
var siteurl = document.getElementById('siteurl').value;
page.onkeyup = function() {
if (page.value.length > 3) {
page.value = page.value.replace(/^(\d{3}).*?$/g, '$1');
}
}
page.onblur = function() {
pagenum = Number(page.value);
if (pagenum > 1 && pagenum <= lastpage) {
location.href = siteurl + '/page' + pagenum;
} else if (pagenum == 1) {
location.href = siteurl;
}
}
</script>