-
Notifications
You must be signed in to change notification settings - Fork 3
/
type.html
81 lines (81 loc) · 3.26 KB
/
type.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
---
layout: default
title: "分类"
---
<!-- Bootstrapt 5 completed -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="all-tab" data-bs-toggle="tab" data-bs-target="#all-tab-pane" type="button" role="tab" aria-controls="all-tab-pane" aria-selected="true">所有文章 <span class="badge rounded-pill text-bg-primary">{{ site.posts.size }}</span></button>
</li>
{% for cat in site.categories %}
<li class="nav-item" role="presentation">
<button class="nav-link" id="{{ cat[0] }}-tab" data-bs-toggle="tab" data-bs-target="#{{ cat[0] }}-tab-pane" type="button" role="tab" aria-controls="{{ cat[0] }}-tab-pane" aria-selected="false">{{ cat[0] }} <span class="badge rounded-pill text-bg-primary">{{ cat[1].size }}</span></button>
</li>
{% endfor %}
</ul>
<div class="tab-content text-nowrap overflow-x-auto">
<div class="tab-pane fade show active" id="all-tab-pane" role="tabpanel" aria-labelledby="all-tab" tabindex="0">
<table class="table table-striped">
<thead>
<tr>
<th class="page_list_item"></th><th></th><th></th>
</tr>
</thead>
<tbody>
{% for post in site.posts %}
{% if post.is_sticky %}
<tr>
<td class="text-center">
<span class="badge text-bg-secondary">置顶</span>
</td>
<td>
<a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="{{ post.url }}">{{ post.title }}</a>
</td>
<td class="fw-bold">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d"}}
</td>
</tr>
{% endif %}
{% endfor %}
{% for post in site.posts %}
{% unless post.is_sticky %}
<tr>
<td class="text-center"></td>
<td><a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="{{ post.url }}">{{ post.title }}</a></td>
<td class="fw-bold">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d"}}
</td>
</tr>
{% endunless %}
{% endfor %}
</tbody>
</table>
</div>
{% for cat in site.categories %}
<div class="tab-pane fade" id="{{ cat[0] }}-tab-pane" role="tabpanel" aria-labelledby="{{ cat[0] }}-tab" tabindex="0">
<table class="table table-striped">
<thead>
<tr>
<th class="page_list_item"></th><th></th><th></th>
</tr>
</thead>
<tbody>
{% for post in cat[1] %}
<tr>
<td class="text-center">{% if post.is_sticky %}<span class="label label-default">置顶</span>{% endif %}</td>
<td><a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="{{ post.url }}">{{ post.title }}</a></td>
<td class="fw-bold">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d"}}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
</div>
<script type="text/javascript">
if (location.hash != "") {
new bootstrap.Tab("#" + decodeURI(location.hash.replace("#","")) + "-tab").show();
}
</script>