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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +66 -33
  3. data/_config.yml +9 -4
  4. data/_data/locales/en.yml +90 -0
  5. data/_data/locales/id-ID.yml +90 -0
  6. data/_data/locales/zh-CN.yml +89 -0
  7. data/_includes/disqus.html +42 -13
  8. data/_includes/footer.html +15 -8
  9. data/_includes/head.html +7 -6
  10. data/_includes/js-selector.html +8 -3
  11. data/_includes/lang.html +8 -0
  12. data/_includes/no-zero-date.html +13 -0
  13. data/_includes/panel.html +5 -3
  14. data/_includes/post-nav.html +4 -4
  15. data/_includes/post-paginator.html +9 -1
  16. data/_includes/post-sharing.html +6 -3
  17. data/_includes/read-time.html +13 -2
  18. data/_includes/refactor-content.html +91 -6
  19. data/_includes/related-posts.html +1 -1
  20. data/_includes/search-loader.html +2 -2
  21. data/_includes/search-results.html +1 -1
  22. data/_includes/sidebar.html +8 -7
  23. data/_includes/timeago.html +12 -16
  24. data/_includes/topbar.html +23 -21
  25. data/_layouts/archives.html +5 -2
  26. data/_layouts/categories.html +16 -17
  27. data/_layouts/category.html +4 -2
  28. data/_layouts/default.html +5 -1
  29. data/_layouts/home.html +5 -4
  30. data/_layouts/page.html +8 -1
  31. data/_layouts/post.html +25 -11
  32. data/_layouts/tag.html +3 -2
  33. data/_sass/addon/commons.scss +54 -25
  34. data/_sass/addon/syntax.scss +96 -36
  35. data/_sass/addon/variables.scss +25 -13
  36. data/_sass/colors/dark-syntax.scss +17 -14
  37. data/_sass/colors/dark-typography.scss +15 -13
  38. data/_sass/colors/light-syntax.scss +4 -1
  39. data/_sass/colors/light-typography.scss +12 -11
  40. data/_sass/jekyll-theme-chirpy.scss +2 -1
  41. data/_sass/layout/home.scss +30 -15
  42. data/_sass/layout/post.scss +2 -23
  43. data/_sass/variables-hook.scss +3 -0
  44. data/assets/404.html +17 -5
  45. data/assets/css/style.scss +7 -2
  46. data/assets/feed.xml +1 -1
  47. data/assets/js/data/search.json +1 -1
  48. data/assets/js/dist/categories.min.js +1 -1
  49. data/assets/js/dist/commons.min.js +1 -1
  50. data/assets/js/dist/home.min.js +2 -2
  51. data/assets/js/dist/page.min.js +2 -2
  52. data/assets/js/dist/post.min.js +2 -2
  53. data/assets/js/dist/pvreport.min.js +1 -1
  54. metadata +8 -6
  55. data/_data/date_format.yml +0 -7
  56. data/_data/label.yml +0 -19
  57. data/_data/rights.yml +0 -11
  58. 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
- /* framework */
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
- --footer-bg-color: var(--main-wrapper-bg);
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
- /* common color */
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
- /* Top Bar */
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
- /* Common */
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
- --btn-border-color: #e9ecef;
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.0.2 (https://github.com/cotes2020/jekyll-theme-chirpy)
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
 
@@ -3,27 +3,24 @@
3
3
  */
4
4
 
5
5
  .pagination {
6
- font-size: 1rem;
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: var(--btn-patinator-text-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: center;
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
- .page-item .page-link {
148
- width: 2.2rem;
149
- height: 2.2rem;
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
 
@@ -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
- padding-top: 0.35rem;
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) {
@@ -0,0 +1,3 @@
1
+ /*
2
+ Appending custom SCSS variables will override the default ones in `_sass/addon/variables.scsss`
3
+ */
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
- <p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
16
- <p>
17
- <a href="{{ '/' | relative_url }}">Head back Home</a>
18
- to try finding it again, or search for it on the
19
- <a href="{{ 'archives' | relative_url }}">Archives page</a>.
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>
@@ -1,7 +1,12 @@
1
1
  ---
2
2
  ---
3
3
 
4
- // see: /_sass/addon/commons.scss
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 "jekyll-theme-chirpy";
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 | default: 'en' }}"
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>
@@ -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 | truncate: 300 | replace: '\', '\\\\' }}"
14
+ "snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}"
15
15
  }{% unless forloop.last %},{% endunless %}
16
16
  {% endfor %}
17
17
  ]
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v4.0.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v4.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Chirpy v4.0.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2
+ * Chirpy v4.2.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3
3
  * © 2019 Cotes Chung
