jekyll-theme-coo 6.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +29 -0
  3. data/README.md +24 -0
  4. data/_data/locales/ar.yml +91 -0
  5. data/_data/locales/bg-BG.yml +81 -0
  6. data/_data/locales/cs-CZ.yml +89 -0
  7. data/_data/locales/de-DE.yml +87 -0
  8. data/_data/locales/el-GR.yml +91 -0
  9. data/_data/locales/en.yml +91 -0
  10. data/_data/locales/es-ES.yml +77 -0
  11. data/_data/locales/fi-FI.yml +90 -0
  12. data/_data/locales/fr-FR.yml +77 -0
  13. data/_data/locales/hu-HU.yml +79 -0
  14. data/_data/locales/id-ID.yml +77 -0
  15. data/_data/locales/it-IT.yml +90 -0
  16. data/_data/locales/ko-KR.yml +84 -0
  17. data/_data/locales/my-MM.yml +77 -0
  18. data/_data/locales/pt-BR.yml +77 -0
  19. data/_data/locales/ru-RU.yml +87 -0
  20. data/_data/locales/sl-SI.yml +91 -0
  21. data/_data/locales/sv-SE.yml +91 -0
  22. data/_data/locales/th.yml +91 -0
  23. data/_data/locales/tr-TR.yml +77 -0
  24. data/_data/locales/uk-UA.yml +77 -0
  25. data/_data/locales/vi-VN.yml +76 -0
  26. data/_data/locales/zh-CN.yml +83 -0
  27. data/_data/locales/zh-TW.yml +83 -0
  28. data/_data/origin/basic.yml +46 -0
  29. data/_data/origin/cors.yml +57 -0
  30. data/_includes/comments/disqus.html +50 -0
  31. data/_includes/comments/giscus.html +65 -0
  32. data/_includes/comments/utterances.html +50 -0
  33. data/_includes/comments.html +5 -0
  34. data/_includes/datetime.html +20 -0
  35. data/_includes/embed/twitch.html +8 -0
  36. data/_includes/embed/youtube.html +9 -0
  37. data/_includes/favicons.html +17 -0
  38. data/_includes/footer.html +36 -0
  39. data/_includes/google-analytics.html +14 -0
  40. data/_includes/head.html +99 -0
  41. data/_includes/js-selector.html +106 -0
  42. data/_includes/jsdelivr-combine.html +26 -0
  43. data/_includes/lang.html +8 -0
  44. data/_includes/language-alias.html +70 -0
  45. data/_includes/mermaid.html +58 -0
  46. data/_includes/metadata-hook.html +1 -0
  47. data/_includes/mode-toggle.html +143 -0
  48. data/_includes/no-linenos.html +10 -0
  49. data/_includes/notification.html +24 -0
  50. data/_includes/origin-type.html +13 -0
  51. data/_includes/post-nav.html +34 -0
  52. data/_includes/post-paginator.html +91 -0
  53. data/_includes/post-sharing.html +52 -0
  54. data/_includes/read-time.html +37 -0
  55. data/_includes/refactor-content.html +266 -0
  56. data/_includes/related-posts.html +96 -0
  57. data/_includes/search-loader.html +47 -0
  58. data/_includes/search-results.html +10 -0
  59. data/_includes/sidebar.html +106 -0
  60. data/_includes/toc.html +13 -0
  61. data/_includes/topbar.html +82 -0
  62. data/_includes/trending-tags.html +46 -0
  63. data/_includes/update-list.html +39 -0
  64. data/_layouts/archives.html +35 -0
  65. data/_layouts/categories.html +138 -0
  66. data/_layouts/category.html +24 -0
  67. data/_layouts/compress.html +10 -0
  68. data/_layouts/default.html +87 -0
  69. data/_layouts/home.html +16 -0
  70. data/_layouts/page.html +22 -0
  71. data/_layouts/post.html +24 -0
  72. data/_layouts/tag.html +23 -0
  73. data/_layouts/tags.html +22 -0
  74. data/_sass/addon/commons.scss +1537 -0
  75. data/_sass/addon/module.scss +200 -0
  76. data/_sass/addon/syntax.scss +292 -0
  77. data/_sass/addon/variables.scss +33 -0
  78. data/_sass/colors/syntax-dark.scss +164 -0
  79. data/_sass/colors/syntax-light.scss +214 -0
  80. data/_sass/colors/typography-dark.scss +151 -0
  81. data/_sass/colors/typography-light.scss +112 -0
  82. data/_sass/layout/archives.scss +144 -0
  83. data/_sass/layout/categories.scss +83 -0
  84. data/_sass/layout/category-tag.scss +72 -0
  85. data/_sass/layout/home.scss +189 -0
  86. data/_sass/layout/post.scss +357 -0
  87. data/_sass/layout/tags.scss +19 -0
  88. data/_sass/main.scss +13 -0
  89. data/_sass/variables-hook.scss +3 -0
  90. data/assets/404.html +14 -0
  91. data/assets/css/jekyll-theme-coo.scss +6 -0
  92. data/assets/feed.xml +61 -0
  93. data/assets/img/favicons/android-chrome-192x192.png +0 -0
  94. data/assets/img/favicons/android-chrome-512x512.png +0 -0
  95. data/assets/img/favicons/apple-touch-icon.png +0 -0
  96. data/assets/img/favicons/browserconfig.xml +13 -0
  97. data/assets/img/favicons/favicon-16x16.png +0 -0
  98. data/assets/img/favicons/favicon-32x32.png +0 -0
  99. data/assets/img/favicons/favicon.ico +0 -0
  100. data/assets/img/favicons/mstile-150x150.png +0 -0
  101. data/assets/img/favicons/site.webmanifest +26 -0
  102. data/assets/js/data/search.json +20 -0
  103. data/assets/js/data/swcache.js +49 -0
  104. data/assets/js/dist/categories.min.js +4 -0
  105. data/assets/js/dist/commons.min.js +4 -0
  106. data/assets/js/dist/home.min.js +4 -0
  107. data/assets/js/dist/misc.min.js +4 -0
  108. data/assets/js/dist/page.min.js +4 -0
  109. data/assets/js/dist/post.min.js +4 -0
  110. data/assets/js/pwa/app.js +47 -0
  111. data/assets/js/pwa/sw.js +89 -0
  112. data/assets/js/pwa/unregister.js +12 -0
  113. data/assets/robots.txt +10 -0
  114. metadata +261 -0
