jekyll-theme-abd3lraouf 5.2.6 → 5.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -21
- data/README.md +105 -105
- data/_data/assets/cross_origin.yml +62 -62
- data/_data/assets/self_host.yml +51 -51
- data/_data/authors.yml +17 -17
- data/_data/contact.yml +30 -30
- data/_data/locales/bg-BG.yml +83 -83
- data/_data/locales/en.yml +83 -83
- data/_data/locales/es-ES.yml +79 -79
- data/_data/locales/fr-FR.yml +79 -79
- data/_data/locales/hu-HU.yml +81 -81
- data/_data/locales/id-ID.yml +79 -79
- data/_data/locales/ko-KR.yml +79 -79
- data/_data/locales/my-MM.yml +79 -79
- data/_data/locales/pt-BR.yml +79 -79
- data/_data/locales/ru-RU.yml +79 -79
- data/_data/locales/tr-TR.yml +79 -79
- data/_data/locales/uk-UA.yml +79 -79
- data/_data/locales/vi-VN.yml +77 -77
- data/_data/locales/zh-CN.yml +78 -78
- data/_data/share.yml +27 -27
- data/_includes/assets-origin.html +12 -12
- data/_includes/comments/disqus.html +54 -54
- data/_includes/comments/giscus.html +56 -56
- data/_includes/comments/utterances.html +51 -51
- data/_includes/comments.html +5 -5
- data/_includes/datetime.html +21 -21
- data/_includes/favicons.html +17 -17
- data/_includes/footer.html +17 -36
- data/_includes/google-analytics.html +14 -14
- data/_includes/head.html +116 -116
- data/_includes/js-selector.html +104 -104
- data/_includes/jsdelivr-combine.html +32 -32
- data/_includes/lang.html +8 -8
- data/_includes/language-alias.html +70 -70
- data/_includes/mermaid.html +57 -57
- data/_includes/mode-toggle.html +129 -129
- data/_includes/no-linenos.html +10 -10
- data/_includes/post-nav.html +30 -30
- data/_includes/post-paginator.html +88 -88
- data/_includes/post-sharing.html +27 -27
- data/_includes/read-time.html +30 -30
- data/_includes/refactor-content.html +282 -282
- data/_includes/related-posts.html +103 -103
- data/_includes/search-loader.html +46 -46
- data/_includes/search-results.html +11 -11
- data/_includes/sidebar.html +93 -93
- data/_includes/toc.html +16 -16
- data/_includes/topbar.html +70 -70
- data/_includes/trending-tags.html +50 -50
- data/_includes/update-list.html +40 -40
- data/_layouts/archives.html +48 -48
- data/_layouts/categories.html +120 -120
- data/_layouts/category.html +24 -24
- data/_layouts/compress.html +10 -10
- data/_layouts/default.html +74 -74
- data/_layouts/home.html +103 -103
- data/_layouts/page.html +64 -64
- data/_layouts/post.html +159 -159
- data/_layouts/tag.html +23 -23
- data/_layouts/tags.html +23 -23
- data/_plugins/posts-lastmod-hook.rb +14 -14
- data/_sass/addon/commons.scss +1694 -1680
- data/_sass/addon/module.scss +151 -151
- data/_sass/addon/syntax.scss +289 -289
- data/_sass/addon/variables.scss +34 -34
- data/_sass/colors/dark-syntax.scss +88 -88
- data/_sass/colors/dark-typography.scss +157 -157
- data/_sass/colors/light-syntax.scss +84 -84
- data/_sass/colors/light-typography.scss +94 -94
- data/_sass/layout/archives.scss +147 -147
- data/_sass/layout/categories.scss +67 -67
- data/_sass/layout/category-tag.scss +73 -73
- data/_sass/layout/home.scss +184 -184
- data/_sass/layout/post.scss +369 -369
- data/_sass/layout/tags.scss +19 -19
- data/_sass/variables-hook.scss +3 -3
- data/_tabs/about.md +8 -8
- data/_tabs/archives.md +7 -7
- data/_tabs/categories.md +6 -6
- data/_tabs/tags.md +6 -6
- data/assets/404.html +69 -16
- data/assets/css/style.scss +12 -12
- data/assets/feed.xml +61 -61
- data/assets/img/404.png +0 -0
- data/assets/img/favicons/browserconfig.xml +13 -13
- data/assets/img/favicons/site.webmanifest +26 -26
- data/assets/js/data/search.json +18 -18
- data/assets/js/data/swcache.js +55 -55
- data/assets/js/pwa/app.js +47 -47
- data/assets/js/pwa/sw.js +89 -89
- data/assets/js/pwa/unregister.js +12 -12
- data/assets/robots.txt +10 -10
- data/index.html +4 -4
- metadata +8 -7
data/_includes/mode-toggle.html
CHANGED
@@ -1,129 +1,129 @@
|
|
1
|
-
<!--
|
2
|
-
Switch the mode between dark and light.
|
3
|
-
-->
|
4
|
-
|
5
|
-
<script type="text/javascript">
|
6
|
-
class ModeToggle {
|
7
|
-
static get MODE_KEY() { return "mode"; }
|
8
|
-
static get MODE_ATTR() { return "data-mode"; }
|
9
|
-
static get DARK_MODE() { return "dark"; }
|
10
|
-
static get LIGHT_MODE() { return "light"; }
|
11
|
-
static get ID() { return "mode-toggle"; }
|
12
|
-
|
13
|
-
constructor() {
|
14
|
-
if (this.hasMode) {
|
15
|
-
if (this.isDarkMode) {
|
16
|
-
if (!this.isSysDarkPrefer) {
|
17
|
-
this.setDark();
|
18
|
-
}
|
19
|
-
} else {
|
20
|
-
if (this.isSysDarkPrefer) {
|
21
|
-
this.setLight();
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
let self = this;
|
27
|
-
|
28
|
-
/* always follow the system prefers */
|
29
|
-
this.sysDarkPrefers.addEventListener("change", () => {
|
30
|
-
if (self.hasMode) {
|
31
|
-
if (self.isDarkMode) {
|
32
|
-
if (!self.isSysDarkPrefer) {
|
33
|
-
self.setDark();
|
34
|
-
}
|
35
|
-
|
36
|
-
} else {
|
37
|
-
if (self.isSysDarkPrefer) {
|
38
|
-
self.setLight();
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
self.clearMode();
|
43
|
-
}
|
44
|
-
|
45
|
-
self.notify();
|
46
|
-
|
47
|
-
});
|
48
|
-
|
49
|
-
} /* constructor() */
|
50
|
-
|
51
|
-
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
52
|
-
|
53
|
-
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
54
|
-
|
55
|
-
get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
|
56
|
-
|
57
|
-
get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
|
58
|
-
|
59
|
-
get hasMode() { return this.mode != null; }
|
60
|
-
|
61
|
-
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
62
|
-
|
63
|
-
/* get the current mode on screen */
|
64
|
-
get modeStatus() {
|
65
|
-
if (this.isDarkMode
|
66
|
-
|| (!this.hasMode && this.isSysDarkPrefer)) {
|
67
|
-
return ModeToggle.DARK_MODE;
|
68
|
-
} else {
|
69
|
-
return ModeToggle.LIGHT_MODE;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
setDark() {
|
74
|
-
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.DARK_MODE);
|
75
|
-
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
76
|
-
}
|
77
|
-
|
78
|
-
setLight() {
|
79
|
-
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.LIGHT_MODE);
|
80
|
-
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
|
81
|
-
}
|
82
|
-
|
83
|
-
clearMode() {
|
84
|
-
$('html').removeAttr(ModeToggle.MODE_ATTR);
|
85
|
-
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
86
|
-
}
|
87
|
-
|
88
|
-
/* Notify another plugins that the theme mode has changed */
|
89
|
-
notify() {
|
90
|
-
window.postMessage({
|
91
|
-
direction: ModeToggle.ID,
|
92
|
-
message: this.modeStatus
|
93
|
-
}, "*");
|
94
|
-
}
|
95
|
-
|
96
|
-
} /* ModeToggle */
|
97
|
-
|
98
|
-
const toggle = new ModeToggle();
|
99
|
-
|
100
|
-
function flipMode() {
|
101
|
-
if (toggle.hasMode) {
|
102
|
-
if (toggle.isSysDarkPrefer) {
|
103
|
-
if (toggle.isLightMode) {
|
104
|
-
toggle.clearMode();
|
105
|
-
} else {
|
106
|
-
toggle.setLight();
|
107
|
-
}
|
108
|
-
|
109
|
-
} else {
|
110
|
-
if (toggle.isDarkMode) {
|
111
|
-
toggle.clearMode();
|
112
|
-
} else {
|
113
|
-
toggle.setDark();
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
} else {
|
118
|
-
if (toggle.isSysDarkPrefer) {
|
119
|
-
toggle.setLight();
|
120
|
-
} else {
|
121
|
-
toggle.setDark();
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
toggle.notify();
|
126
|
-
|
127
|
-
} /* flipMode() */
|
128
|
-
|
129
|
-
</script>
|
1
|
+
<!--
|
2
|
+
Switch the mode between dark and light.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<script type="text/javascript">
|
6
|
+
class ModeToggle {
|
7
|
+
static get MODE_KEY() { return "mode"; }
|
8
|
+
static get MODE_ATTR() { return "data-mode"; }
|
9
|
+
static get DARK_MODE() { return "dark"; }
|
10
|
+
static get LIGHT_MODE() { return "light"; }
|
11
|
+
static get ID() { return "mode-toggle"; }
|
12
|
+
|
13
|
+
constructor() {
|
14
|
+
if (this.hasMode) {
|
15
|
+
if (this.isDarkMode) {
|
16
|
+
if (!this.isSysDarkPrefer) {
|
17
|
+
this.setDark();
|
18
|
+
}
|
19
|
+
} else {
|
20
|
+
if (this.isSysDarkPrefer) {
|
21
|
+
this.setLight();
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
let self = this;
|
27
|
+
|
28
|
+
/* always follow the system prefers */
|
29
|
+
this.sysDarkPrefers.addEventListener("change", () => {
|
30
|
+
if (self.hasMode) {
|
31
|
+
if (self.isDarkMode) {
|
32
|
+
if (!self.isSysDarkPrefer) {
|
33
|
+
self.setDark();
|
34
|
+
}
|
35
|
+
|
36
|
+
} else {
|
37
|
+
if (self.isSysDarkPrefer) {
|
38
|
+
self.setLight();
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
self.clearMode();
|
43
|
+
}
|
44
|
+
|
45
|
+
self.notify();
|
46
|
+
|
47
|
+
});
|
48
|
+
|
49
|
+
} /* constructor() */
|
50
|
+
|
51
|
+
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
52
|
+
|
53
|
+
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
54
|
+
|
55
|
+
get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
|
56
|
+
|
57
|
+
get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
|
58
|
+
|
59
|
+
get hasMode() { return this.mode != null; }
|
60
|
+
|
61
|
+
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
62
|
+
|
63
|
+
/* get the current mode on screen */
|
64
|
+
get modeStatus() {
|
65
|
+
if (this.isDarkMode
|
66
|
+
|| (!this.hasMode && this.isSysDarkPrefer)) {
|
67
|
+
return ModeToggle.DARK_MODE;
|
68
|
+
} else {
|
69
|
+
return ModeToggle.LIGHT_MODE;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
setDark() {
|
74
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.DARK_MODE);
|
75
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
76
|
+
}
|
77
|
+
|
78
|
+
setLight() {
|
79
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.LIGHT_MODE);
|
80
|
+
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
|
81
|
+
}
|
82
|
+
|
83
|
+
clearMode() {
|
84
|
+
$('html').removeAttr(ModeToggle.MODE_ATTR);
|
85
|
+
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
86
|
+
}
|
87
|
+
|
88
|
+
/* Notify another plugins that the theme mode has changed */
|
89
|
+
notify() {
|
90
|
+
window.postMessage({
|
91
|
+
direction: ModeToggle.ID,
|
92
|
+
message: this.modeStatus
|
93
|
+
}, "*");
|
94
|
+
}
|
95
|
+
|
96
|
+
} /* ModeToggle */
|
97
|
+
|
98
|
+
const toggle = new ModeToggle();
|
99
|
+
|
100
|
+
function flipMode() {
|
101
|
+
if (toggle.hasMode) {
|
102
|
+
if (toggle.isSysDarkPrefer) {
|
103
|
+
if (toggle.isLightMode) {
|
104
|
+
toggle.clearMode();
|
105
|
+
} else {
|
106
|
+
toggle.setLight();
|
107
|
+
}
|
108
|
+
|
109
|
+
} else {
|
110
|
+
if (toggle.isDarkMode) {
|
111
|
+
toggle.clearMode();
|
112
|
+
} else {
|
113
|
+
toggle.setDark();
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
} else {
|
118
|
+
if (toggle.isSysDarkPrefer) {
|
119
|
+
toggle.setLight();
|
120
|
+
} else {
|
121
|
+
toggle.setDark();
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
toggle.notify();
|
126
|
+
|
127
|
+
} /* flipMode() */
|
128
|
+
|
129
|
+
</script>
|
data/_includes/no-linenos.html
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
{% comment %}
|
2
|
-
Remove the line number of the code snippet.
|
3
|
-
{% endcomment %}
|
4
|
-
|
5
|
-
{% assign content = include.content %}
|
6
|
-
|
7
|
-
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
|
8
|
-
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
|
9
|
-
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
|
10
|
-
{% endif %}
|
1
|
+
{% comment %}
|
2
|
+
Remove the line number of the code snippet.
|
3
|
+
{% endcomment %}
|
4
|
+
|
5
|
+
{% assign content = include.content %}
|
6
|
+
|
7
|
+
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
|
8
|
+
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
|
9
|
+
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
|
10
|
+
{% endif %}
|
data/_includes/post-nav.html
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
<!--
|
2
|
-
Navigation buttons at the bottom of the post.
|
3
|
-
-->
|
4
|
-
|
5
|
-
<div class="post-navigation d-flex justify-content-between">
|
6
|
-
{% if page.previous.url %}
|
7
|
-
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
8
|
-
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
9
|
-
<p>{{ page.previous.title }}</p>
|
10
|
-
</a>
|
11
|
-
{% else %}
|
12
|
-
<div class="btn btn-outline-primary disabled"
|
13
|
-
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
14
|
-
<p>-</p>
|
15
|
-
</div>
|
16
|
-
{% endif %}
|
17
|
-
|
18
|
-
{% if page.next.url %}
|
19
|
-
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
20
|
-
prompt="{{ site.data.locales[lang].post.button.next }}">
|
21
|
-
<p>{{ page.next.title }}</p>
|
22
|
-
</a>
|
23
|
-
{% else %}
|
24
|
-
<div class="btn btn-outline-primary disabled"
|
25
|
-
prompt="{{ site.data.locales[lang].post.button.next }}">
|
26
|
-
<p>-</p>
|
27
|
-
</div>
|
28
|
-
{% endif %}
|
29
|
-
|
30
|
-
</div>
|
1
|
+
<!--
|
2
|
+
Navigation buttons at the bottom of the post.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<div class="post-navigation d-flex justify-content-between">
|
6
|
+
{% if page.previous.url %}
|
7
|
+
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
8
|
+
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
9
|
+
<p>{{ page.previous.title }}</p>
|
10
|
+
</a>
|
11
|
+
{% else %}
|
12
|
+
<div class="btn btn-outline-primary disabled"
|
13
|
+
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
14
|
+
<p>-</p>
|
15
|
+
</div>
|
16
|
+
{% endif %}
|
17
|
+
|
18
|
+
{% if page.next.url %}
|
19
|
+
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
20
|
+
prompt="{{ site.data.locales[lang].post.button.next }}">
|
21
|
+
<p>{{ page.next.title }}</p>
|
22
|
+
</a>
|
23
|
+
{% else %}
|
24
|
+
<div class="btn btn-outline-primary disabled"
|
25
|
+
prompt="{{ site.data.locales[lang].post.button.next }}">
|
26
|
+
<p>-</p>
|
27
|
+
</div>
|
28
|
+
{% endif %}
|
29
|
+
|
30
|
+
</div>
|
@@ -1,88 +1,88 @@
|
|
1
|
-
<!--
|
2
|
-
The paginator for post list on HomgPage.
|
3
|
-
-->
|
4
|
-
|
5
|
-
<ul class="pagination align-items-center mt-4 mb-5 pl-lg-2">
|
6
|
-
<!-- left arrow -->
|
7
|
-
{% if paginator.previous_page %}
|
8
|
-
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
9
|
-
{% else %}
|
10
|
-
{% assign prev_url = "#" %}
|
11
|
-
{% endif %}
|
12
|
-
|
13
|
-
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
|
14
|
-
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
|
15
|
-
<i class="fas fa-angle-left"></i>
|
16
|
-
</a>
|
17
|
-
</li>
|
18
|
-
|
19
|
-
<!-- page numbers -->
|
20
|
-
{% assign left_ellipsis = false %}
|
21
|
-
{% assign right_ellipsis = false %}
|
22
|
-
|
23
|
-
{% for i in (1..paginator.total_pages) %}
|
24
|
-
|
25
|
-
{% assign pre = paginator.page | minus: 1 %}
|
26
|
-
{% assign next = paginator.page | plus: 1 %}
|
27
|
-
{% assign pre_less = pre | minus: 1 %}
|
28
|
-
{% assign next_more = next | plus: 1 %}
|
29
|
-
{% assign show = false %}
|
30
|
-
|
31
|
-
{% if paginator.page == 1 %}
|
32
|
-
{% if i <= 3 or i == paginator.total_pages %}
|
33
|
-
{% assign show = true %}
|
34
|
-
{% endif %}
|
35
|
-
{% elsif paginator.page == paginator.total_pages %}
|
36
|
-
{% if i == 1 or i >= pre_less %}
|
37
|
-
{% assign show = true %}
|
38
|
-
{% endif %}
|
39
|
-
{% else %}
|
40
|
-
{% if i == 1 or i == paginator.total_pages%}
|
41
|
-
{% assign show = true %}
|
42
|
-
{% elsif i >= pre and i <= next %}
|
43
|
-
{% assign show = true %}
|
44
|
-
{% endif %}
|
45
|
-
{% endif %}
|
46
|
-
|
47
|
-
{% if show %}
|
48
|
-
<!-- show number -->
|
49
|
-
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
50
|
-
<a class="page-link btn-box-shadow" href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}">{{ i }}</a>
|
51
|
-
</li>
|
52
|
-
{% else %}
|
53
|
-
<!-- hide number -->
|
54
|
-
{% if i < pre and left_ellipsis == false %}
|
55
|
-
<li class="page-item disabled">
|
56
|
-
<span class="page-link btn-box-shadow">...</span>
|
57
|
-
</li>
|
58
|
-
{% assign left_ellipsis = true %}
|
59
|
-
{% elsif i > next and right_ellipsis == false %}
|
60
|
-
<li class="page-item disabled">
|
61
|
-
<span class="page-link btn-box-shadow">...</span>
|
62
|
-
</li>
|
63
|
-
{% assign right_ellipsis = true %}
|
64
|
-
{% endif %}
|
65
|
-
{% endif %}
|
66
|
-
|
67
|
-
{% endfor %}
|
68
|
-
|
69
|
-
<!-- mobile pagination -->
|
70
|
-
<li class="page-index align-middle">
|
71
|
-
<span>{{ paginator.page }}</span>
|
72
|
-
<span class="text-muted">/ {{ paginator.total_pages }}</span>
|
73
|
-
</li>
|
74
|
-
|
75
|
-
<!-- right arrow -->
|
76
|
-
{% if paginator.next_page_path %}
|
77
|
-
{% assign next_url = paginator.next_page_path | relative_url %}
|
78
|
-
{% else %}
|
79
|
-
{% assign next_url = "#" %}
|
80
|
-
{% endif %}
|
81
|
-
|
82
|
-
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
|
83
|
-
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
|
84
|
-
<i class="fas fa-angle-right"></i>
|
85
|
-
</a>
|
86
|
-
</li>
|
87
|
-
|
88
|
-
</ul> <!-- .pagination -->
|
1
|
+
<!--
|
2
|
+
The paginator for post list on HomgPage.
|
3
|
+
-->
|
4
|
+
|
5
|
+
<ul class="pagination align-items-center mt-4 mb-5 pl-lg-2">
|
6
|
+
<!-- left arrow -->
|
7
|
+
{% if paginator.previous_page %}
|
8
|
+
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
9
|
+
{% else %}
|
10
|
+
{% assign prev_url = "#" %}
|
11
|
+
{% endif %}
|
12
|
+
|
13
|
+
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
|
14
|
+
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
|
15
|
+
<i class="fas fa-angle-left"></i>
|
16
|
+
</a>
|
17
|
+
</li>
|
18
|
+
|
19
|
+
<!-- page numbers -->
|
20
|
+
{% assign left_ellipsis = false %}
|
21
|
+
{% assign right_ellipsis = false %}
|
22
|
+
|
23
|
+
{% for i in (1..paginator.total_pages) %}
|
24
|
+
|
25
|
+
{% assign pre = paginator.page | minus: 1 %}
|
26
|
+
{% assign next = paginator.page | plus: 1 %}
|
27
|
+
{% assign pre_less = pre | minus: 1 %}
|
28
|
+
{% assign next_more = next | plus: 1 %}
|
29
|
+
{% assign show = false %}
|
30
|
+
|
31
|
+
{% if paginator.page == 1 %}
|
32
|
+
{% if i <= 3 or i == paginator.total_pages %}
|
33
|
+
{% assign show = true %}
|
34
|
+
{% endif %}
|
35
|
+
{% elsif paginator.page == paginator.total_pages %}
|
36
|
+
{% if i == 1 or i >= pre_less %}
|
37
|
+
{% assign show = true %}
|
38
|
+
{% endif %}
|
39
|
+
{% else %}
|
40
|
+
{% if i == 1 or i == paginator.total_pages%}
|
41
|
+
{% assign show = true %}
|
42
|
+
{% elsif i >= pre and i <= next %}
|
43
|
+
{% assign show = true %}
|
44
|
+
{% endif %}
|
45
|
+
{% endif %}
|
46
|
+
|
47
|
+
{% if show %}
|
48
|
+
<!-- show number -->
|
49
|
+
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
50
|
+
<a class="page-link btn-box-shadow" href="{% if i > 1 %}{{ site.paginate_path | replace: ':num', i | relative_url }}{% else %}{{ '/' | relative_url }}{% endif %}">{{ i }}</a>
|
51
|
+
</li>
|
52
|
+
{% else %}
|
53
|
+
<!-- hide number -->
|
54
|
+
{% if i < pre and left_ellipsis == false %}
|
55
|
+
<li class="page-item disabled">
|
56
|
+
<span class="page-link btn-box-shadow">...</span>
|
57
|
+
</li>
|
58
|
+
{% assign left_ellipsis = true %}
|
59
|
+
{% elsif i > next and right_ellipsis == false %}
|
60
|
+
<li class="page-item disabled">
|
61
|
+
<span class="page-link btn-box-shadow">...</span>
|
62
|
+
</li>
|
63
|
+
{% assign right_ellipsis = true %}
|
64
|
+
{% endif %}
|
65
|
+
{% endif %}
|
66
|
+
|
67
|
+
{% endfor %}
|
68
|
+
|
69
|
+
<!-- mobile pagination -->
|
70
|
+
<li class="page-index align-middle">
|
71
|
+
<span>{{ paginator.page }}</span>
|
72
|
+
<span class="text-muted">/ {{ paginator.total_pages }}</span>
|
73
|
+
</li>
|
74
|
+
|
75
|
+
<!-- right arrow -->
|
76
|
+
{% if paginator.next_page_path %}
|
77
|
+
{% assign next_url = paginator.next_page_path | relative_url %}
|
78
|
+
{% else %}
|
79
|
+
{% assign next_url = "#" %}
|
80
|
+
{% endif %}
|
81
|
+
|
82
|
+
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
|
83
|
+
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
|
84
|
+
<i class="fas fa-angle-right"></i>
|
85
|
+
</a>
|
86
|
+
</li>
|
87
|
+
|
88
|
+
</ul> <!-- .pagination -->
|
data/_includes/post-sharing.html
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
<!--
|
2
|
-
Post sharing snippet
|
3
|
-
-->
|
4
|
-
|
5
|
-
<div class="share-wrapper">
|
6
|
-
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
|
7
|
-
<span class="share-icons">
|
8
|
-
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
9
|
-
{% assign title = title | url_encode %}
|
10
|
-
{% assign url = page.url | absolute_url | url_encode %}
|
11
|
-
|
12
|
-
{% for share in site.data.share.platforms %}
|
13
|
-
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
14
|
-
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
15
|
-
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
16
|
-
<i class="fa-fw {{ share.icon }}"></i>
|
17
|
-
</a>
|
18
|
-
{% endfor %}
|
19
|
-
|
20
|
-
<i id="copy-link" class="fa-fw fas fa-link small"
|
21
|
-
data-toggle="tooltip" data-placement="top"
|
22
|
-
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
23
|
-
data-title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
24
|
-
</i>
|
25
|
-
|
26
|
-
</span>
|
27
|
-
</div>
|
1
|
+
<!--
|
2
|
+
Post sharing snippet
|
3
|
+
-->
|
4
|
+
|
5
|
+
<div class="share-wrapper">
|
6
|
+
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
|
7
|
+
<span class="share-icons">
|
8
|
+
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
9
|
+
{% assign title = title | url_encode %}
|
10
|
+
{% assign url = page.url | absolute_url | url_encode %}
|
11
|
+
|
12
|
+
{% for share in site.data.share.platforms %}
|
13
|
+
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
14
|
+
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
15
|
+
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
16
|
+
<i class="fa-fw {{ share.icon }}"></i>
|
17
|
+
</a>
|
18
|
+
{% endfor %}
|
19
|
+
|
20
|
+
<i id="copy-link" class="fa-fw fas fa-link small"
|
21
|
+
data-toggle="tooltip" data-placement="top"
|
22
|
+
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
23
|
+
data-title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
24
|
+
</i>
|
25
|
+
|
26
|
+
</span>
|
27
|
+
</div>
|
data/_includes/read-time.html
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
<!--
|
2
|
-
Calculate the post's reading time, and display the word count in tooltip
|
3
|
-
-->
|
4
|
-
|
5
|
-
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
6
|
-
|
7
|
-
<!-- words per minute -->
|
8
|
-
|
9
|
-
{% assign wpm = 180 %}
|
10
|
-
{% assign min_time = 1 %}
|
11
|
-
|
12
|
-
{% assign read_time = words | divided_by: wpm %}
|
13
|
-
|
14
|
-
{% unless read_time > 0 %}
|
15
|
-
{% assign read_time = min_time %}
|
16
|
-
{% endunless %}
|
17
|
-
|
18
|
-
{% capture read_prompt %}
|
19
|
-
{{- site.data.locales[lang].post.read_time.prompt -}}
|
20
|
-
{% endcapture %}
|
21
|
-
|
22
|
-
<!-- return element -->
|
23
|
-
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
24
|
-
title="{{ words }} {{ site.data.locales[lang].post.words }}">
|
25
|
-
<em>{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}</em>
|
26
|
-
{%- if include.prompt -%}
|
27
|
-
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
|
28
|
-
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
|
29
|
-
{%- endif -%}
|
30
|
-
</span>
|
1
|
+
<!--
|
2
|
+
Calculate the post's reading time, and display the word count in tooltip
|
3
|
+
-->
|
4
|
+
|
5
|
+
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
6
|
+
|
7
|
+
<!-- words per minute -->
|
8
|
+
|
9
|
+
{% assign wpm = 180 %}
|
10
|
+
{% assign min_time = 1 %}
|
11
|
+
|
12
|
+
{% assign read_time = words | divided_by: wpm %}
|
13
|
+
|
14
|
+
{% unless read_time > 0 %}
|
15
|
+
{% assign read_time = min_time %}
|
16
|
+
{% endunless %}
|
17
|
+
|
18
|
+
{% capture read_prompt %}
|
19
|
+
{{- site.data.locales[lang].post.read_time.prompt -}}
|
20
|
+
{% endcapture %}
|
21
|
+
|
22
|
+
<!-- return element -->
|
23
|
+
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
24
|
+
title="{{ words }} {{ site.data.locales[lang].post.words }}">
|
25
|
+
<em>{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}</em>
|
26
|
+
{%- if include.prompt -%}
|
27
|
+
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
|
28
|
+
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
|
29
|
+
{%- endif -%}
|
30
|
+
</span>
|