-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
130 lines (127 loc) · 5.61 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
---
layout: default
use_math: true
use_code: true
use_mermaid: true
---
{% if paginator.page == 1 %}
{% assign sticky_posts = site.posts | where: "is_sticky" ,"true" %}
{% for post in sticky_posts %}
<div class="card mb-3">
<div class="card-header">
<h2 class="mb-0 d-inline">
<span class="badge text-bg-primary">置顶</span>
<a href="{{ post.url | prepend: site.baseurl }}" class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover">
{{ post.title }}
</a>
</h2>
<span class="fw-bold text-nowrap">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d %H:%M:%S"}}
</span>
</div>
<article class="card-body">
{{ post.excerpt | replace: '<li>[ ]', '<li class="post_check list-unstyled"><input type="checkbox" disabled>' | replace: '<li>[x]', '<li class="post_check list-unstyled"><input type="checkbox" disabled checked>' }}
</article>
<div class="card-footer">
{% if post.issue %}
<span>
<i data-feather="message-square"></i><a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="{{ post.url | prepend: site.baseurl }}#comments">评论</a>
<span post-id="{{ post.id }}" comments-count="{{ post.issue }}" class="badge rounded-pill text-bg-primary"></span>
</span>
{% endif %}
{% if post.categories.size > 0 %}
<span>
<i data-feather="folder"></i>{% for cat in post.categories %}{% if cat != 'sticky' %}<a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="/type#{{ cat }}">{{ cat }}</a>
{% endif %}
{% endfor %}
</span>
{% endif %}
{% if post.tags.size > 0 %}
<span>
<i data-feather="tag"></i>
{% for tag in post.tags %}
<a href="/tag#{{ tag }}"><span class="badge text-bg-primary">{{ tag }}</span></a>
{% endfor %}
</span>
{% endif %}
</div>
</div>
{% endfor %}
{% endif %}
{% for post in paginator.posts %}
{% unless post.is_sticky %}
<div class="card mb-3">
<div class="card-header">
<h2 class="mb-0 d-inline">
<a href="{{ post.url | prepend: site.baseurl }}" class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover">
{{ post.title }}
</a>
</h2>
<span class="fw-bold text-nowrap">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d %H:%M:%S"}}
</span>
</div>
<div class="card-body">
<article>
{{ post.excerpt | replace: '<li>[ ]', '<li class="post_check list-unstyled"><input type="checkbox" disabled>' | replace: '<li>[x]', '<li class="post_check list-unstyled"><input type="checkbox" disabled checked>' }}
</article>
</div>
<div class="card-footer">
{% if post.issue %}
<span>
<i data-feather="message-square"></i><a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="{{ post.url | prepend: site.baseurl }}#comments">评论</a>
<span post-id="{{ post.id }}" comments-count="{{ post.issue }}" class="badge rounded-pill text-bg-primary"></span>
</span>
{% endif %}
{% if post.categories.size > 0 %}
<span>
<i data-feather="folder"></i>{% for cat in post.categories %}{% if cat != 'sticky' %}<a class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover" href="/type#{{ cat }}">{{ cat }}</a>
{% endif %}
{% endfor %}
</span>
{% endif %}
{% if post.tags.size > 0 %}
<span>
<i data-feather="tag"></i>
{% for tag in post.tags %}
<a href="/tag#{{ tag }}"><span class="badge text-bg-primary">{{ tag }}</span></a>
{% endfor %}
</span>
{% endif %}
</div>
</div>
{% endunless %}
{% endfor %}
<nav>
<ul class="pagination justify-content-center">
{% if paginator.page < 5 %}
{% for num in (1..paginator.page) %}
<li class="page-item{% if num == paginator.page %} active{% endif %}"><a class="page-link" href={% if num == 1 %}"/"{% else %}"/blog/index/{{num}}/"{% endif %}>{{ num }}</a></li>
{% endfor %}
{% else %}
<li class="page-item"><a class="page-link" href="/">1</a></li>
<li class="page-item disabled"><a class="page-link" href="#">…</a></li>
{% assign startpage = paginator.page | minus: 2 %}
{% for num in (startpage..paginator.page) %}
<li class="page-item{% if num == paginator.page %} active{% endif %}"><a class="page-link" href={% if num == 1 %}"/"{% else %}"/blog/index/{{num}}/"{% endif %}>{{ num }}</a></li>
{% endfor %}
{% endif %}
{% assign remainpage = paginator.total_pages | minus: paginator.page %}
{% if remainpage < 4 %}
{% assign startpage = paginator.page | plus: 1 %}
{% for num in (startpage..paginator.total_pages) %}
<li class="page-item"><a href="/blog/index/{{num}}/">{{ num }}</a></li>
{% endfor %}
{% else %}
{% assign startpage = paginator.page | plus: 1 %}
{% assign endpage = paginator.page | plus: 2 %}
{% for num in (startpage..endpage) %}
<li class="page-item"><a class="page-link" href="/blog/index/{{num}}/">{{ num }}</a></li>
{% endfor %}
<li class="page-item disabled"><a class="page-link" href="#">…</a></li>
<li class="page-item"><a class="page-link" href="/blog/index/{{ paginator.total_pages }}/">{{ paginator.total_pages }}</a></li>
{% endif %}
</ul>
</nav>
<script src="{{ site.baseurl }}/js/old-comments.js"></script>
<script src="{{ site.baseurl }}/js/git-comments-count.js"></script>