jekyll-theme-chirpy 5.0.2 → 5.1.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 +35 -13
- data/_data/assets/cross_origin.yml +62 -0
- data/_data/assets/self_host.yml +51 -0
- data/_data/locales/en.yml +1 -14
- data/_data/locales/id-ID.yml +0 -13
- data/_data/locales/ko-KR.yml +0 -13
- data/_data/locales/my-MM.yml +78 -0
- data/_data/locales/ru-RU.yml +78 -0
- data/_data/locales/uk-UA.yml +78 -0
- data/_data/locales/zh-CN.yml +0 -13
- 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/head.html +35 -20
- data/_includes/js-selector.html +42 -10
- data/_includes/jsdelivr-combine.html +32 -0
- data/_includes/mermaid.html +3 -3
- data/_includes/mode-toggle.html +4 -3
- data/_includes/post-sharing.html +2 -2
- data/_includes/refactor-content.html +53 -6
- data/_includes/search-loader.html +1 -1
- data/_includes/sidebar.html +6 -6
- data/_includes/timeago.html +6 -17
- data/_includes/toc.html +1 -1
- data/_includes/topbar.html +2 -3
- data/_layouts/archives.html +5 -7
- data/_layouts/category.html +3 -5
- data/_layouts/default.html +4 -2
- data/_layouts/home.html +2 -2
- data/_layouts/page.html +3 -1
- data/_layouts/tag.html +3 -5
- data/_sass/addon/commons.scss +139 -132
- data/_sass/addon/module.scss +33 -17
- data/_sass/addon/syntax.scss +38 -25
- data/_sass/addon/variables.scss +6 -6
- 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 +1 -1
- data/_tabs/about.md +2 -2
- data/assets/404.html +0 -2
- data/assets/js/data/search.json +1 -0
- 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 +1 -1
- metadata +11 -4
- data/_includes/css-selector.html +0 -15
- data/_includes/no-zero-date.html +0 -13
@@ -0,0 +1,56 @@
|
|
1
|
+
<!-- https://giscus.app/ -->
|
2
|
+
<script type="text/javascript">
|
3
|
+
$(function () {
|
4
|
+
const origin = "https://giscus.app";
|
5
|
+
const iframe = "iframe.giscus-frame";
|
6
|
+
const lightTheme = "light";
|
7
|
+
const darkTheme = "dark_dimmed";
|
8
|
+
let initTheme = lightTheme;
|
9
|
+
|
10
|
+
if ($("html[data-mode=dark]").length > 0
|
11
|
+
|| ($("html[data-mode]").length == 0
|
12
|
+
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
13
|
+
initTheme = darkTheme;
|
14
|
+
}
|
15
|
+
|
16
|
+
let giscusAttributes = {
|
17
|
+
"src": "https://giscus.app/client.js",
|
18
|
+
"data-repo": "{{ site.comments.giscus.repo}}",
|
19
|
+
"data-repo-id": "{{ site.comments.giscus.repo_id }}",
|
20
|
+
"data-category": "{{ site.comments.giscus.category }}",
|
21
|
+
"data-category-id": "{{ site.comments.giscus.category_id }}",
|
22
|
+
"data-mapping": "{{ site.comments.giscus.mapping | default: 'pathname' }}",
|
23
|
+
"data-reactions-enabled": "1",
|
24
|
+
"data-emit-metadata": "0",
|
25
|
+
"data-theme": initTheme,
|
26
|
+
"data-input-position": "{{ site.comments.giscus.input_position | default: 'bottom' }}",
|
27
|
+
"data-lang": "{{ site.comments.giscus.lang | default: lang }}",
|
28
|
+
"crossorigin": "anonymous",
|
29
|
+
"async": ""
|
30
|
+
};
|
31
|
+
|
32
|
+
let giscusScript = document.createElement("script");
|
33
|
+
Object.entries(giscusAttributes).forEach(([key, value]) => giscusScript.setAttribute(key, value));
|
34
|
+
document.getElementById("tail-wrapper").appendChild(giscusScript);
|
35
|
+
|
36
|
+
addEventListener("message", (event) => {
|
37
|
+
if (event.source === window && event.data &&
|
38
|
+
event.data.direction === ModeToggle.ID) {
|
39
|
+
/* global theme mode changed */
|
40
|
+
const mode = event.data.message;
|
41
|
+
const theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
|
42
|
+
|
43
|
+
const message = {
|
44
|
+
setConfig: {
|
45
|
+
theme: theme
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
const giscus = document.querySelector(iframe).contentWindow;
|
50
|
+
giscus.postMessage({ giscus: message }, origin);
|
51
|
+
}
|
52
|
+
|
53
|
+
});
|
54
|
+
|
55
|
+
});
|
56
|
+
</script>
|
@@ -14,8 +14,8 @@
|
|
14
14
|
const darkTheme = "github-dark";
|
15
15
|
let initTheme = lightTheme;
|
16
16
|
|
17
|
-
if ($("html[mode=dark]").length > 0
|
18
|
-
|| ($("html[mode]").length == 0
|
17
|
+
if ($("html[data-mode=dark]").length > 0
|
18
|
+
|| ($("html[data-mode]").length == 0
|
19
19
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
20
20
|
initTheme = darkTheme;
|
21
21
|
}
|
data/_includes/head.html
CHANGED
@@ -6,13 +6,12 @@
|
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
8
8
|
|
9
|
-
|
9
|
+
<!-- Allow having a localized datetime different from the appearance language -->
|
10
|
+
{% if site.prefer_datetime_locale %}
|
11
|
+
<meta name="prefer-datetime-locale" content="{{ site.prefer_datetime_locale }}">
|
12
|
+
{% endif %}
|
10
13
|
|
11
|
-
|
12
|
-
<meta name="day-prompt" content="{{ site.data.locales[lang].post.timeago.day }}">
|
13
|
-
<meta name="hour-prompt" content="{{ site.data.locales[lang].post.timeago.hour }}">
|
14
|
-
<meta name="minute-prompt" content="{{ site.data.locales[lang].post.timeago.minute }}">
|
15
|
-
<meta name="justnow-prompt" content="{{ site.data.locales[lang].post.timeago.just_now }}">
|
14
|
+
{% if page.layout == 'home' or page.layout == 'post' %}
|
16
15
|
|
17
16
|
{% if site.google_analytics.pv.proxy_endpoint %}
|
18
17
|
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
|
@@ -35,12 +34,24 @@
|
|
35
34
|
|
36
35
|
{% include favicons.html %}
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
{% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
|
38
|
+
|
39
|
+
<link href="{{ site.data.assets[origin].webfonts | relative_url }}" rel="stylesheet">
|
40
|
+
|
41
|
+
{% else %}
|
42
|
+
|
43
|
+
{% for cdn in site.data.assets[origin].cdns %}
|
44
|
+
<link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
|
45
|
+
<link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
|
46
|
+
{% endfor %}
|
47
|
+
|
48
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].webfonts }}">
|
49
|
+
|
50
|
+
{% endif %}
|
41
51
|
|
42
52
|
<!-- GA -->
|
43
|
-
{% if jekyll.environment == 'production'
|
53
|
+
{% if jekyll.environment == 'production'
|
54
|
+
and site.google_analytics.id != empty and site.google_analytics.id %}
|
44
55
|
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
|
45
56
|
<link rel="dns-prefetch" href="https://www.google-analytics.com">
|
46
57
|
|
@@ -49,27 +60,31 @@
|
|
49
60
|
|
50
61
|
{% if site.google_analytics.pv.proxy_endpoint %}
|
51
62
|
{% assign proxy_url = site.google_analytics.pv.proxy_endpoint
|
52
|
-
|
53
|
-
|
63
|
+
| replace: "https://", "" | split: "/" | first | prepend: "https://" %}
|
54
64
|
<link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
|
55
65
|
<link rel="dns-prefetch" href="{{ proxy_url }}">
|
56
66
|
{% endif %}
|
57
67
|
{% endif %}
|
58
68
|
|
59
|
-
<!-- jsDelivr CDN -->
|
60
|
-
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
61
|
-
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
62
|
-
|
63
69
|
<!-- Bootstrap -->
|
64
|
-
<link rel="stylesheet" href="
|
70
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css }}">
|
65
71
|
|
66
72
|
<!-- Font Awesome -->
|
67
|
-
<link rel="stylesheet" href="
|
73
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.css }}">
|
74
|
+
|
75
|
+
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
|
68
76
|
|
69
|
-
{%
|
77
|
+
{% if site.toc and page.toc %}
|
78
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.css }}">
|
79
|
+
{% endif %}
|
80
|
+
|
81
|
+
{% if page.layout == 'page' or page.layout == 'post' %}
|
82
|
+
<!-- Manific Popup -->
|
83
|
+
<link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css }}">
|
84
|
+
{% endif %}
|
70
85
|
|
71
86
|
<!-- JavaScript -->
|
72
87
|
|
73
|
-
<script src="
|
88
|
+
<script src="{{ site.data.assets[origin].jquery.js }}"></script>
|
74
89
|
|
75
90
|
</head>
|
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 }}"></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,21 @@
|
|
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 }}"></script>
|
83
|
+
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js }}">
|
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 }}"></script>
|
58
90
|
|
59
91
|
{% if jekyll.environment == 'production' %}
|
60
92
|
<!-- PWA -->
|
61
93
|
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
62
94
|
|
63
95
|
<!-- GA -->
|
64
|
-
{% if site.google_analytics.id %}
|
96
|
+
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
65
97
|
{% include google-analytics.html %}
|
66
98
|
{% endif %}
|
67
99
|
|
@@ -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 }}"></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-sharing.html
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
{% assign url = page.url | absolute_url %}
|
10
10
|
|
11
11
|
{% for share in site.data.share.platforms %}
|
12
|
-
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
12
|
+
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url | escape %}
|
13
13
|
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
14
14
|
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
15
15
|
<i class="fa-fw {{ share.icon }}"></i>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<i id="copy-link" class="fa-fw fas fa-link small"
|
20
20
|
data-toggle="tooltip" data-placement="top"
|
21
21
|
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
22
|
-
title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
22
|
+
data-title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
23
23
|
</i>
|
24
24
|
|
25
25
|
</span>
|
@@ -165,13 +165,13 @@
|
|
165
165
|
{% endif %}
|
166
166
|
|
167
167
|
{% capture _label %}
|
168
|
-
<span label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
168
|
+
<span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
169
169
|
{% endcapture %}
|
170
170
|
|
171
171
|
{% assign _new_content = _new_content | append: _snippet
|
172
172
|
| append: '<div class="code-header">'
|
173
173
|
| append: _label
|
174
|
-
| append: '<button aria-label="copy" title-succeed="'
|
174
|
+
| append: '<button aria-label="copy" data-title-succeed="'
|
175
175
|
| append: site.data.locales[lang].post.button.copy_code.succeed
|
176
176
|
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
177
177
|
| append: '<div class="highlight"><code>'
|
@@ -205,12 +205,11 @@
|
|
205
205
|
{% endif %}
|
206
206
|
|
207
207
|
{% assign id = snippet | split: '"' | first %}
|
208
|
-
{% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
208
|
+
{% capture anchor %}<a href="#{{ id }}" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
209
209
|
|
210
210
|
{% assign left = snippet | split: mark_end | first %}
|
211
|
-
{% assign
|
212
|
-
{% assign
|
213
|
-
{% assign right = snippet | slice: _start_index, _end_index %}
|
211
|
+
{% assign right = snippet | slice: left.size, snippet.size %}
|
212
|
+
{% assign left = left | replace: '">', '"><span class="mr-2">' | append: '</span>' %}
|
214
213
|
|
215
214
|
{% assign _new_content = _new_content | append: mark_start
|
216
215
|
| append: left | append: anchor | append: mark_end | append: right
|
@@ -225,6 +224,54 @@
|
|
225
224
|
|
226
225
|
{% assign _content = _heading_content %}
|
227
226
|
|
227
|
+
<!-- Wrap prompt element of blockquote with the <div> tag -->
|
228
|
+
|
229
|
+
{% assign blockquote_start = '<blockquote class=' %}
|
230
|
+
{% assign blockquote_end = '</blockquote>' %}
|
231
|
+
{% assign cls_prefix = 'prompt-' %}
|
232
|
+
|
233
|
+
{% if _content contains blockquote_start %}
|
234
|
+
|
235
|
+
{% assign _prompt_content = nil %}
|
236
|
+
{% assign _prompt_snippets = _content | split: blockquote_start %}
|
237
|
+
|
238
|
+
{% for _snippet in _prompt_snippets %}
|
239
|
+
|
240
|
+
{% if forloop.first %}
|
241
|
+
{% assign _prompt_content = _snippet %}
|
242
|
+
{% continue %}
|
243
|
+
{% endif %}
|
244
|
+
|
245
|
+
{% assign left = _snippet | split: blockquote_end | first %}
|
246
|
+
{% assign right = _snippet | slice: left.size, _snippet.size %}
|
247
|
+
|
248
|
+
{% assign cls_str = left | split: '>' | first %}
|
249
|
+
{% assign cls_array = cls_str | remove: '"' | split: ' ' %}
|
250
|
+
{% assign is_prompt = false %}
|
251
|
+
|
252
|
+
{% for cls in cls_array %}
|
253
|
+
{% if cls contains cls_prefix %}
|
254
|
+
{% assign is_prompt = true %}
|
255
|
+
{% break %}
|
256
|
+
{% endif %}
|
257
|
+
{% endfor %}
|
258
|
+
|
259
|
+
{% unless is_prompt %}
|
260
|
+
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: _snippet %}
|
261
|
+
{% continue %}
|
262
|
+
{% endunless %}
|
263
|
+
|
264
|
+
{% assign left = left | slice: cls_str.size, left.size %}
|
265
|
+
{% assign left = cls_str | append: '><div' | append: left | append: '</div>' %}
|
266
|
+
|
267
|
+
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: left | append: right %}
|
268
|
+
|
269
|
+
{% endfor %}
|
270
|
+
|
271
|
+
{% assign _content = _prompt_content %}
|
272
|
+
|
273
|
+
{% endif %}
|
274
|
+
|
228
275
|
<!-- return -->
|
229
276
|
|
230
277
|
{{ _content }}
|
@@ -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 }}"></script>
|
20
20
|
|
21
21
|
<script>
|
22
22
|
SimpleJekyllSearch({
|
data/_includes/sidebar.html
CHANGED
@@ -2,19 +2,19 @@
|
|
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
8
|
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
|
9
|
-
{% if site.avatar !=
|
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
19
|
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
20
20
|
{% endif %}
|
data/_includes/timeago.html
CHANGED
@@ -3,24 +3,13 @@
|
|
3
3
|
See: ${JS_ROOT}/utils/timeago.js
|
4
4
|
-->
|
5
5
|
|
6
|
-
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
7
|
-
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
8
|
-
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
9
|
-
|
10
6
|
<em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
|
11
|
-
|
7
|
+
data-ts="{{ include.date | date: '%s' }}"
|
12
8
|
{% if include.tooltip %}
|
13
|
-
data-toggle="tooltip"
|
14
|
-
|
15
|
-
|
9
|
+
data-toggle="tooltip" data-placement="bottom" data-tooltip-df="llll"
|
10
|
+
{% endif %}
|
11
|
+
{% if include.capitalize %}
|
12
|
+
data-capitalize="true"
|
16
13
|
{% endif %}>
|
17
|
-
|
18
|
-
{%- assign this_year = site.time | date: "%Y" -%}
|
19
|
-
{%- assign post_year = include.date | date: "%Y" -%}
|
20
|
-
|
21
|
-
{%- if post_year == this_year -%}
|
22
|
-
{{ include.date | date: post_short_df }}
|
23
|
-
{%- else -%}
|
24
|
-
{{ include.date | date: post_long_df }}
|
25
|
-
{%- endif -%}
|
14
|
+
{{ include.date | date: '%Y-%m-%d' }}
|
26
15
|
</em>
|
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 }}"></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,7 +2,7 @@
|
|
2
2
|
The Top Bar
|
3
3
|
-->
|
4
4
|
|
5
|
-
<div id="topbar-wrapper" class="row justify-content-center
|
5
|
+
<div id="topbar-wrapper" class="row justify-content-center">
|
6
6
|
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
|
7
7
|
<span id="breadcrumb">
|
8
8
|
|
@@ -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
@@ -3,8 +3,6 @@ layout: page
|
|
3
3
|
# The Archives of posts.
|
4
4
|
---
|
5
5
|
|
6
|
-
{% include lang.html %}
|
7
|
-
|
8
6
|
<div id="archives" class="pl-xl-2">
|
9
7
|
|
10
8
|
{% for post in site.posts %}
|
@@ -18,11 +16,11 @@ layout: page
|
|
18
16
|
{% endif %}
|
19
17
|
<li>
|
20
18
|
<div>
|
21
|
-
{%
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
{% assign ts = post.date | date: '%s' %}
|
20
|
+
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: "%d" }}</span>
|
21
|
+
<span class="date month small text-muted" data-ts="{{ ts }}" data-df="MMM">
|
22
|
+
{{ post.date | date: '%m' }}
|
23
|
+
</span>
|
26
24
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
27
25
|
</div>
|
28
26
|
</li>
|
data/_layouts/category.html
CHANGED
@@ -3,8 +3,6 @@ layout: page
|
|
3
3
|
# The Category layout
|
4
4
|
---
|
5
5
|
|
6
|
-
{% include lang.html %}
|
7
|
-
|
8
6
|
<div id="page-category">
|
9
7
|
<h1 class="pl-lg-2">
|
10
8
|
<i class="far fa-folder-open fa-fw text-muted"></i>
|
@@ -13,13 +11,13 @@ layout: page
|
|
13
11
|
</h1>
|
14
12
|
|
15
13
|
<ul class="post-content pl-0">
|
16
|
-
{% assign post_df = site.data.locales[lang].date_format.post.long %}
|
17
|
-
|
18
14
|
{% for post in page.posts %}
|
19
15
|
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
20
16
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
21
17
|
<span class="dash flex-grow-1"></span>
|
22
|
-
<span class="text-muted small"
|
18
|
+
<span class="text-muted small" data-ts="{{ post.date | date: '%s' }}" data-df="ll">
|
19
|
+
{{ post.date | date: '%Y-%m-%d' }}
|
20
|
+
</span>
|
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
|
|
@@ -21,7 +23,7 @@ layout: compress
|
|
21
23
|
{% include mode-toggle.html %}
|
22
24
|
{% endunless %}
|
23
25
|
|
24
|
-
<body data-spy="scroll" data-target="#toc">
|
26
|
+
<body data-spy="scroll" data-target="#toc" data-topbar-visible="true">
|
25
27
|
|
26
28
|
{% include sidebar.html %}
|
27
29
|
|
data/_layouts/home.html
CHANGED
@@ -6,7 +6,7 @@ layout: page
|
|
6
6
|
{% include lang.html %}
|
7
7
|
|
8
8
|
{% assign pinned = site.posts | where: "pin", "true" %}
|
9
|
-
{% assign default = site.posts | where_exp: "item", "item.pin != true" %}
|
9
|
+
{% assign default = site.posts | where_exp: "item", "item.pin != true and item.hidden != true" %}
|
10
10
|
|
11
11
|
{% assign posts = "" | split: "" %}
|
12
12
|
|
@@ -62,7 +62,7 @@ layout: page
|
|
62
62
|
<div class="mr-auto">
|
63
63
|
<!-- posted date -->
|
64
64
|
<i class="far fa-calendar fa-fw"></i>
|
65
|
-
{% include timeago.html date=post.date tooltip=true %}
|
65
|
+
{% include timeago.html date=post.date tooltip=true capitalize=true %}
|
66
66
|
|
67
67
|
<!-- time to read -->
|
68
68
|
<i class="far fa-clock fa-fw"></i>
|