jekyll-theme-chirpy 5.0.1 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/_config.yml +38 -13
- data/_data/assets/cross_origin.yml +62 -0
- data/_data/assets/self_host.yml +51 -0
- data/_data/authors.yml +17 -0
- data/_data/locales/en.yml +12 -20
- data/_data/locales/es-ES.yml +79 -0
- data/_data/locales/fr-FR.yml +79 -0
- data/_data/locales/id-ID.yml +4 -16
- data/_data/locales/ko-KR.yml +4 -16
- data/_data/locales/my-MM.yml +79 -0
- data/_data/locales/pt-BR.yml +79 -0
- data/_data/locales/ru-RU.yml +79 -0
- data/_data/locales/uk-UA.yml +79 -0
- data/_data/locales/vi-VN.yml +77 -0
- data/_data/locales/zh-CN.yml +4 -16
- data/_data/share.yml +1 -1
- data/_includes/assets-origin.html +12 -0
- data/_includes/comments/giscus.html +56 -0
- data/_includes/comments/utterances.html +2 -2
- data/_includes/datetime.html +21 -0
- data/_includes/footer.html +5 -6
- data/_includes/head.html +62 -21
- data/_includes/js-selector.html +47 -11
- data/_includes/jsdelivr-combine.html +32 -0
- data/_includes/mermaid.html +3 -3
- data/_includes/mode-toggle.html +4 -3
- data/_includes/post-nav.html +4 -4
- data/_includes/post-paginator.html +2 -2
- data/_includes/post-sharing.html +3 -2
- data/_includes/refactor-content.html +62 -10
- data/_includes/related-posts.html +1 -4
- data/_includes/search-loader.html +1 -1
- data/_includes/sidebar.html +8 -8
- data/_includes/toc.html +1 -1
- data/_includes/topbar.html +3 -4
- data/_layouts/archives.html +15 -6
- data/_layouts/categories.html +25 -4
- data/_layouts/category.html +1 -3
- data/_layouts/default.html +23 -8
- data/_layouts/home.html +4 -8
- data/_layouts/page.html +11 -11
- data/_layouts/post.html +52 -44
- data/_layouts/tag.html +1 -3
- data/_layouts/tags.html +3 -1
- data/_sass/addon/commons.scss +241 -305
- data/_sass/addon/module.scss +33 -17
- data/_sass/addon/syntax.scss +38 -25
- data/_sass/addon/variables.scss +9 -9
- data/_sass/colors/dark-syntax.scss +1 -0
- data/_sass/colors/dark-typography.scss +10 -1
- data/_sass/colors/light-syntax.scss +6 -1
- data/_sass/colors/light-typography.scss +14 -1
- data/_sass/jekyll-theme-chirpy.scss +1 -1
- data/_sass/layout/post.scss +4 -7
- data/_tabs/about.md +2 -2
- data/assets/404.html +0 -17
- data/assets/js/data/search.json +6 -5
- data/assets/js/data/swcache.js +11 -20
- data/assets/js/dist/categories.min.js +2 -2
- data/assets/js/dist/commons.min.js +2 -2
- data/assets/js/dist/home.min.js +2 -2
- data/assets/js/dist/misc.min.js +6 -0
- data/assets/js/dist/page.min.js +2 -2
- data/assets/js/dist/post.min.js +2 -2
- data/assets/js/dist/pvreport.min.js +2 -2
- data/assets/js/pwa/app.js +55 -4
- data/assets/js/pwa/sw.js +42 -40
- data/assets/js/pwa/unregister.js +12 -0
- metadata +20 -7
- data/_includes/css-selector.html +0 -15
- data/_includes/no-zero-date.html +0 -13
- data/_includes/timeago.html +0 -26
data/_includes/js-selector.html
CHANGED
@@ -7,14 +7,43 @@
|
|
7
7
|
{% if page.layout == 'post' %}
|
8
8
|
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
9
9
|
<!-- pv-report needs countup.js -->
|
10
|
-
<script async src="
|
10
|
+
<script async src="{{ site.data.assets[origin].countup.js | relative_url }}"></script>
|
11
11
|
<script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
|
12
12
|
{% endif %}
|
13
13
|
{% endif %}
|
14
14
|
|
15
15
|
{% if page.layout == 'post' or page.layout == 'page' %}
|
16
|
-
<!-- image lazy-loading & popup -->
|
17
|
-
|
16
|
+
<!-- image lazy-loading & popup & clipboard -->
|
17
|
+
{% assign _urls = site.data.assets[origin].magnific-popup.js
|
18
|
+
| append: ',' | append: site.data.assets[origin].lozad.js
|
19
|
+
| append: ',' | append: site.data.assets[origin].clipboard.js
|
20
|
+
%}
|
21
|
+
|
22
|
+
{% include jsdelivr-combine.html urls=_urls %}
|
23
|
+
|
24
|
+
{% endif %}
|
25
|
+
|
26
|
+
{% if page.layout == 'home'
|
27
|
+
or page.layout == 'post'
|
28
|
+
or page.layout == 'archives'
|
29
|
+
or page.layout == 'category'
|
30
|
+
or page.layout == 'tag' %}
|
31
|
+
|
32
|
+
{% if site.prefer_datetime_locale %}
|
33
|
+
{% assign locale = site.prefer_datetime_locale | downcase %}
|
34
|
+
{% else %}
|
35
|
+
{% assign locale = site.lang | split: '-' | first %}
|
36
|
+
{% endif %}
|
37
|
+
|
38
|
+
{% assign _urls = site.data.assets[origin].dayjs.js.common
|
39
|
+
| append: ',' | append: site.data.assets[origin].dayjs.js.locale
|
40
|
+
| replace: ':LOCALE', locale
|
41
|
+
| append: ',' | append: site.data.assets[origin].dayjs.js.relativeTime
|
42
|
+
| append: ',' | append: site.data.assets[origin].dayjs.js.localizedFormat
|
43
|
+
%}
|
44
|
+
|
45
|
+
{% include jsdelivr-combine.html urls=_urls %}
|
46
|
+
|
18
47
|
{% endif %}
|
19
48
|
|
20
49
|
{% if page.layout == 'home'
|
@@ -22,12 +51,16 @@
|
|
22
51
|
or page.layout == 'post'
|
23
52
|
or page.layout == 'page' %}
|
24
53
|
{% assign type = page.layout %}
|
54
|
+
{% elsif page.layout == 'archives'
|
55
|
+
or page.layout == 'category'
|
56
|
+
or page.layout == 'tag' %}
|
57
|
+
{% assign type = "misc" %}
|
25
58
|
{% else %}
|
26
59
|
{% assign type = "commons" %}
|
27
60
|
{% endif %}
|
28
61
|
|
29
|
-
{%
|
30
|
-
<script defer src="{{
|
62
|
+
{% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
|
63
|
+
<script defer src="{{ script | relative_url }}"></script>
|
31
64
|
|
32
65
|
{% if page.math %}
|
33
66
|
<!-- MathJax -->
|
@@ -46,22 +79,25 @@
|
|
46
79
|
}
|
47
80
|
};
|
48
81
|
</script>
|
49
|
-
<script src="
|
50
|
-
<script
|
51
|
-
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
|
82
|
+
<script src="{{ site.data.assets[origin].polyfill.js | relative_url }}"></script>
|
83
|
+
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js | relative_url }}">
|
52
84
|
</script>
|
53
85
|
{% endif %}
|
54
86
|
|
55
87
|
<!-- commons -->
|
56
88
|
|
57
|
-
<script src="
|
89
|
+
<script src="{{ site.data.assets[origin].bootstrap.js | relative_url }}"></script>
|
58
90
|
|
59
91
|
{% if jekyll.environment == 'production' %}
|
60
92
|
<!-- PWA -->
|
61
|
-
|
93
|
+
{% if site.pwa.enabled %}
|
94
|
+
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
95
|
+
{% else %}
|
96
|
+
<script defer src="{{ '/unregister.js' | relative_url }}"></script>
|
97
|
+
{% endif %}
|
62
98
|
|
63
99
|
<!-- GA -->
|
64
|
-
{% if site.google_analytics.id %}
|
100
|
+
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
65
101
|
{% include google-analytics.html %}
|
66
102
|
{% endif %}
|
67
103
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{% assign urls = include.urls | split: ',' %}
|
2
|
+
|
3
|
+
{% assign combined_urls = nil %}
|
4
|
+
|
5
|
+
{% assign domain = 'https://cdn.jsdelivr.net/' %}
|
6
|
+
|
7
|
+
{% for url in urls %}
|
8
|
+
|
9
|
+
{% if url contains domain %}
|
10
|
+
{% assign url_snippet = url | slice: domain.size, url.size %}
|
11
|
+
|
12
|
+
{% if combined_urls %}
|
13
|
+
{% assign combined_urls = combined_urls | append: ',' | append: url_snippet %}
|
14
|
+
{% else %}
|
15
|
+
{% assign combined_urls = domain | append: 'combine/' | append: url_snippet %}
|
16
|
+
{% endif %}
|
17
|
+
|
18
|
+
{% elsif url contains '//' %}
|
19
|
+
|
20
|
+
<script src="{{ url }}"></script>
|
21
|
+
|
22
|
+
{% else %}
|
23
|
+
|
24
|
+
<script src="{{ url | relative_url }}"></script>
|
25
|
+
|
26
|
+
{% endif %}
|
27
|
+
|
28
|
+
{% endfor %}
|
29
|
+
|
30
|
+
{% if combined_urls %}
|
31
|
+
<script src="{{ combined_urls }}"></script>
|
32
|
+
{% endif %}
|
data/_includes/mermaid.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
mermaid-js loader
|
3
3
|
-->
|
4
4
|
|
5
|
-
<script src="
|
5
|
+
<script src="{{ site.data.assets[origin].mermaid.js | relative_url }}"></script>
|
6
6
|
|
7
7
|
<script>
|
8
8
|
$(function() {
|
@@ -33,8 +33,8 @@
|
|
33
33
|
|
34
34
|
let initTheme = "default";
|
35
35
|
|
36
|
-
if ($("html[mode=dark]").length > 0
|
37
|
-
|| ($("html[mode]").length == 0
|
36
|
+
if ($("html[data-mode=dark]").length > 0
|
37
|
+
|| ($("html[data-mode]").length == 0
|
38
38
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
|
39
39
|
initTheme = "dark";
|
40
40
|
}
|
data/_includes/mode-toggle.html
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
<script type="text/javascript">
|
6
6
|
class ModeToggle {
|
7
7
|
static get MODE_KEY() { return "mode"; }
|
8
|
+
static get MODE_ATTR() { return "data-mode"; }
|
8
9
|
static get DARK_MODE() { return "dark"; }
|
9
10
|
static get LIGHT_MODE() { return "light"; }
|
10
11
|
static get ID() { return "mode-toggle"; }
|
@@ -70,17 +71,17 @@
|
|
70
71
|
}
|
71
72
|
|
72
73
|
setDark() {
|
73
|
-
$('html').attr(ModeToggle.
|
74
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.DARK_MODE);
|
74
75
|
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
75
76
|
}
|
76
77
|
|
77
78
|
setLight() {
|
78
|
-
$('html').attr(ModeToggle.
|
79
|
+
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.LIGHT_MODE);
|
79
80
|
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
|
80
81
|
}
|
81
82
|
|
82
83
|
clearMode() {
|
83
|
-
$('html').removeAttr(ModeToggle.
|
84
|
+
$('html').removeAttr(ModeToggle.MODE_ATTR);
|
84
85
|
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
85
86
|
}
|
86
87
|
|
data/_includes/post-nav.html
CHANGED
@@ -9,10 +9,10 @@
|
|
9
9
|
<p>{{ page.previous.title }}</p>
|
10
10
|
</a>
|
11
11
|
{% else %}
|
12
|
-
<
|
12
|
+
<div class="btn btn-outline-primary disabled"
|
13
13
|
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
14
14
|
<p>-</p>
|
15
|
-
</
|
15
|
+
</div>
|
16
16
|
{% endif %}
|
17
17
|
|
18
18
|
{% if page.next.url %}
|
@@ -21,10 +21,10 @@
|
|
21
21
|
<p>{{ page.next.title }}</p>
|
22
22
|
</a>
|
23
23
|
{% else %}
|
24
|
-
<
|
24
|
+
<div class="btn btn-outline-primary disabled"
|
25
25
|
prompt="{{ site.data.locales[lang].post.button.next }}">
|
26
26
|
<p>-</p>
|
27
|
-
</
|
27
|
+
</div>
|
28
28
|
{% endif %}
|
29
29
|
|
30
30
|
</div>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
The paginator for post list on HomgPage.
|
3
3
|
-->
|
4
4
|
|
5
|
-
<ul class="pagination align-items-center mt-4 mb-
|
5
|
+
<ul class="pagination align-items-center mt-4 mb-5 pl-lg-2">
|
6
6
|
<!-- left arrow -->
|
7
7
|
{% if paginator.previous_page %}
|
8
8
|
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
@@ -47,7 +47,7 @@
|
|
47
47
|
{% if show %}
|
48
48
|
<!-- show number -->
|
49
49
|
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
50
|
-
<a class="page-link btn-box-shadow" href="{{ site.
|
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
51
|
</li>
|
52
52
|
{% else %}
|
53
53
|
<!-- hide number -->
|
data/_includes/post-sharing.html
CHANGED
@@ -6,7 +6,8 @@
|
|
6
6
|
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
|
7
7
|
<span class="share-icons">
|
8
8
|
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
9
|
-
{% assign
|
9
|
+
{% assign title = title | url_encode %}
|
10
|
+
{% assign url = page.url | absolute_url | url_encode %}
|
10
11
|
|
11
12
|
{% for share in site.data.share.platforms %}
|
12
13
|
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
@@ -19,7 +20,7 @@
|
|
19
20
|
<i id="copy-link" class="fa-fw fas fa-link small"
|
20
21
|
data-toggle="tooltip" data-placement="top"
|
21
22
|
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
22
|
-
title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
23
|
+
data-title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
23
24
|
</i>
|
24
25
|
|
25
26
|
</span>
|
@@ -9,10 +9,11 @@
|
|
9
9
|
we suround the markdown table with `<div class="table-wrapper">` and `</div>`
|
10
10
|
-->
|
11
11
|
|
12
|
-
{% if _content contains '<table
|
12
|
+
{% if _content contains '<table' %}
|
13
13
|
{% assign _content = _content
|
14
|
-
| replace: '<table
|
14
|
+
| replace: '<table', '<div class="table-wrapper"><table'
|
15
15
|
| replace: '</table>', '</table></div>'
|
16
|
+
| replace: '<code><div class="table-wrapper">', '<code>'
|
16
17
|
| replace: '</table></div></code>', '</table></code>'
|
17
18
|
%}
|
18
19
|
{% endif %}
|
@@ -91,7 +92,11 @@
|
|
91
92
|
|
92
93
|
<!-- Add CDN URL -->
|
93
94
|
{% if site.img_cdn %}
|
94
|
-
{%
|
95
|
+
{% if site.img_cdn contains '//' %}
|
96
|
+
{% assign _src_prefix = site.img_cdn %}
|
97
|
+
{% else %}
|
98
|
+
{% assign _src_prefix = site.img_cdn | relative_url %}
|
99
|
+
{% endif %}
|
95
100
|
{% else %}
|
96
101
|
{% assign _src_prefix = site.baseurl %}
|
97
102
|
{% endif %}
|
@@ -165,13 +170,13 @@
|
|
165
170
|
{% endif %}
|
166
171
|
|
167
172
|
{% capture _label %}
|
168
|
-
<span label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
173
|
+
<span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
169
174
|
{% endcapture %}
|
170
175
|
|
171
176
|
{% assign _new_content = _new_content | append: _snippet
|
172
177
|
| append: '<div class="code-header">'
|
173
178
|
| append: _label
|
174
|
-
| append: '<button aria-label="copy" title-succeed="'
|
179
|
+
| append: '<button aria-label="copy" data-title-succeed="'
|
175
180
|
| append: site.data.locales[lang].post.button.copy_code.succeed
|
176
181
|
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
177
182
|
| append: '<div class="highlight"><code>'
|
@@ -205,15 +210,14 @@
|
|
205
210
|
{% endif %}
|
206
211
|
|
207
212
|
{% assign id = snippet | split: '"' | first %}
|
208
|
-
{% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
213
|
+
{% capture anchor %}<a href="#{{ id }}" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
209
214
|
|
210
215
|
{% assign left = snippet | split: mark_end | first %}
|
211
|
-
{% assign
|
212
|
-
{% assign
|
213
|
-
{% assign right = snippet | slice: _start_index, _end_index %}
|
216
|
+
{% assign right = snippet | slice: left.size, snippet.size %}
|
217
|
+
{% assign left = left | replace: '">', '"><span class="mr-2">' | append: '</span>' %}
|
214
218
|
|
215
219
|
{% assign _new_content = _new_content | append: mark_start
|
216
|
-
| append: left | append: anchor | append:
|
220
|
+
| append: left | append: anchor | append: right
|
217
221
|
%}
|
218
222
|
|
219
223
|
{% endfor %}
|
@@ -225,6 +229,54 @@
|
|
225
229
|
|
226
230
|
{% assign _content = _heading_content %}
|
227
231
|
|
232
|
+
<!-- Wrap prompt element of blockquote with the <div> tag -->
|
233
|
+
|
234
|
+
{% assign blockquote_start = '<blockquote class=' %}
|
235
|
+
{% assign blockquote_end = '</blockquote>' %}
|
236
|
+
{% assign cls_prefix = 'prompt-' %}
|
237
|
+
|
238
|
+
{% if _content contains blockquote_start %}
|
239
|
+
|
240
|
+
{% assign _prompt_content = nil %}
|
241
|
+
{% assign _prompt_snippets = _content | split: blockquote_start %}
|
242
|
+
|
243
|
+
{% for _snippet in _prompt_snippets %}
|
244
|
+
|
245
|
+
{% if forloop.first %}
|
246
|
+
{% assign _prompt_content = _snippet %}
|
247
|
+
{% continue %}
|
248
|
+
{% endif %}
|
249
|
+
|
250
|
+
{% assign left = _snippet | split: blockquote_end | first %}
|
251
|
+
{% assign right = _snippet | slice: left.size, _snippet.size %}
|
252
|
+
|
253
|
+
{% assign cls_str = left | split: '>' | first %}
|
254
|
+
{% assign cls_array = cls_str | remove: '"' | split: ' ' %}
|
255
|
+
{% assign is_prompt = false %}
|
256
|
+
|
257
|
+
{% for cls in cls_array %}
|
258
|
+
{% if cls contains cls_prefix %}
|
259
|
+
{% assign is_prompt = true %}
|
260
|
+
{% break %}
|
261
|
+
{% endif %}
|
262
|
+
{% endfor %}
|
263
|
+
|
264
|
+
{% unless is_prompt %}
|
265
|
+
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: _snippet %}
|
266
|
+
{% continue %}
|
267
|
+
{% endunless %}
|
268
|
+
|
269
|
+
{% assign left = left | slice: cls_str.size, left.size %}
|
270
|
+
{% assign left = cls_str | append: '><div' | append: left | append: '</div>' %}
|
271
|
+
|
272
|
+
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: left | append: right %}
|
273
|
+
|
274
|
+
{% endfor %}
|
275
|
+
|
276
|
+
{% assign _content = _prompt_content %}
|
277
|
+
|
278
|
+
{% endif %}
|
279
|
+
|
228
280
|
<!-- return -->
|
229
281
|
|
230
282
|
{{ _content }}
|
@@ -60,7 +60,6 @@
|
|
60
60
|
{% assign less = TOTAL_SIZE | minus: index_list.size %}
|
61
61
|
|
62
62
|
{% if less > 0 %}
|
63
|
-
|
64
63
|
{% for i in (0..last_index) %}
|
65
64
|
{% assign post = site.posts[i] %}
|
66
65
|
{% if post.url != page.url %}
|
@@ -74,10 +73,8 @@
|
|
74
73
|
{% endunless %}
|
75
74
|
{% endif %}
|
76
75
|
{% endfor %}
|
77
|
-
|
78
76
|
{% endif %}
|
79
77
|
|
80
|
-
|
81
78
|
{% if index_list.size > 0 %}
|
82
79
|
<div id="related-posts" class="mt-5 mb-2 mb-sm-4">
|
83
80
|
<h3 class="pt-2 mt-1 mb-4 ml-1"
|
@@ -89,7 +86,7 @@
|
|
89
86
|
<div class="card">
|
90
87
|
<a href="{{ post.url | relative_url }}">
|
91
88
|
<div class="card-body">
|
92
|
-
{% include
|
89
|
+
{% include datetime.html date=post.date class="small" %}
|
93
90
|
<h3 class="pt-0 mt-1 mb-3" data-toc-skip>{{ post.title }}</h3>
|
94
91
|
<div class="text-muted small">
|
95
92
|
<p>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
{% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
|
18
18
|
|
19
|
-
<script src="
|
19
|
+
<script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
|
20
20
|
|
21
21
|
<script>
|
22
22
|
SimpleJekyllSearch({
|
data/_includes/sidebar.html
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
The Side Bar
|
3
3
|
-->
|
4
4
|
|
5
|
-
<div id="sidebar" class="d-flex flex-column align-items-end"
|
5
|
+
<div id="sidebar" class="d-flex flex-column align-items-end">
|
6
6
|
<div class="profile-wrapper text-center">
|
7
7
|
<div id="avatar">
|
8
|
-
<a href="{{ '/' | relative_url }}"
|
9
|
-
{% if site.avatar !=
|
8
|
+
<a href="{{ '/' | relative_url }}" class="mx-auto">
|
9
|
+
{% if site.avatar != empty and site.avatar %}
|
10
10
|
{% capture avatar_url %}
|
11
|
-
{
|
11
|
+
{% if site.avatar contains '://' %}
|
12
12
|
{{ site.avatar }}
|
13
|
-
{
|
13
|
+
{% elsif site.img_cdn != empty and site.img_cdn %}
|
14
14
|
{{ site.avatar | prepend: site.img_cdn }}
|
15
|
-
{
|
15
|
+
{% else %}
|
16
16
|
{{ site.avatar | relative_url }}
|
17
|
-
{
|
17
|
+
{% endif %}
|
18
18
|
{% endcapture %}
|
19
|
-
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
19
|
+
<img src="{{ avatar_url | strip }}" alt="avatar" onerror="this.style.display='none'">
|
20
20
|
{% endif %}
|
21
21
|
</a>
|
22
22
|
</div>
|
data/_includes/toc.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
{% if enable_toc %}
|
9
9
|
<!-- BS-toc.js will be loaded at medium priority -->
|
10
|
-
<script src="
|
10
|
+
<script src="{{ site.data.assets[origin].bootstrap-toc.js | relative_url }}"></script>
|
11
11
|
|
12
12
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
13
13
|
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>
|
data/_includes/topbar.html
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
The Top Bar
|
3
3
|
-->
|
4
4
|
|
5
|
-
<div id="topbar-wrapper"
|
6
|
-
<div id="topbar" class="
|
5
|
+
<div id="topbar-wrapper">
|
6
|
+
<div id="topbar" class="container d-flex align-items-center justify-content-between h-100 pl-3 pr-3 pl-md-4 pr-md-4">
|
7
7
|
<span id="breadcrumb">
|
8
8
|
|
9
9
|
{% assign paths = page.url | split: '/' %}
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<div id="topbar-title">
|
51
51
|
{% if page.layout == 'home' %}
|
52
52
|
{{- site.data.locales[lang].title | default: site.title -}}
|
53
|
-
{% elsif page.collection == 'tabs' or page.
|
53
|
+
{% elsif page.collection == 'tabs' or page.layout == 'page' %}
|
54
54
|
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
55
55
|
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
56
56
|
{% else %}
|
@@ -63,7 +63,6 @@
|
|
63
63
|
<i class="fas fa-search fa-fw"></i>
|
64
64
|
<input class="form-control" id="search-input" type="search"
|
65
65
|
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[lang].search.hint | capitalize }}...">
|
66
|
-
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
|
67
66
|
</span>
|
68
67
|
<span id="search-cancel" >{{ site.data.locales[lang].search.cancel }}</span>
|
69
68
|
</div>
|
data/_layouts/archives.html
CHANGED
@@ -5,8 +5,15 @@ layout: page
|
|
5
5
|
|
6
6
|
{% include lang.html %}
|
7
7
|
|
8
|
-
|
8
|
+
{% if site.prefer_datetime_locale == 'en' or lang == 'en' %}
|
9
|
+
{% assign df_strftime_m = '%b' %}
|
10
|
+
{% assign df_dayjs_m = 'MMM' %}
|
11
|
+
{% else %}
|
12
|
+
{% assign df_strftime_m = '/ %m' %}
|
13
|
+
{% assign df_dayjs_m = '/ MM' %}
|
14
|
+
{% endif %}
|
9
15
|
|
16
|
+
<div id="archives" class="pl-xl-2">
|
10
17
|
{% for post in site.posts %}
|
11
18
|
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
12
19
|
{% capture pre_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
|
@@ -18,11 +25,13 @@ layout: page
|
|
18
25
|
{% endif %}
|
19
26
|
<li>
|
20
27
|
<div>
|
21
|
-
{%
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<span class="date month small text-muted"
|
28
|
+
{% assign ts = post.date | date: '%s' %}
|
29
|
+
<span class="date day" data-ts="{{ ts }}" data-df="DD">
|
30
|
+
{{ post.date | date: "%d" }}
|
31
|
+
</span>
|
32
|
+
<span class="date month small text-muted" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">
|
33
|
+
{{ post.date | date: df_strftime_m }}
|
34
|
+
</span>
|
26
35
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
27
36
|
</div>
|
28
37
|
</li>
|
data/_layouts/categories.html
CHANGED
@@ -47,10 +47,24 @@ layout: page
|
|
47
47
|
<span class="text-muted small font-weight-light">
|
48
48
|
{% if sub_categories_size > 0 %}
|
49
49
|
{{ sub_categories_size }}
|
50
|
-
{
|
50
|
+
{% if sub_categories_size > 1 %}
|
51
|
+
{{ site.data.locales[lang].categories.category_measure.plural
|
52
|
+
| default: site.data.locales[lang].categories.category_measure }}
|
53
|
+
{% else %}
|
54
|
+
{{ site.data.locales[lang].categories.category_measure.singular
|
55
|
+
| default: site.data.locales[lang].categories.category_measure }}
|
56
|
+
{% endif %},
|
57
|
+
{% endif %}
|
58
|
+
|
59
|
+
{{ top_posts_size }}
|
60
|
+
|
61
|
+
{% if top_posts_size > 1 %}
|
62
|
+
{{ site.data.locales[lang].categories.post_measure.plural
|
63
|
+
| default: site.data.locales[lang].categories.post_measure }}
|
64
|
+
{% else %}
|
65
|
+
{{ site.data.locales[lang].categories.post_measure.singular
|
66
|
+
| default: site.data.locales[lang].categories.post_measure }}
|
51
67
|
{% endif %}
|
52
|
-
{{ top_posts_size }}
|
53
|
-
{{ site.data.locales[lang].categories.post_measure }}
|
54
68
|
</span>
|
55
69
|
</span>
|
56
70
|
|
@@ -83,7 +97,14 @@ layout: page
|
|
83
97
|
{% assign posts_size = site.categories[sub_category] | size %}
|
84
98
|
<span class="text-muted small font-weight-light">
|
85
99
|
{{ posts_size }}
|
86
|
-
|
100
|
+
|
101
|
+
{% if posts_size > 1 %}
|
102
|
+
{{ site.data.locales[lang].categories.post_measure.plural
|
103
|
+
| default: site.data.locales[lang].categories.post_measure }}
|
104
|
+
{% else %}
|
105
|
+
{{ site.data.locales[lang].categories.post_measure.singular
|
106
|
+
| default: site.data.locales[lang].categories.post_measure }}
|
107
|
+
{% endif %}
|
87
108
|
</span>
|
88
109
|
</li>
|
89
110
|
{% endfor %}
|
data/_layouts/category.html
CHANGED
@@ -13,13 +13,11 @@ layout: page
|
|
13
13
|
</h1>
|
14
14
|
|
15
15
|
<ul class="post-content pl-0">
|
16
|
-
{% assign post_df = site.data.locales[lang].date_format.post.long %}
|
17
|
-
|
18
16
|
{% for post in page.posts %}
|
19
17
|
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
20
18
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
21
19
|
<span class="dash flex-grow-1"></span>
|
22
|
-
|
20
|
+
{% include datetime.html date=post.date wrap='span' class='text-muted small' %}
|
23
21
|
</li>
|
24
22
|
{% endfor %}
|
25
23
|
</ul>
|
data/_layouts/default.html
CHANGED
@@ -7,9 +7,11 @@ layout: compress
|
|
7
7
|
|
8
8
|
{% include lang.html %}
|
9
9
|
|
10
|
+
{% include assets-origin.html %}
|
11
|
+
|
10
12
|
{% capture prefer_mode %}
|
11
13
|
{% if site.theme_mode %}
|
12
|
-
mode="{{ site.theme_mode }}"
|
14
|
+
data-mode="{{ site.theme_mode }}"
|
13
15
|
{% endif %}
|
14
16
|
{% endcapture %}
|
15
17
|
|
@@ -17,18 +19,14 @@ layout: compress
|
|
17
19
|
|
18
20
|
{% include head.html %}
|
19
21
|
|
20
|
-
|
21
|
-
{% include mode-toggle.html %}
|
22
|
-
{% endunless %}
|
23
|
-
|
24
|
-
<body data-spy="scroll" data-target="#toc">
|
22
|
+
<body data-spy="scroll" data-target="#toc" data-topbar-visible="true">
|
25
23
|
|
26
24
|
{% include sidebar.html %}
|
27
25
|
|
28
26
|
{% include topbar.html %}
|
29
27
|
|
30
|
-
<div id="main-wrapper">
|
31
|
-
<div id="main">
|
28
|
+
<div id="main-wrapper" class="d-flex justify-content-center">
|
29
|
+
<div id="main" class="container pl-xl-4 pr-xl-4">
|
32
30
|
|
33
31
|
{{ content }}
|
34
32
|
|
@@ -50,6 +48,23 @@ layout: compress
|
|
50
48
|
<i class="fas fa-angle-up"></i>
|
51
49
|
</a>
|
52
50
|
|
51
|
+
{% if site.pwa.enabled %}
|
52
|
+
<div id="notification" class="toast" role="alert" aria-live="assertive" aria-atomic="true"
|
53
|
+
data-animation="true" data-autohide="false">
|
54
|
+
<div class="toast-header">
|
55
|
+
<button type="button" class="ml-2 ml-auto close" data-dismiss="toast" aria-label="Close">
|
56
|
+
<span aria-hidden="true">×</span>
|
57
|
+
</button>
|
58
|
+
</div>
|
59
|
+
<div class="toast-body text-center pt-0">
|
60
|
+
<p class="pl-2 pr-2 mb-3">{{ site.data.locales[lang].notification.update_found }}</p>
|
61
|
+
<button type="button" class="btn btn-primary" aria-label="Update">
|
62
|
+
{{ site.data.locales[lang].notification.update }}
|
63
|
+
</button>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
{% endif %}
|
67
|
+
|
53
68
|
{% include search-loader.html %}
|
54
69
|
|
55
70
|
{% include js-selector.html %}
|