Repository navigation
Expand file tree
/
Copy pathdefault.html
More file actions
47 lines (43 loc) · 1.5 KB
/
Copy pathdefault.html
File metadata and controls
47 lines (43 loc) · 1.5 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>{% include head.html %}</head>
<body>
{% include nav.html %}
<div class="container index">
{% for post in paginator.posts %}
<article class="article-item-link" title="{{ post.title }}{{ post.description }}">
<i></i>
<time>{{ post.categories }}</time>
<a class="list-link" href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a>
</article>
{% endfor %}
<!-- Pagination links -->
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="previous">上一页</a>
{% else %}
<span class="previous">上一页</span>
{% endif %}
<span class="page_number ">{{ paginator.page }} of {{ paginator.total_pages }}</span>
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="next">下一页</a>
{% else %}
<span class="next">下一页</span>
{% endif %}
</div>
</div>
{% include foot.html %}
</body>
<script type="text/javascript">
document.querySelector('.search-input').addEventListener('keyup',function(e){
var article = document.getElementsByClassName('article-item-link');
for (var i = 0; i < article.length; i++){
if( article[i].title.toLowerCase().indexOf(this.value.toLowerCase()) > -1 ) {
article[i].closest('article').style.display = '';
} else {
article[i].closest('article').style.display = 'none';
}
}
})
</script>
</html>