data/assets/feed.xml ADDED
@@ -0,0 +1,61 @@
1
+ ---
2
+ layout: compress
3
+ permalink: /feed.xml
4
+ # Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html
5
+ ---
6
+
7
+ {% capture source %}
8
+ <feed xmlns="http://www.w3.org/2005/Atom">
9
+ <id>{{ "/" | absolute_url }}</id>
10
+ <title>{{ site.title }}</title>
11
+ <subtitle>{{ site.description }}</subtitle>
12
+ <updated>{{ site.time | date_to_xmlschema }}</updated>
13
+ <author>
14
+ <name>{{ site.social.name }}</name>
15
+ <uri>{{ "/" | absolute_url }}</uri>
16
+ </author>
17
+ <link rel="self" type="application/atom+xml" href="{{ page.url | absolute_url }}"/>
18
+ <link rel="alternate" type="text/html" hreflang="{{ site.alt_lang | default: site.lang }}"
19
+ href="{{ '/' | absolute_url }}"/>
20
+ <generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
21
+ <rights> © {{ 'now' | date: '%Y' }} {{ site.social.name }} </rights>
22
+ <icon>{{ site.baseurl }}/assets/img/favicons/favicon.ico</icon>
23
+ <logo>{{ site.baseurl }}/assets/img/favicons/favicon-96x96.png</logo>
24
+
25
+ {% for post in site.posts limit: 5 %}
26
+ {% assign post_absolute_url = post.url | absolute_url %}
27
+ <entry>
28
+ <title>{{ post.title }}</title>
29
+ <link href="{{ post_absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
30
+ <published>{{ post.date | date_to_xmlschema }}</published>
31
+ {% if post.last_modified_at %}
32
+ <updated>{{ post.last_modified_at | date_to_xmlschema }}</updated>
33
+ {% else %}
34
+ <updated>{{ post.date | date_to_xmlschema }}</updated>
35
+ {% endif %}
36
+ <id>{{ post_absolute_url }}</id>
37
+ <content src="{{ post_absolute_url }}" />
38
+ <author>
39
+ <name>{{ post.author | default: site.social.name }}</name>
40
+ </author>
41
+
42
+ {% if post.categories %}
43
+ {% for category in post.categories %}
44
+ <category term="{{ category }}" />
45
+ {% endfor %}
46
+ {% endif %}
47
+
48
+ {% if post.summary %}
49
+ <summary>{{ post.summary | strip }}</summary>
50
+ {% else %}
51
+ <summary>
52
+ {% include no-linenos.html content=post.content %}
53
+ {{ content | strip_html | truncate: 400 }}
54
+ </summary>
55
+ {% endif %}
56
+
57
+ </entry>
58
+ {% endfor %}
59
+ </feed>
60
+ {% endcapture %}
61
+ {{ source | replace: '&', '&amp;' }}
@@ -0,0 +1,13 @@
1
+ ---
2
+ layout: compress
3
+ ---
4
+
5
+ <?xml version="1.0" encoding="utf-8"?>
6
+ <browserconfig>
7
+ <msapplication>
8
+ <tile>
9
+ <square150x150logo src="{{ '/assets/img/favicons/mstile-150x150.png' | relative_url }}" />
10
+ <TileColor>#da532c</TileColor>
11
+ </tile>
12
+ </msapplication>
13
+ </browserconfig>
Binary file
@@ -0,0 +1,26 @@
1
+ ---
2
+ layout: compress
3
+ ---
4
+
5
+ {% assign favicon_path = "/assets/img/favicons" | relative_url %}
6
+
7
+ {
8
+ "name": "{{ site.title }}",
9
+ "short_name": "{{ site.title }}",
10
+ "description": "{{ site.description }}",
11
+ "icons": [
12
+ {
13
+ "src": "{{ favicon_path }}/android-chrome-192x192.png",
14
+ "sizes": "192x192",
15
+ "type": "image/png"
16
+ },
17
+ {
18
+ "src": "{{ favicon_path }}/android-chrome-512x512.png",
19
+ "sizes": "512x512",
20
+ "type": "image/png"
21
+ }],
22
+ "start_url": "{{ '/index.html' | relative_url }}",
23
+ "theme_color": "#2a1e6b",
24
+ "background_color": "#ffffff",
25
+ "display": "fullscreen"
26
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ layout: compress
3
+ swcache: true
4
+ ---
5
+
6
+ [
7
+ {% for post in site.posts %}
8
+ {
9
+ "title": {{ post.title | jsonify }},
10
+ "url": {{ post.url | relative_url | jsonify }},
11
+ "categories": {{ post.categories | join: ', ' | jsonify }},
12
+ "tags": {{ post.tags | join: ', ' | jsonify }},
13
+ "date": "{{ post.date }}",
14
+ {% include no-linenos.html content=post.content %}
15
+ {% assign _content = content | strip_html | strip_newlines %}
16
+ "snippet": {{ _content | truncate: 200 | jsonify }},
17
+ "content": {{ _content | jsonify }}
18
+ }{% unless forloop.last %},{% endunless %}
19
+ {% endfor %}
20
+ ]
@@ -0,0 +1,49 @@
1
+ ---
2
+ layout: compress
3
+ # The list to be cached by PWA
4
+ ---
5
+
6
+ const resource = [
7
+ /* --- CSS --- */
8
+ '{{ "/assets/css/:THEME.css" | replace: ':THEME', site.theme | relative_url }}',
9
+
10
+ /* --- PWA --- */
11
+ '{{ "/app.js" | relative_url }}',
12
+ '{{ "/sw.js" | relative_url }}',
13
+
14
+ /* --- HTML --- */
15
+ '{{ "/index.html" | relative_url }}',
16
+ '{{ "/404.html" | relative_url }}',
17
+
18
+ {% for tab in site.tabs %}
19
+ '{{ tab.url | relative_url }}',
20
+ {% endfor %}
21
+
22
+ /* --- Favicons & compressed JS --- */
23
+ {% assign cache_list = site.static_files | where: 'swcache', true %}
24
+ {% for file in cache_list %}
25
+ '{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
26
+ {% endfor %}
27
+ ];
28
+
29
+ /* The request url with below domain will be cached */
30
+ const allowedDomains = [
31
+ {% if site.google_analytics.id != empty and site.google_analytics.id %}
32
+ 'www.googletagmanager.com',
33
+ 'www.google-analytics.com',
34
+ {% endif %}
35
+
36
+ '{{ site.url | split: "//" | last }}',
37
+
38
+ {% if site.img_cdn contains '//' and site.img_cdn %}
39
+ '{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
40
+ {% endif %}
41
+
42
+ 'fonts.gstatic.com',
43
+ 'fonts.googleapis.com',
44
+ 'cdn.jsdelivr.net',
45
+ 'polyfill.io'
46
+ ];
47
+
48
+ /* Requests that include the following path will be banned */
49
+ const denyUrls = [];
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Chirpy v6.3.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
3
+ */
4
+ !function(){"use strict";const o=$(".mode-toggle");function t(o,t,s){return(t=function(o){var t=function(o,t){if("object"!=typeof o||null===o)return o;var s=o[Symbol.toPrimitive];if(void 0!==s){var e=s.call(o,t||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(o)}(o,"string");return"symbol"==typeof t?t:String(t)}(t))in o?Object.defineProperty(o,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[t]=s,o}const s=$("body"),e="sidebar-display";class a{static toggle(){!1===a.isExpanded?s.attr(e,""):s.removeAttr(e),a.isExpanded=!a.isExpanded}}t(a,"isExpanded",!1);const r=$("#sidebar-trigger"),l=$("#search-trigger"),n=$("#search-cancel"),i=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),f=$("search"),d=$("#search-result-wrapper"),u=$("#search-results"),p=$("#search-input"),b=$("#search-hints"),g=$("html,body"),m="loaded",C="unloaded",v="input-focus",h="d-flex";class w{static on(){w.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(w.offset)}}t(w,"offset",0),t(w,"resultVisible",!1);class y{static on(){r.addClass(C),c.addClass(C),l.addClass(C),f.addClass(h),n.addClass(m)}static off(){n.removeClass(m),f.removeClass(h),r.removeClass(C),c.removeClass(C),l.removeClass(C)}}class k{static on(){w.resultVisible||(w.on(),d.removeClass(C),i.addClass(C),w.resultVisible=!0)}static off(){w.resultVisible&&(u.empty(),b.hasClass(C)&&b.removeClass(C),d.addClass(C),i.removeClass(C),w.off(),p.val(""),w.resultVisible=!1)}}function T(){return n.hasClass(m)}const x=$(".collapse");$(".code-header>button").children().attr("class"),function(){const o=$(window),t=$("#back-to-top");o.on("scroll",(()=>{o.scrollTop()>50?t.fadeIn():t.fadeOut()})),t.on("click",(()=>{o.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((o=>new bootstrap.Tooltip(o))),0!==o.length&&o.off().on("click",(o=>{const t=$(o.target);let s=t.prop("tagName")==="button".toUpperCase()?t:t.parent();modeToggle.flipMode(),s.trigger("blur")})),$("#sidebar-trigger").on("click",a.toggle),$("#mask").on("click",a.toggle),l.on("click",(function(){y.on(),k.on(),p.trigger("focus")})),n.on("click",(function(){y.off(),k.off()})),p.on("focus",(function(){f.addClass(v)})),p.on("focusout",(function(){f.removeClass(v)})),p.on("input",(()=>{""===p.val()?T()?b.removeClass(C):k.off():(k.on(),T()&&b.addClass(C))})),x.on("hide.bs.collapse",(function(){const o="h_"+$(this).attr("id").substring(2);o&&($("#".concat(o," .far.fa-folder-open")).attr("class","far fa-folder fa-fw"),$("#".concat(o," i.fas")).addClass("rotate"),$("#".concat(o)).removeClass("hide-border-bottom"))})),x.on("show.bs.collapse",(function(){const o="h_"+$(this).attr("id").substring(2);o&&($("#".concat(o," .far.fa-folder")).attr("class","far fa-folder-open fa-fw"),$("#".concat(o," i.fas")).removeClass("rotate"),$("#".concat(o)).addClass("hide-border-bottom"))}))}();
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Chirpy v6.3.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
3
+ */
4
+ !function(){"use strict";const e=$(".mode-toggle");function s(e,s,o){return(s=function(e){var s=function(e,s){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var t=o.call(e,s||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:String(s)}(s))in e?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o,e}const o=$("body"),t="sidebar-display";class r{static toggle(){!1===r.isExpanded?o.attr(t,""):o.removeAttr(t),r.isExpanded=!r.isExpanded}}s(r,"isExpanded",!1);const a=$("#sidebar-trigger"),l=$("#search-trigger"),i=$("#search-cancel"),n=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),d=$("search"),f=$("#search-result-wrapper"),u=$("#search-results"),p=$("#search-input"),g=$("#search-hints"),m=$("html,body"),b="loaded",v="unloaded",C="input-focus",h="d-flex";class y{static on(){y.offset=window.scrollY,m.scrollTop(0)}static off(){m.scrollTop(y.offset)}}s(y,"offset",0),s(y,"resultVisible",!1);class w{static on(){a.addClass(v),c.addClass(v),l.addClass(v),d.addClass(h),i.addClass(b)}static off(){i.removeClass(b),d.removeClass(h),a.removeClass(v),c.removeClass(v),l.removeClass(v)}}class k{static on(){y.resultVisible||(y.on(),f.removeClass(v),n.addClass(v),y.resultVisible=!0)}static off(){y.resultVisible&&(u.empty(),g.hasClass(v)&&g.removeClass(v),f.addClass(v),n.removeClass(v),y.off(),p.val(""),y.resultVisible=!1)}}function T(){return i.hasClass(b)}!function(){const e=$(window),s=$("#back-to-top");e.on("scroll",(()=>{e.scrollTop()>50?s.fadeIn():s.fadeOut()})),s.on("click",(()=>{e.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((e=>new bootstrap.Tooltip(e))),0!==e.length&&e.off().on("click",(e=>{const s=$(e.target);let o=s.prop("tagName")==="button".toUpperCase()?s:s.parent();modeToggle.flipMode(),o.trigger("blur")})),$("#sidebar-trigger").on("click",r.toggle),$("#mask").on("click",r.toggle),l.on("click",(function(){w.on(),k.on(),p.trigger("focus")})),i.on("click",(function(){w.off(),k.off()})),p.on("focus",(function(){d.addClass(C)})),p.on("focusout",(function(){d.removeClass(C)})),p.on("input",(()=>{""===p.val()?T()?g.removeClass(v):k.off():(k.on(),T()&&g.addClass(v))}))}();
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Chirpy v6.3.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
3
+ */
4
+ !function(){"use strict";const t=$(".mode-toggle");function e(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var s=a.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const a=$("body"),s="sidebar-display";class o{static toggle(){!1===o.isExpanded?a.attr(s,""):a.removeAttr(s),o.isExpanded=!o.isExpanded}}e(o,"isExpanded",!1);const r=$("#sidebar-trigger"),i=$("#search-trigger"),l=$("#search-cancel"),n=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),d=$("search"),u=$("#search-result-wrapper"),m=$("#search-results"),f=$("#search-input"),p=$("#search-hints"),g=$("html,body"),h="loaded",b="unloaded",v="input-focus",C="d-flex";class y{static on(){y.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(y.offset)}}e(y,"offset",0),e(y,"resultVisible",!1);class w{static on(){r.addClass(b),c.addClass(b),i.addClass(b),d.addClass(C),l.addClass(h)}static off(){l.removeClass(h),d.removeClass(C),r.removeClass(b),c.removeClass(b),i.removeClass(b)}}class T{static on(){y.resultVisible||(y.on(),u.removeClass(b),n.addClass(b),y.resultVisible=!0)}static off(){y.resultVisible&&(m.empty(),p.hasClass(b)&&p.removeClass(b),u.addClass(b),n.removeClass(b),y.off(),f.val(""),y.resultVisible=!1)}}function k(){return l.hasClass(h)}$(".collapse");$(".code-header>button").children().attr("class");const x="data-src",E="data-lqip",j={SHIMMER:"shimmer",BLUR:"blur"};function M(t){$(this).parent().removeClass(t)}function S(){this.complete&&(this.hasAttribute(E)?M.call(this,j.BLUR):M.call(this,j.SHIMMER))}function A(){const t=$(this),e=t.attr(x);t.attr("src",encodeURI(e)),t.removeAttr(x)}class F{static get attrTimestamp(){return"data-ts"}static get attrDateFormat(){return"data-df"}static get locale(){return $("html").attr("lang").substring(0,2)}static getTimestamp(t){return Number(t.attr(F.attrTimestamp))}static getDateFormat(t){return t.attr(F.attrDateFormat)}}!function(){const t=$(window),e=$("#back-to-top");t.on("scroll",(()=>{t.scrollTop()>50?e.fadeIn():e.fadeOut()})),e.on("click",(()=>{t.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((t=>new bootstrap.Tooltip(t))),0!==t.length&&t.off().on("click",(t=>{const e=$(t.target);let a=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),a.trigger("blur")})),$("#sidebar-trigger").on("click",o.toggle),$("#mask").on("click",o.toggle),i.on("click",(function(){w.on(),T.on(),f.trigger("focus")})),l.on("click",(function(){w.off(),T.off()})),f.on("focus",(function(){d.addClass(v)})),f.on("focusout",(function(){d.removeClass(v)})),f.on("input",(()=>{""===f.val()?k()?p.removeClass(b):T.off():(T.on(),k()&&p.addClass(b))})),dayjs.locale(F.locale),dayjs.extend(window.dayjs_plugin_localizedFormat),$("[".concat(F.attrTimestamp,"]")).each((function(){const t=dayjs.unix(F.getTimestamp($(this))),e=t.format(F.getDateFormat($(this)));$(this).text(e),$(this).removeAttr(F.attrTimestamp),$(this).removeAttr(F.attrDateFormat);const a=$(this).attr("data-bs-toggle");if(void 0===a||"tooltip"!==a)return;const s=t.format("llll");$(this).attr("data-bs-title",s),new bootstrap.Tooltip($(this))})),function(){const t=$("article img");t.length&&t.on("load",S),$('article img[loading="lazy"]').each((function(){this.complete&&M.call(this,j.SHIMMER)}));const e=$("article img[".concat(E,'="true"]'));e.length&&e.each(A)}()}();
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Chirpy v6.3.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
3
+ */
4
+ !function(){"use strict";const t=$(".mode-toggle");function e(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var s=a.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const a=$("body"),s="sidebar-display";class o{static toggle(){!1===o.isExpanded?a.attr(s,""):a.removeAttr(s),o.isExpanded=!o.isExpanded}}e(o,"isExpanded",!1);const r=$("#sidebar-trigger"),l=$("#search-trigger"),i=$("#search-cancel"),n=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),d=$("search"),u=$("#search-result-wrapper"),f=$("#search-results"),m=$("#search-input"),p=$("#search-hints"),g=$("html,body"),b="loaded",h="unloaded",v="input-focus",C="d-flex";class y{static on(){y.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(y.offset)}}e(y,"offset",0),e(y,"resultVisible",!1);class w{static on(){r.addClass(h),c.addClass(h),l.addClass(h),d.addClass(C),i.addClass(b)}static off(){i.removeClass(b),d.removeClass(C),r.removeClass(h),c.removeClass(h),l.removeClass(h)}}class T{static on(){y.resultVisible||(y.on(),u.removeClass(h),n.addClass(h),y.resultVisible=!0)}static off(){y.resultVisible&&(f.empty(),p.hasClass(h)&&p.removeClass(h),u.addClass(h),n.removeClass(h),y.off(),m.val(""),y.resultVisible=!1)}}function k(){return i.hasClass(b)}$(".collapse");$(".code-header>button").children().attr("class");class x{static get attrTimestamp(){return"data-ts"}static get attrDateFormat(){return"data-df"}static get locale(){return $("html").attr("lang").substring(0,2)}static getTimestamp(t){return Number(t.attr(x.attrTimestamp))}static getDateFormat(t){return t.attr(x.attrDateFormat)}}!function(){const t=$(window),e=$("#back-to-top");t.on("scroll",(()=>{t.scrollTop()>50?e.fadeIn():e.fadeOut()})),e.on("click",(()=>{t.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((t=>new bootstrap.Tooltip(t))),0!==t.length&&t.off().on("click",(t=>{const e=$(t.target);let a=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),a.trigger("blur")})),$("#sidebar-trigger").on("click",o.toggle),$("#mask").on("click",o.toggle),l.on("click",(function(){w.on(),T.on(),m.trigger("focus")})),i.on("click",(function(){w.off(),T.off()})),m.on("focus",(function(){d.addClass(v)})),m.on("focusout",(function(){d.removeClass(v)})),m.on("input",(()=>{""===m.val()?k()?p.removeClass(h):T.off():(T.on(),k()&&p.addClass(h))})),dayjs.locale(x.locale),dayjs.extend(window.dayjs_plugin_localizedFormat),$("[".concat(x.attrTimestamp,"]")).each((function(){const t=dayjs.unix(x.getTimestamp($(this))),e=t.format(x.getDateFormat($(this)));$(this).text(e),$(this).removeAttr(x.attrTimestamp),$(this).removeAttr(x.attrDateFormat);const a=$(this).attr("data-bs-toggle");if(void 0===a||"tooltip"!==a)return;const s=t.format("llll");$(this).attr("data-bs-title",s),new bootstrap.Tooltip($(this))}))}();
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Chirpy v6.3.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
3
+ */
4
+ !function(){"use strict";const t=$(".mode-toggle");function e(t,e,o){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var s=o.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const o=$("body"),s="sidebar-display";class n{static toggle(){!1===n.isExpanded?o.attr(s,""):o.removeAttr(s),n.isExpanded=!n.isExpanded}}e(n,"isExpanded",!1);const a=$("#sidebar-trigger"),r=$("#search-trigger"),i=$("#search-cancel"),l=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),u=$("search"),d=$("#search-result-wrapper"),f=$("#search-results"),p=$("#search-input"),m=$("#search-hints"),g=$("html,body"),h="loaded",b="unloaded",v="input-focus",C="d-flex";class w{static on(){w.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(w.offset)}}e(w,"offset",0),e(w,"resultVisible",!1);class y{static on(){a.addClass(b),c.addClass(b),r.addClass(b),u.addClass(C),i.addClass(h)}static off(){i.removeClass(h),u.removeClass(C),a.removeClass(b),c.removeClass(b),r.removeClass(b)}}class k{static on(){w.resultVisible||(w.on(),d.removeClass(b),l.addClass(b),w.resultVisible=!0)}static off(){w.resultVisible&&(f.empty(),m.hasClass(b)&&m.removeClass(b),d.addClass(b),l.removeClass(b),w.off(),p.val(""),w.resultVisible=!1)}}function S(){return i.hasClass(h)}$(".collapse");const T=".code-header>button",E="fas fa-check",A="timeout",x="data-title-succeed",M="data-bs-original-title",R=2e3;function I(t){if($(t)[0].hasAttribute(A)){let e=$(t).attr(A);if(Number(e)>Date.now())return!0}return!1}function V(t){$(t).attr(A,Date.now()+R)}function q(t){$(t).removeAttr(A)}const N=$(T).children().attr("class");const P="data-src",U="data-lqip",j={SHIMMER:"shimmer",BLUR:"blur"};function B(t){$(this).parent().removeClass(t)}function H(){this.complete&&(this.hasAttribute(U)?B.call(this,j.BLUR):B.call(this,j.SHIMMER))}function O(){const t=$(this),e=t.attr(P);t.attr("src",encodeURI(e)),t.removeAttr(P)}!function(){const t=$(window),e=$("#back-to-top");t.on("scroll",(()=>{t.scrollTop()>50?e.fadeIn():e.fadeOut()})),e.on("click",(()=>{t.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((t=>new bootstrap.Tooltip(t))),0!==t.length&&t.off().on("click",(t=>{const e=$(t.target);let o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),o.trigger("blur")})),$("#sidebar-trigger").on("click",n.toggle),$("#mask").on("click",n.toggle),r.on("click",(function(){y.on(),k.on(),p.trigger("focus")})),i.on("click",(function(){y.off(),k.off()})),p.on("focus",(function(){u.addClass(v)})),p.on("focusout",(function(){u.removeClass(v)})),p.on("input",(()=>{""===p.val()?S()?m.removeClass(b):k.off():(k.on(),S()&&m.addClass(b))})),function(){const t=$("article img");t.length&&t.on("load",H),$('article img[loading="lazy"]').each((function(){this.complete&&B.call(this,j.SHIMMER)}));const e=$("article img[".concat(U,'="true"]'));e.length&&e.each(O)}(),$(".popup")<=0||$(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),function(){if($(T).length){const t=new ClipboardJS(T,{target:t=>t.parentNode.nextElementSibling.querySelector("code .rouge-code")});[...document.querySelectorAll(T)].map((t=>new bootstrap.Tooltip(t,{placement:"left"}))),t.on("success",(t=>{t.clearSelection();const e=t.trigger;I(e)||(!function(t){$(t).children().attr("class",E)}(e),function(t){const e=$(t).attr(x);$(t).attr(M,e).tooltip("show")}(e),V(e),setTimeout((()=>{!function(t){$(t).tooltip("hide").removeAttr(M)}(e),function(t){$(t).children().attr("class",N)}(e),q(e)}),R))}))}const t=$("#copy-link");t.on("click",(t=>{let e=$(t.target);I(e)||navigator.clipboard.writeText(window.location.href).then((()=>{const t=e.attr(M),o=e.attr(x);e.attr(M,o).tooltip("show"),V(e),setTimeout((()=>{e.attr(M,t),q(e)}),R)}))})),t.on("mouseleave",(function(t){$(t.target).tooltip("hide")}))}()}();
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Chirpy v6.3.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
3
+ */
4
+ !function(){"use strict";const t=$(".mode-toggle");function e(t,e,o){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var a=o.call(t,e||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const o=$("body"),a="sidebar-display";class r{static toggle(){!1===r.isExpanded?o.attr(a,""):o.removeAttr(a),r.isExpanded=!r.isExpanded}}e(r,"isExpanded",!1);const s=$("#sidebar-trigger"),n=$("#search-trigger"),i=$("#search-cancel"),l=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),u=$("search"),d=$("#search-result-wrapper"),m=$("#search-results"),f=$("#search-input"),p=$("#search-hints"),g=$("html,body"),h="loaded",b="unloaded",v="input-focus",C="d-flex";class w{static on(){w.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(w.offset)}}e(w,"offset",0),e(w,"resultVisible",!1);class y{static on(){s.addClass(b),c.addClass(b),n.addClass(b),u.addClass(C),i.addClass(h)}static off(){i.removeClass(h),u.removeClass(C),s.removeClass(b),c.removeClass(b),n.removeClass(b)}}class S{static on(){w.resultVisible||(w.on(),d.removeClass(b),l.addClass(b),w.resultVisible=!0)}static off(){w.resultVisible&&(m.empty(),p.hasClass(b)&&p.removeClass(b),d.addClass(b),l.removeClass(b),w.off(),f.val(""),w.resultVisible=!1)}}function T(){return i.hasClass(h)}$(".collapse");const k=".code-header>button",x="fas fa-check",A="timeout",E="data-title-succeed",j="data-bs-original-title",D=2e3;function M(t){if($(t)[0].hasAttribute(A)){let e=$(t).attr(A);if(Number(e)>Date.now())return!0}return!1}function F(t){$(t).attr(A,Date.now()+D)}function R(t){$(t).removeAttr(A)}const q=$(k).children().attr("class");const I="data-src",N="data-lqip",V={SHIMMER:"shimmer",BLUR:"blur"};function P(t){$(this).parent().removeClass(t)}function U(){this.complete&&(this.hasAttribute(N)?P.call(this,V.BLUR):P.call(this,V.SHIMMER))}function z(){const t=$(this),e=t.attr(I);t.attr("src",encodeURI(e)),t.removeAttr(I)}class B{static get attrTimestamp(){return"data-ts"}static get attrDateFormat(){return"data-df"}static get locale(){return $("html").attr("lang").substring(0,2)}static getTimestamp(t){return Number(t.attr(B.attrTimestamp))}static getDateFormat(t){return t.attr(B.attrDateFormat)}}0!==t.length&&t.off().on("click",(t=>{const e=$(t.target);let o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),o.trigger("blur")})),$("#sidebar-trigger").on("click",r.toggle),$("#mask").on("click",r.toggle),n.on("click",(function(){y.on(),S.on(),f.trigger("focus")})),i.on("click",(function(){y.off(),S.off()})),f.on("focus",(function(){u.addClass(v)})),f.on("focusout",(function(){u.removeClass(v)})),f.on("input",(()=>{""===f.val()?T()?p.removeClass(b):S.off():(S.on(),T()&&p.addClass(b))})),function(){const t=$("article img");t.length&&t.on("load",U),$('article img[loading="lazy"]').each((function(){this.complete&&P.call(this,V.SHIMMER)}));const e=$("article img[".concat(N,'="true"]'));e.length&&e.each(z)}(),$(".popup")<=0||$(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),dayjs.locale(B.locale),dayjs.extend(window.dayjs_plugin_localizedFormat),$("[".concat(B.attrTimestamp,"]")).each((function(){const t=dayjs.unix(B.getTimestamp($(this))),e=t.format(B.getDateFormat($(this)));$(this).text(e),$(this).removeAttr(B.attrTimestamp),$(this).removeAttr(B.attrDateFormat);const o=$(this).attr("data-bs-toggle");if(void 0===o||"tooltip"!==o)return;const a=t.format("llll");$(this).attr("data-bs-title",a),new bootstrap.Tooltip($(this))})),function(){if($(k).length){const t=new ClipboardJS(k,{target:t=>t.parentNode.nextElementSibling.querySelector("code .rouge-code")});[...document.querySelectorAll(k)].map((t=>new bootstrap.Tooltip(t,{placement:"left"}))),t.on("success",(t=>{t.clearSelection();const e=t.trigger;M(e)||(!function(t){$(t).children().attr("class",x)}(e),function(t){const e=$(t).attr(E);$(t).attr(j,e).tooltip("show")}(e),F(e),setTimeout((()=>{!function(t){$(t).tooltip("hide").removeAttr(j)}(e),function(t){$(t).children().attr("class",q)}(e),R(e)}),D))}))}const t=$("#copy-link");t.on("click",(t=>{let e=$(t.target);M(e)||navigator.clipboard.writeText(window.location.href).then((()=>{const t=e.attr(j),o=e.attr(E);e.attr(j,o).tooltip("show"),F(e),setTimeout((()=>{e.attr(j,t),R(e)}),D)}))})),t.on("mouseleave",(function(t){$(t.target).tooltip("hide")}))}(),document.querySelector("main h2")&&tocbot.init({tocSelector:"#toc",contentSelector:".content",ignoreSelector:"[data-toc-skip]",headingSelector:"h2, h3, h4",orderedList:!1,scrollSmooth:!1}),function(){const t=$(window),e=$("#back-to-top");t.on("scroll",(()=>{t.scrollTop()>50?e.fadeIn():e.fadeOut()})),e.on("click",(()=>{t.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((t=>new bootstrap.Tooltip(t)))}();
@@ -0,0 +1,47 @@
1
+ ---
2
+ layout: compress
3
+ permalink: '/app.js'
4
+ ---
5
+
6
+ const $notification = $('#notification');
7
+ const $btnRefresh = $('#notification .toast-body>button');
8
+
9
+ if ('serviceWorker' in navigator) {
10
+ /* Registering Service Worker */
11
+ navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}')
12
+ .then(registration => {
13
+
14
+ /* in case the user ignores the notification */
15
+ if (registration.waiting) {
16
+ $notification.toast('show');
17
+ }
18
+
19
+ registration.addEventListener('updatefound', () => {
20
+ registration.installing.addEventListener('statechange', () => {
21
+ if (registration.waiting) {
22
+ if (navigator.serviceWorker.controller) {
23
+ $notification.toast('show');
24
+ }
25
+ }
26
+ });
27
+ });
28
+
29
+ $btnRefresh.click(() => {
30
+ if (registration.waiting) {
31
+ registration.waiting.postMessage('SKIP_WAITING');
32
+ }
33
+ $notification.toast('hide');
34
+ });
35
+ });
36
+
37
+ let refreshing = false;
38
+
39
+ /* Detect controller change and refresh all the opened tabs */
40
+ navigator.serviceWorker.addEventListener('controllerchange', () => {
41
+ if (!refreshing) {
42
+ window.location.reload();
43
+ refreshing = true;
44
+ }
45
+ });
46
+ }
47
+
@@ -0,0 +1,89 @@
1
+ ---
2
+ layout: compress
3
+ permalink: '/sw.js'
4
+ # PWA service worker
5
+ ---
6
+
7
+ self.importScripts('{{ "/assets/js/data/swcache.js" | relative_url }}');
8
+
9
+ const cacheName = 'chirpy-{{ "now" | date: "%s" }}';
10
+
11
+ function verifyDomain(url) {
12
+ for (const domain of allowedDomains) {
13
+ const regex = RegExp(`^http(s)?:\/\/${domain}\/`);
14
+ if (regex.test(url)) {
15
+ return true;
16
+ }
17
+ }
18
+
19
+ return false;
20
+ }
21
+
22
+ function isExcluded(url) {
23
+ for (const item of denyUrls) {
24
+ if (url === item) {
25
+ return true;
26
+ }
27
+ }
28
+ return false;
29
+ }
30
+
31
+ self.addEventListener('install', (event) => {
32
+ event.waitUntil(
33
+ caches.open(cacheName).then((cache) => {
34
+ return cache.addAll(resource);
35
+ })
36
+ );
37
+ });
38
+
39
+ self.addEventListener('activate', (event) => {
40
+ event.waitUntil(
41
+ caches.keys().then((keyList) => {
42
+ return Promise.all(
43
+ keyList.map((key) => {
44
+ if (key !== cacheName) {
45
+ return caches.delete(key);
46
+ }
47
+ })
48
+ );
49
+ })
50
+ );
51
+ });
52
+
53
+ self.addEventListener('message', (event) => {
54
+ if (event.data === 'SKIP_WAITING') {
55
+ self.skipWaiting();
56
+ }
57
+ });
58
+
59
+ self.addEventListener('fetch', (event) => {
60
+ event.respondWith(
61
+ caches.match(event.request).then((response) => {
62
+ if (response) {
63
+ return response;
64
+ }
65
+
66
+ return fetch(event.request).then((response) => {
67
+ const url = event.request.url;
68
+
69
+ if (
70
+ event.request.method !== 'GET' ||
71
+ !verifyDomain(url) ||
72
+ isExcluded(url)
73
+ ) {
74
+ return response;
75
+ }
76
+
77
+ /* see: <https://developers.google.com/web/fundamentals/primers/service-workers#cache_and_return_requests> */
78
+ let responseToCache = response.clone();
79
+
80
+ caches.open(cacheName).then((cache) => {
81
+ /* console.log('[sw] Caching new resource: ' + event.request.url); */
82
+ cache.put(event.request, responseToCache);
83
+ });
84
+
85
+ return response;
86
+ });
87
+ })
88
+ );
89
+ });
@@ -0,0 +1,12 @@
1
+ ---
2
+ layout: compress
3
+ permalink: '/unregister.js'
4
+ ---
5
+
6
+ if ('serviceWorker' in navigator) {
7
+ navigator.serviceWorker.getRegistrations().then((registrations) => {
8
+ for (let reg of registrations) {
9
+ reg.unregister();
10
+ }
11
+ });
12
+ }
data/assets/robots.txt ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ permalink: /robots.txt
3
+ # The robots rules
4
+ ---
5
+
6
+ User-agent: *
7
+
8
+ Disallow: /norobots/
9
+
10
+ Sitemap: {{ '/sitemap.xml' | absolute_url }}