4
4
  * MIT Licensed
5
5
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Chirpy v4.0.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
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"),s=$("#main"),l=$("#topbar-title"),n=$("#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}}(),h={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),n.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),s.addClass("unloaded"),e=!0)},off(){e&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),s.removeClass("unloaded"),u.release(),d.val(""),e=!1)},isVisible:()=>e}}();function p(){return o.hasClass("loaded")}t.click(function(){h.on(),f.on(),d.focus()}),o.click(function(){h.off(),f.off()}),d.focus(function(){n.addClass("input-focus")}),d.focusout(function(){n.removeClass("input-focus")}),d.on("keyup",function(e){8===e.keyCode&&""===d.val()?p()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),p()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),p()?(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 s,l=0;const n=5,r=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(s=!0)}),setInterval(function(){s&&(!function(){var s=$(this).scrollTop();Math.abs(l-s)<=n||(s>l&&s>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()):s+$(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")),l=s)}(),s=!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;function o(){return $(".timeago").each(function(){if($(this).children("i").length>0){let t=$(this).children("i"),o=t.text();$(this).text(function(t,o){let a=new Date,s=new Date(t),l=void 0!==o?`${o} `:"";if(s.getFullYear()!==a.getFullYear())return e-=1,l+s.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric"});if(s.getMonth()!==a.getMonth())return e-=1,l+s.toLocaleString("en-US",{month:"short",day:"numeric"});let n=Math.floor((a-s)/1e3),r=Math.floor(n/86400);if(r>=1)return e-=1,r+" day"+(r>1?"s":"")+" ago";let i=Math.floor(n/3600);if(i>=1)return i+" hour"+(i>1?"s":"")+" ago";let d=Math.floor(n/60);return d>=1?d+" minute"+(d>1?"s":"")+" ago":"just now"}(o,$(this).attr("prep"))),$(this).append(t)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&o()>0&&(t=setInterval(o,6e4))});
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))});
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Chirpy v4.0.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
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 copyLink(e){e&&0!==e.length||(e=window.location.href);const o=$("<input>");$("body").append(o),o.val(e).select(),document.execCommand("copy"),o.remove(),alert("Link copied successfully!")}$(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"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),i=$("#search-result-wrapper"),c=$("#search-results"),d=$("#search-input"),r=$("#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"),l.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),i.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(c.empty(),r.hasClass("unloaded")&&r.removeClass("unloaded"),i.addClass("unloaded"),s.removeClass("visible"),a.removeClass("unloaded"),u.release(),d.val(""),e=!1)},isVisible:()=>e}}();function h(){return t.hasClass("loaded")}o.click(function(){p.on(),f.on(),d.focus()}),t.click(function(){p.off(),f.off()}),d.focus(function(){n.addClass("input-focus")}),d.focusout(function(){n.removeClass("input-focus")}),d.on("keyup",function(e){8===e.keyCode&&""===d.val()?h()?r.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),s.hasClass("visible")||s.addClass("visible"),h()&&r.addClass("unloaded"))}),s.on("click",function(){d.val(""),h()?(r.removeClass("unloaded"),c.empty()):f.off(),d.focus(),s.removeClass("visible")})}),$(function(){const e=function(){let e=!1;const o=$("body");return{toggle(){!1===e?o.attr("sidebar-display",""):o.removeAttr("sidebar-display"),e=!e}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#topbar-wrapper"),o=$("#toc-wrapper"),t=$(".access"),s=$("#search-input");let a,l=0;const n=5,i=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(a=!0)}),setInterval(function(){a&&(!function(){var a=$(this).scrollTop();Math.abs(l-a)<=n||(a>l&&a>i?(e.removeClass("topbar-down").addClass("topbar-up"),o.length>0&&o.removeClass("topbar-down"),t.length>0&&t.removeClass("topbar-down"),s.is(":focus")&&s.blur()):a+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),o.length>0&&o.addClass("topbar-down"),t.length>0&&t.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=o.length>0?o.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t)}),e.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 e="#main > div.row:first-child > div:first-child";if($(`${e} img`).length<=0)return;const o=document.querySelectorAll(`${e} img[data-src]`);lozad(o).observe(),$(`${e} p > img[data-src],${e} img[data-src].preview-img`).each(function(){let e=$(this).next();const o="EM"===e.prop("tagName")?e.text():"",t=$(this).attr("data-src");$(this).wrap(`<a href="${t}" title="${o}" class="popup"></a>`)}),$(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),$(`${e} a`).has("img").addClass("img-link")});
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)})});
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Chirpy v4.0.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
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 copyLink(t){t&&0!==t.length||(t=window.location.href);const e=$("<input>");$("body").append(e),e.val(t).select(),document.execCommand("copy"),e.remove(),alert("Link copied successfully!")}$(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"),r=$("#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}}(),h={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&&(r.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),i.addClass("unloaded"),a.removeClass("visible"),s.removeClass("unloaded"),u.release(),c.val(""),t=!1)},isVisible:()=>t}}();function p(){return o.hasClass("loaded")}e.click(function(){h.on(),f.on(),c.focus()}),o.click(function(){h.off(),f.off()}),c.focus(function(){l.addClass("input-focus")}),c.focusout(function(){l.removeClass("input-focus")}),c.on("keyup",function(t){8===t.keyCode&&""===c.val()?p()?d.removeClass("unloaded"):f.off():""!==c.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),p()&&d.addClass("unloaded"))}),a.on("click",function(){c.val(""),p()?(d.removeClass("unloaded"),r.empty()):f.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 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(){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;function o(){return $(".timeago").each(function(){if($(this).children("i").length>0){let e=$(this).children("i"),o=e.text();$(this).text(function(e,o){let a=new Date,s=new Date(e),n=void 0!==o?`${o} `:"";if(s.getFullYear()!==a.getFullYear())return t-=1,n+s.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric"});if(s.getMonth()!==a.getMonth())return t-=1,n+s.toLocaleString("en-US",{month:"short",day:"numeric"});let l=Math.floor((a-s)/1e3),i=Math.floor(l/86400);if(i>=1)return t-=1,i+" day"+(i>1?"s":"")+" ago";let r=Math.floor(l/3600);if(r>=1)return r+" hour"+(r>1?"s":"")+" ago";let c=Math.floor(l/60);return c>=1?c+" minute"+(c>1?"s":"")+" ago":"just now"}(o,$(this).attr("prep"))),$(this).append(e)}}),0===t&&void 0!==e&&clearInterval(e),t}0!==t&&o()>0&&(e=setInterval(o,6e4))}),$(function(){const t=new RegExp("^language-([a-z])+$");$("div[class^=language-").each(function(){$(this).attr("class").split(" ").forEach(e=>{if(t.test(e)){let t=e.substring("language-".length);$(this).attr("lang",`${t}`)}})})}),$(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(){$("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),s=RegExp(/^#fn:/).test(o),n=o.includes(":")?o.replace(/\:/,"\\:"):o,l=$(n);if(l.length){t.preventDefault(),history.pushState&&history.pushState(null,null,o);let n=$(this).offset().top,i=l.offset().top;const r=i<n,c=$("#topbar-wrapper").outerHeight();r&&a&&(i-=c+e/2),$("html,body").animate({scrollTop:i},800,()=>{const t=$(l);t.focus();if($("[scroll-focus=true]").length&&$("[scroll-focus=true]").attr("scroll-focus",!1),$(":target").length&&$(":target").attr("scroll-focus",!1),(s||a)&&t.attr("scroll-focus",!0),t.is(":focus"))return!1;t.attr("tabindex","-1"),t.focus()})}}})});
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()})}}})});