jekyll-theme-chirpy 4.0.2 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +66 -33
- data/_config.yml +9 -4
- data/_data/locales/en.yml +90 -0
- data/_data/locales/id-ID.yml +90 -0
- data/_data/locales/zh-CN.yml +89 -0
- data/_includes/disqus.html +42 -13
- data/_includes/footer.html +15 -8
- data/_includes/head.html +7 -6
- data/_includes/js-selector.html +8 -3
- data/_includes/lang.html +8 -0
- data/_includes/no-zero-date.html +13 -0
- data/_includes/panel.html +5 -3
- data/_includes/post-nav.html +4 -4
- data/_includes/post-paginator.html +9 -1
- data/_includes/post-sharing.html +6 -3
- data/_includes/read-time.html +13 -2
- data/_includes/refactor-content.html +91 -6
- data/_includes/related-posts.html +1 -1
- data/_includes/search-loader.html +2 -2
- data/_includes/search-results.html +1 -1
- data/_includes/sidebar.html +8 -7
- data/_includes/timeago.html +12 -16
- data/_includes/topbar.html +23 -21
- data/_layouts/archives.html +5 -2
- data/_layouts/categories.html +16 -17
- data/_layouts/category.html +4 -2
- data/_layouts/default.html +5 -1
- data/_layouts/home.html +5 -4
- data/_layouts/page.html +8 -1
- data/_layouts/post.html +25 -11
- data/_layouts/tag.html +3 -2
- data/_sass/addon/commons.scss +54 -25
- data/_sass/addon/syntax.scss +96 -36
- data/_sass/addon/variables.scss +25 -13
- data/_sass/colors/dark-syntax.scss +17 -14
- data/_sass/colors/dark-typography.scss +15 -13
- data/_sass/colors/light-syntax.scss +4 -1
- data/_sass/colors/light-typography.scss +12 -11
- data/_sass/jekyll-theme-chirpy.scss +2 -1
- data/_sass/layout/home.scss +30 -15
- data/_sass/layout/post.scss +2 -23
- data/_sass/variables-hook.scss +3 -0
- data/assets/404.html +17 -5
- data/assets/css/style.scss +7 -2
- data/assets/feed.xml +1 -1
- data/assets/js/data/search.json +1 -1
- data/assets/js/dist/categories.min.js +1 -1
- data/assets/js/dist/commons.min.js +1 -1
- data/assets/js/dist/home.min.js +2 -2
- 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 +8 -6
- data/_data/date_format.yml +0 -7
- data/_data/label.yml +0 -19
- data/_data/rights.yml +0 -11
- data/assets/js/lib/jquery.disqusloader.min.js +0 -8
@@ -3,20 +3,6 @@
|
|
3
3
|
*/
|
4
4
|
|
5
5
|
@mixin dark-syntax {
|
6
|
-
/* ----- My styles ------ */
|
7
|
-
--highlight-bg-color: #252525;
|
8
|
-
--highlighter-rouge-color: #de6b18;
|
9
|
-
--highlight-lineno-color: #6c6c6d;
|
10
|
-
--highlight-lineno-border-color: #303435;
|
11
|
-
--inline-code-bg: #272822;
|
12
|
-
|
13
|
-
.highlight {
|
14
|
-
.gp { color: #818c96; }
|
15
|
-
}
|
16
|
-
|
17
|
-
pre { color: #bfbfbf; } /* override Bootstrap */
|
18
|
-
kbd { background-color: black; }
|
19
|
-
|
20
6
|
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
21
7
|
.highlight pre { background-color: var(--highlight-bg-color); }
|
22
8
|
.highlight .hll { background-color: var(--highlight-bg-color); }
|
@@ -81,4 +67,21 @@
|
|
81
67
|
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
82
68
|
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
83
69
|
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
70
|
+
|
71
|
+
/* ----- custom styles ------ */
|
72
|
+
|
73
|
+
--highlight-bg-color: #252525;
|
74
|
+
--highlighter-rouge-color: #de6b18;
|
75
|
+
--highlight-lineno-color: #6c6c6d;
|
76
|
+
--inline-code-bg: #272822;
|
77
|
+
--code-header-bg: #353535;
|
78
|
+
--lang-badge-color: #6c6c6d;
|
79
|
+
--clipboard-checked-color: #2bcc2b;
|
80
|
+
|
81
|
+
.highlight {
|
82
|
+
.gp { color: #818c96; }
|
83
|
+
}
|
84
|
+
|
85
|
+
pre { color: #bfbfbf; } /* override Bootstrap */
|
86
|
+
kbd { background-color: black; }
|
84
87
|
}
|
@@ -3,26 +3,23 @@
|
|
3
3
|
*/
|
4
4
|
|
5
5
|
@mixin dark-scheme {
|
6
|
-
/*
|
7
|
-
--main-wrapper-bg: rgb(27, 27, 30);
|
6
|
+
/* Framework color */
|
8
7
|
--body-bg: var(--main-wrapper-bg);
|
9
|
-
--topbar-wrapper-bg: rgb(39, 40, 43);
|
10
|
-
--search-wrapper-bg: rgb(34, 34, 39);
|
11
|
-
--search-icon-color: rgb(100, 102, 105);
|
12
|
-
--input-focus-border-color: rgb(112, 114, 115);
|
13
8
|
--mask-bg: rgb(68, 69, 70);
|
14
|
-
--
|
9
|
+
--main-wrapper-bg: rgb(27, 27, 30);
|
10
|
+
--main-border-color: rgb(44, 45, 45);
|
11
|
+
--scrollbar-track-bg: rgba(0, 0, 0, 0.3);
|
12
|
+
--scrollbar-thumb-bg: rgb(173 171 171 / 50%);
|
15
13
|
|
16
|
-
/*
|
14
|
+
/* Common color */
|
17
15
|
--text-color: rgb(175, 176, 177);
|
18
|
-
--heading-color: #cccccc;
|
19
16
|
--text-muted-color: rgb(107, 116, 124);
|
17
|
+
--heading-color: #cccccc;
|
18
|
+
--blockquote-border-color: rgb(66, 66, 66);
|
19
|
+
--blockquote-text-color: rgb(117, 117, 117);
|
20
20
|
--link-color: rgb(138, 180, 248);
|
21
21
|
--link-underline-color: rgb(82, 108, 150);
|
22
|
-
--main-border-color: rgb(44, 45, 45);
|
23
22
|
--button-bg: rgb(39, 40, 43);
|
24
|
-
--blockquote-border-color: rgb(66, 66, 66);
|
25
|
-
--blockquote-text-color: rgb(117, 117, 117);
|
26
23
|
--btn-border-color: rgb(63, 65, 68);
|
27
24
|
--btn-backtotop-color: var(--text-color);
|
28
25
|
--btn-backtotop-border-color: var(--btn-border-color);
|
@@ -36,8 +33,12 @@
|
|
36
33
|
--nav-cursor-color: rgb(183, 182, 182);
|
37
34
|
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
|
38
35
|
|
39
|
-
/*
|
36
|
+
/* Topbar */
|
40
37
|
--topbar-text-color: var(--text-color);
|
38
|
+
--topbar-wrapper-bg: rgb(39, 40, 43);
|
39
|
+
--search-wrapper-bg: rgb(34, 34, 39);
|
40
|
+
--search-icon-color: rgb(100, 102, 105);
|
41
|
+
--input-focus-border-color: rgb(112, 114, 115);
|
41
42
|
|
42
43
|
/* Home page */
|
43
44
|
--post-list-text-color: rgb(175, 176, 177);
|
@@ -82,6 +83,7 @@
|
|
82
83
|
--timeline-year-dot-color: var(--timeline-color);
|
83
84
|
|
84
85
|
/* Footer */
|
86
|
+
--footer-bg-color: var(--main-wrapper-bg);
|
85
87
|
--footer-link: rgb(171, 171, 171);
|
86
88
|
|
87
89
|
.post-content img {
|
@@ -70,6 +70,9 @@
|
|
70
70
|
--highlight-bg-color: #f7f7f7;
|
71
71
|
--highlighter-rouge-color: #2f2f2f;
|
72
72
|
--highlight-lineno-color: #c2c6cc;
|
73
|
-
--highlight-lineno-border-color: #e9ecef;
|
74
73
|
--inline-code-bg: #f3f3f3;
|
74
|
+
--code-header-bg: #eaeaea;
|
75
|
+
--lang-badge-color: #a4a7ab;
|
76
|
+
--clipboard-checked-color: #43c743;
|
77
|
+
|
75
78
|
} // light-syntax
|
@@ -3,22 +3,24 @@
|
|
3
3
|
*/
|
4
4
|
|
5
5
|
@mixin light-scheme {
|
6
|
-
/*
|
6
|
+
/* Framework color */
|
7
7
|
--body-bg: #fafafa;
|
8
8
|
--mask-bg: #c1c3c5;
|
9
9
|
--main-wrapper-bg: white;
|
10
10
|
--main-border-color: #f3f3f3;
|
11
|
-
--
|
11
|
+
--scrollbar-track-bg: rgba(0, 0, 0, 0.3);
|
12
|
+
--scrollbar-thumb-bg: rgba(0, 0, 0, 0.3);
|
13
|
+
|
14
|
+
/* Common color */
|
12
15
|
--text-color: #34343c;
|
16
|
+
--text-muted-color: gray;
|
13
17
|
--heading-color: black;
|
14
18
|
--blockquote-border-color: #eee;
|
15
19
|
--blockquote-text-color: #9a9a9a;
|
16
20
|
--link-color: #2a408e;
|
17
21
|
--link-underline-color: #dee2e6;
|
18
|
-
--text-muted-color: gray;
|
19
|
-
--tb-odd-bg: #fbfcfd;
|
20
|
-
--tb-border-color: #eaeaea;
|
21
22
|
--button-bg: #fff;
|
23
|
+
--btn-border-color: #e9ecef;
|
22
24
|
--btn-backtotop-color: #686868;
|
23
25
|
--btn-backtotop-border-color: #f1f1f1;
|
24
26
|
--btn-box-shadow: #eaeaea;
|
@@ -26,15 +28,12 @@
|
|
26
28
|
--checkbox-checked-color: #07a8f7;
|
27
29
|
|
28
30
|
/* Sidebar */
|
29
|
-
--sidebar-bg: radial-gradient(
|
30
|
-
circle,
|
31
|
-
rgba(42, 30, 107, 1) 0%,
|
32
|
-
rgba(35, 37, 46, 1) 100%);
|
31
|
+
--sidebar-bg: radial-gradient(circle, rgba(42, 30, 107, 1) 0%, rgba(35, 37, 46, 1) 100%);
|
33
32
|
--nav-cursor-color: #fcfcfc;
|
34
33
|
|
35
34
|
/* Topbar */
|
36
|
-
--topbar-wrapper-bg: white;
|
37
35
|
--topbar-text-color: rgb(78, 78, 78);
|
36
|
+
--topbar-wrapper-bg: white;
|
38
37
|
--search-wrapper-bg: #f5f5f5;
|
39
38
|
--search-tag-bg: #f8f9fa;
|
40
39
|
--search-icon-color: #c2c6cc;
|
@@ -58,10 +57,13 @@
|
|
58
57
|
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
59
58
|
--label-color: #616161;
|
60
59
|
--relate-post-date: rgba(30, 55, 70, 0.4);
|
60
|
+
--footnote-target-bg: lightcyan;
|
61
61
|
--tag-bg: rgba(0, 0, 0, 0.075);
|
62
62
|
--tag-border: #dee2e6;
|
63
63
|
--tag-shadow: var(--btn-border-color);
|
64
64
|
--tag-hover: rgb(222, 226, 230);
|
65
|
+
--tb-odd-bg: #fbfcfd;
|
66
|
+
--tb-border-color: #eaeaea;
|
65
67
|
--categories-hover-bg: var(--btn-border-color);
|
66
68
|
--dash-color: silver;
|
67
69
|
|
@@ -72,6 +74,5 @@
|
|
72
74
|
|
73
75
|
/* Footer */
|
74
76
|
--footer-bg-color: #ffffff;
|
75
|
-
--footnote-target-bg: lightcyan;
|
76
77
|
--footer-link: #424242;
|
77
78
|
} // light-scheme
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
2
|
* The styles for Jekyll theme Chirpy
|
3
3
|
*
|
4
|
-
* Chirpy v4.
|
4
|
+
* Chirpy v4.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
5
5
|
* © 2019 Cotes Chung
|
6
6
|
* MIT Licensed
|
7
7
|
*/
|
@@ -12,6 +12,7 @@
|
|
12
12
|
|
13
13
|
"addon/module",
|
14
14
|
"addon/variables",
|
15
|
+
"variables-hook",
|
15
16
|
"addon/syntax",
|
16
17
|
"addon/commons",
|
17
18
|
|
data/_sass/layout/home.scss
CHANGED
@@ -3,27 +3,24 @@
|
|
3
3
|
*/
|
4
4
|
|
5
5
|
.pagination {
|
6
|
-
|
6
|
+
color: var(--btn-patinator-text-color);
|
7
|
+
font-family: 'Lato', sans-serif;
|
8
|
+
|
7
9
|
a:hover {
|
8
10
|
text-decoration: none;
|
9
11
|
}
|
10
12
|
|
11
13
|
.page-item {
|
12
14
|
.page-link {
|
13
|
-
color:
|
15
|
+
color: inherit;
|
14
16
|
width: 2.5rem;
|
15
17
|
height: 2.5rem;
|
16
18
|
padding: 0;
|
17
|
-
text-align: center;
|
18
19
|
display: -webkit-box;
|
19
|
-
display: flex;
|
20
20
|
-webkit-box-pack: center;
|
21
|
-
justify-content: center;
|
22
21
|
-webkit-box-align: center;
|
23
|
-
align-items: center;
|
24
22
|
border-radius: 50%;
|
25
23
|
border: 1px solid var(--btn-paginator-border-color);
|
26
|
-
font-family: 'Lato', sans-serif;
|
27
24
|
background-color: var(--button-bg);
|
28
25
|
&:hover {
|
29
26
|
background-color: var(--btn-paginator-hover-color);
|
@@ -49,9 +46,6 @@
|
|
49
46
|
&:last-child .page-link {
|
50
47
|
border-radius: 50%;
|
51
48
|
}
|
52
|
-
&:not(:last-child) {
|
53
|
-
margin-right: 0.7rem;
|
54
|
-
}
|
55
49
|
} // .page-item
|
56
50
|
|
57
51
|
} // .pagination
|
@@ -116,7 +110,15 @@
|
|
116
110
|
/* Hide SideBar and TOC */
|
117
111
|
@media all and (max-width: 830px) {
|
118
112
|
.pagination {
|
119
|
-
justify-content:
|
113
|
+
justify-content: space-evenly;
|
114
|
+
|
115
|
+
.page-item {
|
116
|
+
&:not(:first-child):not(:last-child) {
|
117
|
+
display: none;
|
118
|
+
}
|
119
|
+
|
120
|
+
}
|
121
|
+
|
120
122
|
}
|
121
123
|
}
|
122
124
|
|
@@ -144,11 +146,24 @@
|
|
144
146
|
|
145
147
|
.pagination {
|
146
148
|
font-size: 0.85rem;
|
147
|
-
|
148
|
-
|
149
|
-
|
149
|
+
|
150
|
+
.page-item {
|
151
|
+
&:not(:last-child) {
|
152
|
+
margin-right: 0.7rem;
|
153
|
+
}
|
154
|
+
|
155
|
+
.page-link {
|
156
|
+
width: 2rem;
|
157
|
+
height: 2rem;
|
158
|
+
}
|
159
|
+
|
150
160
|
}
|
151
|
-
|
161
|
+
|
162
|
+
.page-index {
|
163
|
+
display: none;
|
164
|
+
}
|
165
|
+
|
166
|
+
} // .pagination
|
152
167
|
|
153
168
|
}
|
154
169
|
|
data/_sass/layout/post.scss
CHANGED
@@ -23,24 +23,12 @@
|
|
23
23
|
padding-right: $pr;
|
24
24
|
}
|
25
25
|
|
26
|
-
.timeago::before {
|
27
|
-
content: attr(prefix);
|
28
|
-
}
|
29
|
-
|
30
26
|
#post-wrapper .post-meta {
|
31
27
|
> div:nth-child(2) {
|
32
28
|
> span:not(:first-child)::before {
|
33
29
|
@include dot;
|
34
30
|
}
|
35
31
|
}
|
36
|
-
|
37
|
-
#pv::after {
|
38
|
-
content: " views";
|
39
|
-
}
|
40
|
-
|
41
|
-
.readtime::after {
|
42
|
-
content: " read";
|
43
|
-
}
|
44
32
|
}
|
45
33
|
|
46
34
|
.post-content {
|
@@ -252,7 +240,8 @@
|
|
252
240
|
}
|
253
241
|
}
|
254
242
|
> i {
|
255
|
-
|
243
|
+
position: relative;
|
244
|
+
bottom: 1px;
|
256
245
|
&:hover {
|
257
246
|
@extend %btn-share-hovor;
|
258
247
|
}
|
@@ -311,16 +300,6 @@
|
|
311
300
|
margin-top: 1rem;
|
312
301
|
}
|
313
302
|
}
|
314
|
-
|
315
|
-
.post-content > div[class^='language-'] {
|
316
|
-
@include ml-mr(-1.25rem);
|
317
|
-
|
318
|
-
border-radius: 0;
|
319
|
-
&::before { // the lang badge
|
320
|
-
right: 1rem;
|
321
|
-
}
|
322
|
-
}
|
323
|
-
|
324
303
|
}
|
325
304
|
|
326
305
|
@media all and (max-width: 768px) {
|
data/assets/404.html
CHANGED
@@ -11,11 +11,23 @@ redirect_from:
|
|
11
11
|
dynamic_title: true
|
12
12
|
---
|
13
13
|
|
14
|
+
{% include lang.html %}
|
15
|
+
|
14
16
|
<div class="lead">
|
15
|
-
|
16
|
-
|
17
|
-
<a href="{{ '/' | relative_url }}">
|
18
|
-
|
19
|
-
|
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
|
+
<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 }}
|
20
31
|
</p>
|
32
|
+
|
21
33
|
</div>
|
data/assets/css/style.scss
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
---
|
2
2
|
---
|
3
3
|
|
4
|
-
|
4
|
+
/*
|
5
|
+
If the number of TAB files has changed, the following variable is required.
|
6
|
+
And it must be defined before `@import`.
|
7
|
+
*/
|
5
8
|
$tab-count: {{ site.tabs | size | plus: 1 }}; // plus 1 for home tab
|
6
9
|
|
7
|
-
@import "
|
10
|
+
@import "{{ site.theme }}";
|
11
|
+
|
12
|
+
/* append your custom style below */
|
data/assets/feed.xml
CHANGED
@@ -15,7 +15,7 @@ permalink: /feed.xml
|
|
15
15
|
<uri>{{ "/" | absolute_url }}</uri>
|
16
16
|
</author>
|
17
17
|
<link rel="self" type="application/atom+xml" href="{{ page.url | absolute_url }}"/>
|
18
|
-
<link rel="alternate" type="text/html" hreflang="{{ site.lang
|
18
|
+
<link rel="alternate" type="text/html" hreflang="{{ site.lang }}"
|
19
19
|
href="{{ '/' | absolute_url }}"/>
|
20
20
|
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
|
21
21
|
<rights> © {{ 'now' | date: '%Y' }} {{ site.social.name }} </rights>
|
data/assets/js/data/search.json
CHANGED
@@ -11,7 +11,7 @@ layout: compress
|
|
11
11
|
"tags": "{{ post.tags | join: ', ' }}",
|
12
12
|
"date": "{{ post.date }}",
|
13
13
|
{% include no-linenos.html content=post.content %}
|
14
|
-
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape |
|
14
|
+
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}"
|
15
15
|
}{% unless forloop.last %},{% endunless %}
|
16
16
|
{% endfor %}
|
17
17
|
]
|
data/assets/js/dist/home.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* Chirpy v4.
|
2
|
+
* Chirpy v4.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
3
|
* © 2019 Cotes Chung
|
4
4
|
* MIT Licensed
|
5
5
|
*/
|
6
|
-
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"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(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),
|
6
|
+
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"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(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),l=$("#main"),n=$("#topbar-title"),s=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),d=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),p={on(){e.addClass("unloaded"),n.addClass("unloaded"),t.addClass("unloaded"),s.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),s.removeClass("d-flex"),e.removeClass("unloaded"),n.removeClass("unloaded"),t.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),l.addClass("unloaded"),e=!0)},off(){e&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),l.removeClass("unloaded"),u.release(),d.val(""),e=!1)},isVisible:()=>e}}();function h(){return o.hasClass("loaded")}t.click(function(){p.on(),f.on(),d.focus()}),o.click(function(){p.off(),f.off()}),d.focus(function(){s.addClass("input-focus")}),d.focusout(function(){s.removeClass("input-focus")}),d.on("keyup",function(e){8===e.keyCode&&""===d.val()?h()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),h()?(c.removeClass("unloaded"),i.empty()):f.off(),d.focus(),a.removeClass("visible")})}),$(function(){const e=function(){let e=!1;const t=$("body");return{toggle(){!1===e?t.attr("sidebar-display",""):t.removeAttr("sidebar-display"),e=!e}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#topbar-wrapper"),t=$("#toc-wrapper"),o=$(".access"),a=$("#search-input");let l,n=0;const s=5,r=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(l=!0)}),setInterval(function(){l&&(!function(){var l=$(this).scrollTop();Math.abs(n-l)<=s||(l>n&&l>r?(e.removeClass("topbar-down").addClass("topbar-up"),t.length>0&&t.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),a.is(":focus")&&a.blur()):l+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),t.length>0&&t.addClass("topbar-down"),o.length>0&&o.addClass("topbar-down")),n=l)}(),l=!1)},250)}),$(function(){const e=$("#topbar-title"),t=$("div.post>h1"),o=e.text().trim();let a=t.length>0?t.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||t.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==a&&e.text(a):e.text()!==o&&e.text(o)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){let e=$(".timeago").length,t=void 0;const o=$("meta[name=day-prompt]").attr("content"),a=$("meta[name=hour-prompt]").attr("content"),l=$("meta[name=minute-prompt]").attr("content"),n=$("meta[name=justnow-prompt]").attr("content");function s(){return $(".timeago").each(function(){if($(this).children("i").length>0){let t=$(this).clone().children().remove().end().text(),s=$(this).children("i"),r=s.text();$(this).text(function(t,s){let r=new Date,i=new Date(t);if(i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth())return s;let d=Math.floor((r-i)/1e3),c=Math.floor(d/86400);if(c>=1)return e-=1,` ${c} ${o}`;let u=Math.floor(d/3600);if(u>=1)return` ${u} ${a}`;let $=Math.floor(d/60);return $>=1?` ${$} ${l}`:n}(r,t)),$(this).append(s)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&s()>0&&(t=setInterval(s,6e4))});
|
data/assets/js/dist/page.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* Chirpy v4.
|
2
|
+
* Chirpy v4.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
3
|
* © 2019 Cotes Chung
|
4
4
|
* MIT Licensed
|
5
5
|
*/
|
6
|
-
|
6
|
+
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"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(){const t=$("#sidebar-trigger"),e=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),s=$("#main"),n=$("#topbar-title"),l=$("#search-wrapper"),i=$("#search-result-wrapper"),c=$("#search-results"),r=$("#search-input"),d=$("#search-hints"),u=function(){let t=0;return{block(){t=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(t)},getOffset:()=>t}}(),p={on(){t.addClass("unloaded"),n.addClass("unloaded"),e.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),t.removeClass("unloaded"),n.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let t=!1;return{on(){t||(u.block(),i.removeClass("unloaded"),s.addClass("unloaded"),t=!0)},off(){t&&(c.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),i.addClass("unloaded"),a.removeClass("visible"),s.removeClass("unloaded"),u.release(),r.val(""),t=!1)},isVisible:()=>t}}();function h(){return o.hasClass("loaded")}e.click(function(){p.on(),f.on(),r.focus()}),o.click(function(){p.off(),f.off()}),r.focus(function(){l.addClass("input-focus")}),r.focusout(function(){l.removeClass("input-focus")}),r.on("keyup",function(t){8===t.keyCode&&""===r.val()?h()?d.removeClass("unloaded"):f.off():""!==r.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&d.addClass("unloaded"))}),a.on("click",function(){r.val(""),h()?(d.removeClass("unloaded"),c.empty()):f.off(),r.focus(),a.removeClass("visible")})}),$(function(){const t=function(){let t=!1;const e=$("body");return{toggle(){!1===t?e.attr("sidebar-display",""):e.removeAttr("sidebar-display"),t=!t}}}();$("#sidebar-trigger").click(t.toggle),$("#mask").click(t.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),e=$("#toc-wrapper"),o=$(".access"),a=$("#search-input");let s,n=0;const l=5,i=t.outerHeight();$(window).scroll(function(t){$("#topbar-title").is(":hidden")&&(s=!0)}),setInterval(function(){s&&(!function(){var s=$(this).scrollTop();Math.abs(n-s)<=l||(s>n&&s>i?(t.removeClass("topbar-down").addClass("topbar-up"),e.length>0&&e.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),a.is(":focus")&&a.blur()):s+$(window).height()<$(document).height()&&(t.removeClass("topbar-up").addClass("topbar-down"),e.length>0&&e.addClass("topbar-down"),o.length>0&&o.addClass("topbar-down")),n=s)}(),s=!1)},250)}),$(function(){const t=$("#topbar-title"),e=$("div.post>h1"),o=t.text().trim();let a=e.length>0?e.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||e.is(":hidden")||t.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?t.text()!==a&&t.text(a):t.text()!==o&&t.text(o)}),t.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){$("input[type=checkbox]").addClass("unloaded"),$("input[type=checkbox][checked]").before('<i class="fas fa-check-circle checked"></i>'),$("input[type=checkbox]:not([checked])").before('<i class="far fa-circle"></i>')}),$(function(){const t="#main > div.row:first-child > div:first-child";if($(`${t} img`).length<=0)return;const e=document.querySelectorAll(`${t} img[data-src]`);lozad(e).observe(),$(`${t} p > img[data-src],${t} img[data-src].preview-img`).each(function(){let t=$(this).next();const e="EM"===t.prop("tagName")?t.text():"",o=$(this).attr("data-src");$(this).wrap(`<a href="${o}" title="${e}" class="popup"></a>`)}),$(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),$(`${t} a`).has("img").addClass("img-link")}),$(function(){const t="fas fa-check",e="timeout",o=2e3;function a(t){if($(t)[0].hasAttribute(e)){let o=$(t).attr(e);if(Number(o)>Date.now())return!0}return!1}function s(t){$(t).attr(e,Date.now()+o)}function n(t){$(t).removeAttr(e)}const l=new ClipboardJS(".code-header>button",{target:t=>t.parentNode.nextElementSibling.querySelector("code .rouge-code")});$(".code-header>button").tooltip({trigger:"click",placement:"left"});const i=$(".code-header>button").children().attr("class");l.on("success",e=>{e.clearSelection();const l=e.trigger;a(l)||(!function(e){$(e).children().attr("class",t),s(e)}(l),function(t){$(t).tooltip("show")}(l),setTimeout(()=>{!function(t){$(t).tooltip("hide"),n(t)}(l),function(t){$(t).children().attr("class",i),n(t)}(l)},o))}),$("#copy-link").click(t=>{let e=$(t.target);if(a(e))return;const l=window.location.href,i=$("<input>");$("body").append(i),i.val(l).select(),document.execCommand("copy"),i.remove();const c=e.attr("data-original-title"),r=e.attr("title-succeed");e.attr("data-original-title",r).tooltip("show"),s(e),setTimeout(()=>{e.attr("data-original-title",c),n(e)},o)})});
|
data/assets/js/dist/post.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* Chirpy v4.
|
2
|
+
* Chirpy v4.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
3
|
* © 2019 Cotes Chung
|
4
4
|
* MIT Licensed
|
5
5
|
*/
|
6
|
-
|
6
|
+
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"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(){const t=$("#sidebar-trigger"),e=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),n=$("#main"),l=$("#topbar-title"),s=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),c=$("#search-input"),d=$("#search-hints"),u=function(){let t=0;return{block(){t=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(t)},getOffset:()=>t}}(),f={on(){t.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),s.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),s.removeClass("d-flex"),t.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},h=function(){let t=!1;return{on(){t||(u.block(),r.removeClass("unloaded"),n.addClass("unloaded"),t=!0)},off(){t&&(i.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),n.removeClass("unloaded"),u.release(),c.val(""),t=!1)},isVisible:()=>t}}();function p(){return o.hasClass("loaded")}e.click(function(){f.on(),h.on(),c.focus()}),o.click(function(){f.off(),h.off()}),c.focus(function(){s.addClass("input-focus")}),c.focusout(function(){s.removeClass("input-focus")}),c.on("keyup",function(t){8===t.keyCode&&""===c.val()?p()?d.removeClass("unloaded"):h.off():""!==c.val()&&(h.on(),a.hasClass("visible")||a.addClass("visible"),p()&&d.addClass("unloaded"))}),a.on("click",function(){c.val(""),p()?(d.removeClass("unloaded"),i.empty()):h.off(),c.focus(),a.removeClass("visible")})}),$(function(){const t=function(){let t=!1;const e=$("body");return{toggle(){!1===t?e.attr("sidebar-display",""):e.removeAttr("sidebar-display"),t=!t}}}();$("#sidebar-trigger").click(t.toggle),$("#mask").click(t.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),e=$("#toc-wrapper"),o=$(".access"),a=$("#search-input");let n,l=0;const s=5,r=t.outerHeight();$(window).scroll(function(t){$("#topbar-title").is(":hidden")&&(n=!0)}),setInterval(function(){n&&(!function(){var n=$(this).scrollTop();Math.abs(l-n)<=s||(n>l&&n>r?(t.removeClass("topbar-down").addClass("topbar-up"),e.length>0&&e.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),a.is(":focus")&&a.blur()):n+$(window).height()<$(document).height()&&(t.removeClass("topbar-up").addClass("topbar-down"),e.length>0&&e.addClass("topbar-down"),o.length>0&&o.addClass("topbar-down")),l=n)}(),n=!1)},250)}),$(function(){const t=$("#topbar-title"),e=$("div.post>h1"),o=t.text().trim();let a=e.length>0?e.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||e.is(":hidden")||t.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?t.text()!==a&&t.text(a):t.text()!==o&&t.text(o)}),t.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const t="#main > div.row:first-child > div:first-child";if($(`${t} img`).length<=0)return;const e=document.querySelectorAll(`${t} img[data-src]`);lozad(e).observe(),$(`${t} p > img[data-src],${t} img[data-src].preview-img`).each(function(){let t=$(this).next();const e="EM"===t.prop("tagName")?t.text():"",o=$(this).attr("data-src");$(this).wrap(`<a href="${o}" title="${e}" class="popup"></a>`)}),$(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),$(`${t} a`).has("img").addClass("img-link")}),$(function(){let t=$(".timeago").length,e=void 0;const o=$("meta[name=day-prompt]").attr("content"),a=$("meta[name=hour-prompt]").attr("content"),n=$("meta[name=minute-prompt]").attr("content"),l=$("meta[name=justnow-prompt]").attr("content");function s(){return $(".timeago").each(function(){if($(this).children("i").length>0){let e=$(this).clone().children().remove().end().text(),s=$(this).children("i"),r=s.text();$(this).text(function(e,s){let r=new Date,i=new Date(e);if(i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth())return s;let c=Math.floor((r-i)/1e3),d=Math.floor(c/86400);if(d>=1)return t-=1,` ${d} ${o}`;let u=Math.floor(c/3600);if(u>=1)return` ${u} ${a}`;let f=Math.floor(c/60);return f>=1?` ${f} ${n}`:l}(r,e)),$(this).append(s)}}),0===t&&void 0!==e&&clearInterval(e),t}0!==t&&s()>0&&(e=setInterval(s,6e4))}),$(function(){$("input[type=checkbox]").addClass("unloaded"),$("input[type=checkbox][checked]").before('<i class="fas fa-check-circle checked"></i>'),$("input[type=checkbox]:not([checked])").before('<i class="far fa-circle"></i>')}),$(function(){const t="fas fa-check",e="timeout",o=2e3;function a(t){if($(t)[0].hasAttribute(e)){let o=$(t).attr(e);if(Number(o)>Date.now())return!0}return!1}function n(t){$(t).attr(e,Date.now()+o)}function l(t){$(t).removeAttr(e)}const s=new ClipboardJS(".code-header>button",{target:t=>t.parentNode.nextElementSibling.querySelector("code .rouge-code")});$(".code-header>button").tooltip({trigger:"click",placement:"left"});const r=$(".code-header>button").children().attr("class");s.on("success",e=>{e.clearSelection();const s=e.trigger;a(s)||(!function(e){$(e).children().attr("class",t),n(e)}(s),function(t){$(t).tooltip("show")}(s),setTimeout(()=>{!function(t){$(t).tooltip("hide"),l(t)}(s),function(t){$(t).children().attr("class",r),l(t)}(s)},o))}),$("#copy-link").click(t=>{let e=$(t.target);if(a(e))return;const s=window.location.href,r=$("<input>");$("body").append(r),r.val(s).select(),document.execCommand("copy"),r.remove();const i=e.attr("data-original-title"),c=e.attr("title-succeed");e.attr("data-original-title",c).tooltip("show"),n(e),setTimeout(()=>{e.attr("data-original-title",i),l(e)},o)})}),$(function(){$("a[href*='#']").not("[href='#']").not("[href='#0']").click(function(t){if(this.pathname.replace(/^\//,"")===location.pathname.replace(/^\//,"")&&location.hostname===this.hostname){const e=16,o=decodeURI(this.hash);let a=RegExp(/^#fnref:/).test(o),n=RegExp(/^#fn:/).test(o),l=o.includes(":")?o.replace(/\:/,"\\:"):o,s=$(l);if(s.length){t.preventDefault(),history.pushState&&history.pushState(null,null,o);let l=$(this).offset().top,r=s.offset().top;const i=r<l,c=$("#topbar-wrapper").outerHeight();i&&a&&(r-=c+e/2),$("html,body").animate({scrollTop:r},800,()=>{const t=$(s);t.focus();if($("[scroll-focus=true]").length&&$("[scroll-focus=true]").attr("scroll-focus",!1),$(":target").length&&$(":target").attr("scroll-focus",!1),(n||a)&&t.attr("scroll-focus",!0),t.is(":focus"))return!1;t.attr("tabindex","-1"),t.focus()})}}})});
|