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/_sass/addon/module.scss
CHANGED
@@ -13,19 +13,21 @@
|
|
13
13
|
%section {
|
14
14
|
#core-wrapper & {
|
15
15
|
margin-top: 2.5rem;
|
16
|
-
margin-bottom:
|
16
|
+
margin-bottom: 1.25rem;
|
17
|
+
|
18
|
+
&:focus {
|
19
|
+
outline: none; /* avoid outline in Safari */
|
20
|
+
}
|
17
21
|
}
|
18
22
|
}
|
19
23
|
|
20
24
|
%anchor {
|
21
25
|
.anchor {
|
22
|
-
font-size:
|
23
|
-
margin-left: 0.5rem;
|
26
|
+
font-size: 80%;
|
24
27
|
}
|
25
28
|
|
26
29
|
@media (hover: hover) {
|
27
30
|
.anchor {
|
28
|
-
border-bottom: none !important;
|
29
31
|
visibility: hidden;
|
30
32
|
opacity: 0;
|
31
33
|
transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
|
@@ -41,15 +43,6 @@
|
|
41
43
|
}
|
42
44
|
}
|
43
45
|
|
44
|
-
%anchor-relative {
|
45
|
-
@extend %anchor;
|
46
|
-
|
47
|
-
.anchor {
|
48
|
-
position: relative;
|
49
|
-
bottom: 1px;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
46
|
%tag-hover {
|
54
47
|
background: var(--tag-hover);
|
55
48
|
transition: background 0.35s ease-in-out;
|
@@ -95,10 +88,15 @@
|
|
95
88
|
font-style: normal;
|
96
89
|
}
|
97
90
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
91
|
+
%img-caption {
|
92
|
+
+ em {
|
93
|
+
display: block;
|
94
|
+
text-align: center;
|
95
|
+
font-style: normal;
|
96
|
+
font-size: 80%;
|
97
|
+
padding: 0;
|
98
|
+
color: #6d6c6c;
|
99
|
+
}
|
102
100
|
}
|
103
101
|
|
104
102
|
%sidebar-links {
|
@@ -106,6 +104,12 @@
|
|
106
104
|
user-select: none;
|
107
105
|
}
|
108
106
|
|
107
|
+
/* ---------- scss mixin --------- */
|
108
|
+
|
109
|
+
@mixin no-text-decoration {
|
110
|
+
text-decoration: none;
|
111
|
+
}
|
112
|
+
|
109
113
|
@mixin ml-mr($value) {
|
110
114
|
margin-left: $value;
|
111
115
|
margin-right: $value;
|
@@ -133,3 +137,15 @@
|
|
133
137
|
-ms-transform: translateX(-50%);
|
134
138
|
transform: translateX(-50%);
|
135
139
|
}
|
140
|
+
|
141
|
+
@mixin prompt($type, $fw-icon, $icon-weight: 900) {
|
142
|
+
&.prompt-#{$type} {
|
143
|
+
background-color: var(--prompt-#{$type}-bg);
|
144
|
+
|
145
|
+
&::before {
|
146
|
+
content: $fw-icon;
|
147
|
+
color: var(--prompt-#{$type}-icon-color);
|
148
|
+
font-weight: $icon-weight;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
data/_sass/addon/syntax.scss
CHANGED
@@ -5,23 +5,27 @@
|
|
5
5
|
@import "colors/light-syntax";
|
6
6
|
@import "colors/dark-syntax";
|
7
7
|
|
8
|
-
html
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@include dark-syntax;
|
15
|
-
}
|
8
|
+
html {
|
9
|
+
@media (prefers-color-scheme: light) {
|
10
|
+
&:not([data-mode]),
|
11
|
+
&[data-mode=light] {
|
12
|
+
@include light-syntax;
|
13
|
+
}
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@include dark-syntax;
|
15
|
+
&[data-mode=dark] {
|
16
|
+
@include dark-syntax;
|
17
|
+
}
|
21
18
|
}
|
22
19
|
|
23
|
-
|
24
|
-
|
20
|
+
@media (prefers-color-scheme: dark) {
|
21
|
+
&:not([data-mode]),
|
22
|
+
&[data-mode=dark] {
|
23
|
+
@include dark-syntax;
|
24
|
+
}
|
25
|
+
|
26
|
+
&[data-mode=light] {
|
27
|
+
@include light-syntax;
|
28
|
+
}
|
25
29
|
}
|
26
30
|
}
|
27
31
|
|
@@ -95,7 +99,7 @@ $code-radius: 6px;
|
|
95
99
|
user-select: none;
|
96
100
|
}
|
97
101
|
|
98
|
-
}
|
102
|
+
} /* .highlight */
|
99
103
|
|
100
104
|
code {
|
101
105
|
-webkit-hyphens: none;
|
@@ -110,8 +114,15 @@ code {
|
|
110
114
|
background-color: var(--inline-code-bg);
|
111
115
|
}
|
112
116
|
|
117
|
+
&.filepath {
|
118
|
+
background-color: inherit;
|
119
|
+
color: var(--filepath-text-color);
|
120
|
+
font-weight: 600;
|
121
|
+
padding: 0;
|
122
|
+
}
|
123
|
+
|
113
124
|
a > &.highlighter-rouge {
|
114
|
-
padding-bottom: 0;
|
125
|
+
padding-bottom: 0; /* show link's underlinke */
|
115
126
|
color: inherit;
|
116
127
|
}
|
117
128
|
|
@@ -119,7 +130,7 @@ code {
|
|
119
130
|
border-bottom: none;
|
120
131
|
}
|
121
132
|
|
122
|
-
blockquote
|
133
|
+
blockquote & {
|
123
134
|
color: inherit;
|
124
135
|
}
|
125
136
|
|
@@ -131,8 +142,10 @@ code {
|
|
131
142
|
td.rouge-code {
|
132
143
|
@extend %code-snippet-padding;
|
133
144
|
|
134
|
-
|
135
|
-
|
145
|
+
/*
|
146
|
+
Prevent some browser extends from
|
147
|
+
changing the URL string of code block.
|
148
|
+
*/
|
136
149
|
a {
|
137
150
|
color: inherit !important;
|
138
151
|
border-bottom: none !important;
|
@@ -186,9 +199,9 @@ div {
|
|
186
199
|
($dot-size + $dot-margin) * 2 0 0 var(--code-header-muted-color);
|
187
200
|
}
|
188
201
|
|
189
|
-
|
202
|
+
/* the label block */
|
190
203
|
span {
|
191
|
-
|
204
|
+
/* label icon */
|
192
205
|
i {
|
193
206
|
font-size: 1rem;
|
194
207
|
margin-right: 0.4rem;
|
@@ -201,19 +214,19 @@ div {
|
|
201
214
|
|
202
215
|
@at-root [file] #{&} > i {
|
203
216
|
position: relative;
|
204
|
-
top: 1px;
|
217
|
+
top: 1px; /* center the file icon */
|
205
218
|
}
|
206
219
|
|
207
|
-
|
220
|
+
/* label text */
|
208
221
|
&::after {
|
209
|
-
content: attr(label-text);
|
222
|
+
content: attr(data-label-text);
|
210
223
|
font-size: 0.85rem;
|
211
224
|
font-weight: 600;
|
212
225
|
color: var(--code-header-text-color);
|
213
226
|
}
|
214
227
|
}
|
215
228
|
|
216
|
-
|
229
|
+
/* clipboard */
|
217
230
|
button {
|
218
231
|
@extend %cursor-pointer;
|
219
232
|
|
data/_sass/addon/variables.scss
CHANGED
@@ -4,28 +4,28 @@
|
|
4
4
|
|
5
5
|
/* sidebar */
|
6
6
|
|
7
|
-
$sidebar-width: 260px !default;
|
8
|
-
$sidebar-width-small: 210px !default;
|
9
|
-
$sidebar-width-large: 350px !default;
|
7
|
+
$sidebar-width: 260px !default; /* the basic width */
|
8
|
+
$sidebar-width-small: 210px !default; /* screen width: >= 850px, <= 1199px (iPad landscape) */
|
9
|
+
$sidebar-width-large: 350px !default; /* screen width: >= 1650px */
|
10
10
|
|
11
11
|
/* tabs of sidebar */
|
12
12
|
|
13
|
-
$tab-count: 5 !default;
|
13
|
+
$tab-count: 5 !default; /* backward compatible (version <= 4.0.2) */
|
14
14
|
$tab-height: 3rem !default;
|
15
15
|
$tab-cursor-height: 1.6rem !default;
|
16
16
|
|
17
|
-
$cursor-width: 2px !default;
|
17
|
+
$cursor-width: 2px !default; /* the cursor width of the selected tab */
|
18
18
|
|
19
19
|
/* other framework sizes */
|
20
20
|
|
21
21
|
$topbar-height: 3rem !default;
|
22
22
|
|
23
|
-
$
|
24
|
-
$footer-height-mobile: 6rem !default; // screen width: <= 576px
|
23
|
+
$search-max-width: 210px !default;
|
25
24
|
|
26
|
-
$
|
25
|
+
$footer-height: 5rem !default;
|
26
|
+
$footer-height-mobile: 6rem !default; /* screen width: <= 576px */
|
27
27
|
|
28
|
-
$
|
28
|
+
$main-content-max-width: 1250px !default;
|
29
29
|
|
30
30
|
$bottom-min-height: 35rem !default;
|
31
31
|
|
@@ -69,6 +69,15 @@
|
|
69
69
|
--kbd-wrap-color: #6a6a6a;
|
70
70
|
--kbd-text-color: #d3d3d3;
|
71
71
|
--kbd-bg-color: #242424;
|
72
|
+
--prompt-text-color: rgb(216 212 212 / 75%);
|
73
|
+
--prompt-tip-bg: rgba(77, 187, 95, 0.2);
|
74
|
+
--prompt-tip-icon-color: rgb(5 223 5 / 68%);
|
75
|
+
--prompt-info-bg: rgb(7 59 104 / 80%);
|
76
|
+
--prompt-info-icon-color: #0075d1;
|
77
|
+
--prompt-warning-bg: rgb(90 69 3 / 95%);
|
78
|
+
--prompt-warning-icon-color: rgb(255 165 0 / 80%);
|
79
|
+
--prompt-danger-bg: rgb(86 28 8 / 80%);
|
80
|
+
--prompt-danger-icon-color: #cd0202;
|
72
81
|
|
73
82
|
/* tags */
|
74
83
|
--tag-border: rgb(59, 79, 88);
|
@@ -145,4 +154,4 @@
|
|
145
154
|
color-scheme: none;
|
146
155
|
}
|
147
156
|
|
148
|
-
}
|
157
|
+
} /* dark-scheme */
|
@@ -68,6 +68,19 @@
|
|
68
68
|
--kbd-wrap-color: #bdbdbd;
|
69
69
|
--kbd-text-color: var(--text-color);
|
70
70
|
--kbd-bg-color: white;
|
71
|
+
--prompt-text-color: rgb(46 46 46 / 77%);
|
72
|
+
--prompt-tip-bg: rgb(123 247 144 / 20%);
|
73
|
+
--prompt-tip-icon-color: #03b303;
|
74
|
+
--prompt-info-bg: #e1f5fe;
|
75
|
+
--prompt-info-icon-color: #0070cb;
|
76
|
+
--prompt-warning-bg: rgb(255 243 205);
|
77
|
+
--prompt-warning-icon-color: #ef9c03;
|
78
|
+
--prompt-danger-bg: rgb(248 215 218 / 56%);
|
79
|
+
--prompt-danger-icon-color: #df3c30;
|
80
|
+
|
81
|
+
[class^=prompt-] {
|
82
|
+
--link-underline-color: rgb(219 216 216);
|
83
|
+
}
|
71
84
|
|
72
85
|
/* Categories */
|
73
86
|
--categories-hover-bg: var(--btn-border-color);
|
@@ -78,4 +91,4 @@
|
|
78
91
|
--timeline-node-bg: #c2c6cc;
|
79
92
|
--timeline-year-dot-color: #ffffff;
|
80
93
|
|
81
|
-
}
|
94
|
+
} /* light-scheme */
|
data/_sass/layout/post.scss
CHANGED
@@ -41,8 +41,7 @@ h1 + .post-meta {
|
|
41
41
|
}
|
42
42
|
|
43
43
|
img.preview-img {
|
44
|
-
margin
|
45
|
-
margin-bottom: 0;
|
44
|
+
margin: 0;
|
46
45
|
border-radius: 6px;
|
47
46
|
|
48
47
|
&.bg[data-loaded=true] {
|
@@ -55,7 +54,7 @@ img.preview-img {
|
|
55
54
|
border-bottom: 1px double var(--main-border-color);
|
56
55
|
font-size: 0.85rem;
|
57
56
|
|
58
|
-
.post-meta a {
|
57
|
+
.post-meta a:not(:hover) {
|
59
58
|
@extend %link-underline;
|
60
59
|
}
|
61
60
|
}
|
@@ -173,6 +172,8 @@ nav[data-toggle=toc] {
|
|
173
172
|
|
174
173
|
em {
|
175
174
|
@extend %normal-font-style;
|
175
|
+
|
176
|
+
color: var(--relate-post-date);
|
176
177
|
}
|
177
178
|
|
178
179
|
.card {
|
@@ -194,10 +195,6 @@ nav[data-toggle=toc] {
|
|
194
195
|
}
|
195
196
|
}
|
196
197
|
|
197
|
-
.timeago {
|
198
|
-
color: var(--relate-post-date);
|
199
|
-
}
|
200
|
-
|
201
198
|
p {
|
202
199
|
font-size: 0.9rem;
|
203
200
|
margin-bottom: 0.5rem;
|
data/_tabs/about.md
CHANGED
@@ -4,5 +4,5 @@ icon: fas fa-info-circle
|
|
4
4
|
order: 4
|
5
5
|
---
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
> Add Markdown syntax content to file `_tabs/about.md`{: .filepath } and it will show up on this page.
|
8
|
+
{: .prompt-tip }
|
data/assets/404.html
CHANGED
@@ -7,27 +7,10 @@ redirect_from:
|
|
7
7
|
- /norobots/
|
8
8
|
- /assets/
|
9
9
|
- /posts/
|
10
|
-
|
11
|
-
dynamic_title: true
|
12
10
|
---
|
13
11
|
|
14
12
|
{% include lang.html %}
|
15
13
|
|
16
14
|
<div class="lead">
|
17
|
-
|
18
|
-
{%- capture _head_back -%}
|
19
|
-
<a href="{{ '/' | relative_url }}">{{ site.data.locales[lang].not_found.head_back }}</a>
|
20
|
-
{%- endcapture -%}
|
21
|
-
|
22
|
-
{%- capture _archives_page -%}
|
23
|
-
<a href="{{ 'archives' | relative_url }}">{{ site.data.locales[lang].not_found.archives_page }}</a>
|
24
|
-
{%- endcapture -%}
|
25
|
-
|
26
15
|
<p>{{site.data.locales[lang].not_found.statment }}</p>
|
27
|
-
|
28
|
-
<p>{{ site.data.locales[lang].not_found.hint_template
|
29
|
-
| replace: ':HEAD_BAK', _head_back
|
30
|
-
| replace: ':ARCHIVES_PAGE', _archives_page }}
|
31
|
-
</p>
|
32
|
-
|
33
16
|
</div>
|
data/assets/js/data/search.json
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
---
|
2
2
|
layout: compress
|
3
|
+
swcache: true
|
3
4
|
---
|
4
5
|
|
5
6
|
[
|
6
7
|
{% for post in site.posts %}
|
7
8
|
{
|
8
|
-
"title":
|
9
|
-
"url":
|
10
|
-
"categories":
|
11
|
-
"tags":
|
9
|
+
"title": {{ post.title | jsonify }},
|
10
|
+
"url": {{ post.url | relative_url | jsonify }},
|
11
|
+
"categories": {{ post.categories | join: ', ' | jsonify }},
|
12
|
+
"tags": {{ post.tags | join: ', ' | jsonify }},
|
12
13
|
"date": "{{ post.date }}",
|
13
14
|
{% include no-linenos.html content=post.content %}
|
14
|
-
"snippet":
|
15
|
+
"snippet": {{ content | strip_html | strip_newlines | jsonify }}
|
15
16
|
}{% unless forloop.last %},{% endunless %}
|
16
17
|
{% endfor %}
|
17
18
|
]
|
data/assets/js/data/swcache.js
CHANGED
@@ -9,13 +9,7 @@ const resource = [
|
|
9
9
|
/* --- CSS --- */
|
10
10
|
'{{ "/assets/css/style.css" | relative_url }}',
|
11
11
|
|
12
|
-
/* ---
|
13
|
-
{% assign js_path = "/assets/js" | relative_url %}
|
14
|
-
'{{ js_path }}/dist/home.min.js',
|
15
|
-
'{{ js_path }}/dist/page.min.js',
|
16
|
-
'{{ js_path }}/dist/post.min.js',
|
17
|
-
'{{ js_path }}/dist/categories.min.js',
|
18
|
-
'{{ js_path }}/data/search.json',
|
12
|
+
/* --- PWA --- */
|
19
13
|
'{{ "/app.js" | relative_url }}',
|
20
14
|
'{{ "/sw.js" | relative_url }}',
|
21
15
|
|
@@ -26,30 +20,27 @@ const resource = [
|
|
26
20
|
'{{ tab.url | relative_url }}',
|
27
21
|
{% endfor %}
|
28
22
|
|
29
|
-
/* --- Favicons --- */
|
30
|
-
{% assign
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
'{{ favicon_path }}/apple-touch-icon.png',
|
35
|
-
'{{ favicon_path }}/favicon-16x16.png',
|
36
|
-
'{{ favicon_path }}/favicon-32x32.png',
|
37
|
-
'{{ favicon_path }}/favicon.ico',
|
38
|
-
'{{ favicon_path }}/mstile-150x150.png',
|
39
|
-
'{{ favicon_path }}/site.webmanifest',
|
40
|
-
'{{ favicon_path }}/browserconfig.xml'
|
23
|
+
/* --- Favicons & compressed JS --- */
|
24
|
+
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
25
|
+
{% for file in cache_list %}
|
26
|
+
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
27
|
+
{% endfor %}
|
41
28
|
|
42
29
|
];
|
43
30
|
|
44
31
|
/* The request url with below domain will be cached */
|
45
32
|
const allowedDomains = [
|
46
|
-
{% if site.google_analytics.id !=
|
33
|
+
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
47
34
|
'www.googletagmanager.com',
|
48
35
|
'www.google-analytics.com',
|
49
36
|
{% endif %}
|
50
37
|
|
51
38
|
'{{ site.url | split: "//" | last }}',
|
52
39
|
|
40
|
+
{% if site.img_cdn contains '//' and site.img_cdn %}
|
41
|
+
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
42
|
+
{% endif %}
|
43
|
+
|
53
44
|
'fonts.gstatic.com',
|
54
45
|
'fonts.googleapis.com',
|
55
46
|
'cdn.jsdelivr.net',
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* Chirpy v5.0
|
2
|
+
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
3
|
* © 2019 Cotes Chung
|
4
4
|
* MIT Licensed
|
5
5
|
*/
|
6
|
-
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(
|
6
|
+
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{const e=$(o.target);let t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();t.blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,a=!1,r=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,a=a||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===a,unlockTopbar:()=>a=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),a=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),a.addClass("unloaded"),e.addClass("unloaded"),r.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),r.removeClass("d-flex"),o.removeClass("unloaded"),a.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function u(){return t.hasClass("loaded")}e.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?u()?c.removeClass("unloaded"):f.off():(f.on(),u()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function a(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||a()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&a()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var e="div.post>h1:first-of-type";const t=$(e),n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=t.text().trim(),a=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(l);let o=new IntersectionObserver(o=>{var e,t;a?(t=$(window).scrollTop(),e=r<t,r=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):a=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});o.observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),$(function(){const o=$(".collapse");o.on("hide.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$("#"+o).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$("#"+o).addClass("hide-border-bottom"))})});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* Chirpy v5.0
|
2
|
+
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
3
|
* © 2019 Cotes Chung
|
4
4
|
* MIT Licensed
|
5
5
|
*/
|
6
|
-
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(
|
6
|
+
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{const e=$(o.target);let t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();t.blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,r=!1,a=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,r=r||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===a,lockOrientation:()=>a=!0,unLockOrientation:()=>a=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),r=$("#topbar-title"),a=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),r.addClass("unloaded"),e.addClass("unloaded"),a.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),a.removeClass("d-flex"),o.removeClass("unloaded"),r.removeClass("unloaded"),e.removeClass("unloaded")}},u=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function f(){return t.hasClass("loaded")}e.click(function(){p.on(),u.on(),i.focus()}),t.click(function(){p.off(),u.off()}),i.focus(function(){a.addClass("input-focus")}),i.focusout(function(){a.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var e="div.post>h1:first-of-type";const t=$(e),n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=t.text().trim(),r=!1,a=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(l);let o=new IntersectionObserver(o=>{var e,t;r?(t=$(window).scrollTop(),e=a<t,a=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});o.observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}});
|
data/assets/js/dist/home.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* Chirpy v5.0
|
2
|
+
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
3
|
* © 2019 Cotes Chung
|
4
4
|
* MIT Licensed
|
5
5
|
*/
|
6
|
-
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(
|
6
|
+
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const t=$(e.target);let o=t.prop("tagName")==="button".toUpperCase()?t:t.parent();o.blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var t="div.post>h1:first-of-type";const o=$(t),n=$("#topbar-title");if(0!==o.length&&!o.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=o.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),o.offset().top<$(window).scrollTop()&&n.text(a);let e=new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});e.observe(document.querySelector(t)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$('meta[name="prefer-datetime-locale"]'),t=0<e.length?e.attr("content").toLowerCase():$("html").attr("lang").substr(0,2),o="data-ts",a="data-df";return{locale:()=>t,attrTimestamp:()=>o,attrDateFormat:()=>a,getTimestamp:e=>Number(e.attr(o)),getDateFormat:e=>e.attr(a)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){const e=dayjs.unix(LocaleHelper.getTimestamp($(this)));var t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const t=$(e.target);let o=t.prop("tagName")==="button".toUpperCase()?t:t.parent();o.blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var t="div.post>h1:first-of-type";const o=$(t),n=$("#topbar-title");if(0!==o.length&&!o.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=o.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),o.offset().top<$(window).scrollTop()&&n.text(a);let e=new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});e.observe(document.querySelector(t)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$('meta[name="prefer-datetime-locale"]'),t=0<e.length?e.attr("content").toLowerCase():$("html").attr("lang").substr(0,2),o="data-ts",a="data-df";return{locale:()=>t,attrTimestamp:()=>o,attrDateFormat:()=>a,getTimestamp:e=>Number(e.attr(o)),getDateFormat:e=>e.attr(a)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){const e=dayjs.unix(LocaleHelper.getTimestamp($(this)));var t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|