-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
94 lines (91 loc) · 5.19 KB
/
index.html
File metadata and controls
94 lines (91 loc) · 5.19 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
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
---
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 %}
<h2><span class="badge text-bg-primary align-text-bottom">置顶</span>
<a href="{{ post.url | prepend: site.baseurl }}" class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover">{{ post.title }}</a></h2>
<div class="fw-bold text-nowrap mb-2">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d %H:%M:%S"}}
</div>
<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>
{% if post.categories.size > 0 %}
<span class="text-nowrap"><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 class="text-nowrap"><i data-feather="tag"></i>{% for tag in post.tags %}<a href="/tag#{{ tag }}"><span class="badge text-bg-primary align-text-bottom">{{ tag }}</span></a>
{% endfor %}
</span>
{% endif %}
{% if post.issue %}
<span class="text-nowrap">
<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 align-text-bottom"></span>
</span>
{% endif %}
<div class="mb-4"> </div>
{% endfor %}
{% endif %}
{% for post in paginator.posts %}
{% unless post.is_sticky %}
<h2><a href="{{ post.url | prepend: site.baseurl }}" class="link-underline link-underline-opacity-0 link-underline-opacity-100-hover">{{ post.title }}</a></h2>
<div class="fw-bold text-nowrap mb-2">
<i data-feather="calendar"></i>{{ post.date | date: "%Y-%m-%d %H:%M:%S"}}
</div>
<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>
{% if post.categories.size > 0 %}
<span class="text-nowrap"><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 class="text-nowrap"><i data-feather="tag"></i>{% for tag in post.tags %}<a href="/tag#{{ tag }}"><span class="badge text-bg-primary align-text-bottom">{{ tag }}</span></a>
{% endfor %}
</span>
{% endif %}
{% if post.issue %}
<span class="text-nowrap">
<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 align-text-bottom"></span>
</span>
{% endif %}
<div class="mb-4"> </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>