custom-chirpy 5.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +97 -0
- data/_data/assets/cross_origin.yml +62 -0
- data/_data/assets/self_host.yml +51 -0
- data/_data/authors.yml +17 -0
- data/_data/contact.yml +29 -0
- data/_data/locales/ar.yml +93 -0
- data/_data/locales/bg-BG.yml +83 -0
- data/_data/locales/cs-CZ.yml +91 -0
- data/_data/locales/de-DE.yml +82 -0
- data/_data/locales/el-GR.yml +93 -0
- data/_data/locales/en.yml +93 -0
- data/_data/locales/es-ES.yml +79 -0
- data/_data/locales/fi-FI.yml +92 -0
- data/_data/locales/fr-FR.yml +79 -0
- data/_data/locales/hu-HU.yml +81 -0
- data/_data/locales/id-ID.yml +79 -0
- data/_data/locales/it-IT.yml +93 -0
- data/_data/locales/ko-KR.yml +86 -0
- data/_data/locales/my-MM.yml +79 -0
- data/_data/locales/pt-BR.yml +79 -0
- data/_data/locales/ru-RU.yml +79 -0
- data/_data/locales/tr-TR.yml +79 -0
- data/_data/locales/uk-UA.yml +79 -0
- data/_data/locales/vi-VN.yml +77 -0
- data/_data/locales/zh-CN.yml +85 -0
- data/_data/share.yml +25 -0
- data/_includes/assets-origin.html +12 -0
- data/_includes/comments/disqus.html +54 -0
- data/_includes/comments/giscus.html +56 -0
- data/_includes/comments/utterances.html +51 -0
- data/_includes/comments.html +5 -0
- data/_includes/datetime.html +15 -0
- data/_includes/embed/twitch.html +4 -0
- data/_includes/embed/youtube.html +6 -0
- data/_includes/favicons.html +17 -0
- data/_includes/footer.html +36 -0
- data/_includes/google-analytics.html +14 -0
- data/_includes/head.html +115 -0
- data/_includes/js-selector.html +99 -0
- data/_includes/jsdelivr-combine.html +32 -0
- data/_includes/language-alias.html +70 -0
- data/_includes/mermaid.html +59 -0
- data/_includes/mode-toggle.html +129 -0
- data/_includes/no-linenos.html +10 -0
- data/_includes/post-nav.html +30 -0
- data/_includes/post-paginator.html +88 -0
- data/_includes/post-sharing.html +27 -0
- data/_includes/read-time.html +30 -0
- data/_includes/refactor-content.html +282 -0
- data/_includes/related-posts.html +103 -0
- data/_includes/search-loader.html +46 -0
- data/_includes/search-results.html +11 -0
- data/_includes/sidebar.html +106 -0
- data/_includes/toc.html +16 -0
- data/_includes/topbar.html +70 -0
- data/_includes/trending-tags.html +50 -0
- data/_includes/update-list.html +40 -0
- data/_layouts/archives.html +34 -0
- data/_layouts/categories.html +118 -0
- data/_layouts/category.html +22 -0
- data/_layouts/compress.html +10 -0
- data/_layouts/default.html +71 -0
- data/_layouts/home.html +94 -0
- data/_layouts/page.html +63 -0
- data/_layouts/post.html +141 -0
- data/_layouts/tag.html +21 -0
- data/_layouts/tags.html +23 -0
- data/_sass/addon/commons.scss +1731 -0
- data/_sass/addon/module.scss +163 -0
- data/_sass/addon/syntax.scss +275 -0
- data/_sass/addon/variables.scss +30 -0
- data/_sass/colors/dark-syntax.scss +87 -0
- data/_sass/colors/dark-typography.scss +170 -0
- data/_sass/colors/light-syntax.scss +83 -0
- data/_sass/colors/light-typography.scss +104 -0
- data/_sass/jekyll-theme-chirpy.scss +24 -0
- data/_sass/layout/archives.scss +136 -0
- data/_sass/layout/categories.scss +66 -0
- data/_sass/layout/category-tag.scss +73 -0
- data/_sass/layout/home.scss +178 -0
- data/_sass/layout/post.scss +378 -0
- data/_sass/layout/tags.scss +19 -0
- data/_sass/variables-hook.scss +3 -0
- data/assets/404.html +14 -0
- data/assets/css/style.scss +12 -0
- data/assets/feed.xml +61 -0
- data/assets/img/favicons/android-chrome-192x192.png +0 -0
- data/assets/img/favicons/android-chrome-512x512.png +0 -0
- data/assets/img/favicons/apple-touch-icon.png +0 -0
- data/assets/img/favicons/browserconfig.xml +13 -0
- data/assets/img/favicons/favicon-16x16.png +0 -0
- data/assets/img/favicons/favicon-32x32.png +0 -0
- data/assets/img/favicons/favicon.ico +0 -0
- data/assets/img/favicons/mstile-150x150.png +0 -0
- data/assets/img/favicons/site.webmanifest +26 -0
- data/assets/js/data/search.json +20 -0
- data/assets/js/data/swcache.js +54 -0
- data/assets/js/dist/categories.min.js +6 -0
- data/assets/js/dist/commons.min.js +6 -0
- data/assets/js/dist/home.min.js +6 -0
- data/assets/js/dist/misc.min.js +6 -0
- data/assets/js/dist/page.min.js +6 -0
- data/assets/js/dist/post.min.js +6 -0
- data/assets/js/dist/pvreport.min.js +6 -0
- data/assets/js/pwa/app.js +47 -0
- data/assets/js/pwa/sw.js +90 -0
- data/assets/js/pwa/unregister.js +12 -0
- data/assets/robots.txt +10 -0
- metadata +236 -0
@@ -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,54 @@
|
|
1
|
+
---
|
2
|
+
layout: compress
|
3
|
+
|
4
|
+
# The list to be cached by PWA
|
5
|
+
---
|
6
|
+
|
7
|
+
const resource = [
|
8
|
+
/* --- CSS --- */
|
9
|
+
'{{ "/assets/css/style.css" | relative_url }}',
|
10
|
+
|
11
|
+
/* --- PWA --- */
|
12
|
+
'{{ "/app.js" | relative_url }}',
|
13
|
+
'{{ "/sw.js" | relative_url }}',
|
14
|
+
|
15
|
+
/* --- HTML --- */
|
16
|
+
'{{ "/index.html" | relative_url }}',
|
17
|
+
'{{ "/404.html" | relative_url }}',
|
18
|
+
|
19
|
+
{% for tab in site.tabs %}
|
20
|
+
'{{ tab.url | relative_url }}',
|
21
|
+
{% endfor %}
|
22
|
+
|
23
|
+
/* --- Favicons & compressed JS --- */
|
24
|
+
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
25
|
+
{% for file in cache_list %}
|
26
|
+
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
27
|
+
{% endfor %}
|
28
|
+
];
|
29
|
+
|
30
|
+
/* The request url with below domain will be cached */
|
31
|
+
const allowedDomains = [
|
32
|
+
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
33
|
+
'www.googletagmanager.com',
|
34
|
+
'www.google-analytics.com',
|
35
|
+
{% endif %}
|
36
|
+
|
37
|
+
'{{ site.url | split: "//" | last }}',
|
38
|
+
|
39
|
+
{% if site.img_cdn contains '//' and site.img_cdn %}
|
40
|
+
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
41
|
+
{% endif %}
|
42
|
+
|
43
|
+
'fonts.gstatic.com',
|
44
|
+
'fonts.googleapis.com',
|
45
|
+
'cdn.jsdelivr.net',
|
46
|
+
'polyfill.io'
|
47
|
+
];
|
48
|
+
|
49
|
+
/* Requests that include the following path will be banned */
|
50
|
+
const denyUrls = [
|
51
|
+
{% if site.google_analytics.pv.cache_path %}
|
52
|
+
'{{ site.google_analytics.pv.cache_path | absolute_url }}'
|
53
|
+
{% endif %}
|
54
|
+
];
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).on("scroll",()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").on("click",()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").on("click",o=>{o=$(o.target);(o.prop("tagName")==="button".toUpperCase()?o:o.parent()).trigger("blur"),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let r=0,a=!1,l=!1;return{hideTopbar:()=>o.attr(e,"false"),showTopbar:()=>o.attr(e,"true"),addScrollUpTask:()=>{r+=1,a=a||!0},popScrollUpTask:()=>--r,hasScrollUpTask:()=>0<r,topbarLocked:()=>!0===a,unlockTopbar:()=>a=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===l,lockOrientation:()=>l=!0,unLockOrientation:()=>l=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),r=$("#main"),a=$("#topbar-title"),l=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),a.addClass("unloaded"),e.addClass("unloaded"),l.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),l.removeClass("d-flex"),o.removeClass("unloaded"),a.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),r.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),r.removeClass("unloaded"),d.release(),i.val(""),o=!1)}}}();function u(){return t.hasClass("loaded")}e.on("click",function(){p.on(),f.on(),i.trigger("focus")}),t.on("click",function(){p.off(),f.off()}),i.on("focus",function(){l.addClass("input-focus")}),i.on("focusout",function(){l.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?u()?c.removeClass("unloaded"):f.off():(f.on(),u()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").on("click",o.toggle),$("#mask").on("click",o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,r=0;function a(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||a()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&a()}),$(window).on("scroll",()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(r-o)<=t)){if(o>r)ScrollHelper.hideTopbar(),e.is(":focus")&&e.trigger("blur");else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}r=o}}(),o=!1)},250)}),$(function(){var o="div.post>h1:first-of-type",e=$(o);const n=$("#topbar-title");if(0!==e.length&&!e.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let r=e.text().trim(),a=!1,l=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(r)&&(r=r.replace(/[0-9]/g,"").trim()),e.offset().top<$(window).scrollTop()&&n.text(r);new IntersectionObserver(o=>{var e,t;a?(t=$(window).scrollTop(),e=l<t,l=t,t=o[0],e?0===t.intersectionRatio&&n.text(r):1===t.intersectionRatio&&n.text(s)):a=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(o)),n.on("click",function(){$("body,html").animate({scrollTop:0},800)})}}),$(function(){var o=$(".collapse");o.on("hide.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$("#"+o).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$("#"+o).addClass("hide-border-bottom"))})});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).on("scroll",()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").on("click",()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").on("click",o=>{o=$(o.target);(o.prop("tagName")==="button".toUpperCase()?o:o.parent()).trigger("blur"),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let r=0,l=!1,n=!1;return{hideTopbar:()=>o.attr(e,"false"),showTopbar:()=>o.attr(e,"true"),addScrollUpTask:()=>{r+=1,l=l||!0},popScrollUpTask:()=>--r,hasScrollUpTask:()=>0<r,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===n,lockOrientation:()=>n=!0,unLockOrientation:()=>n=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),r=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),a=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),n.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),n.removeClass("d-flex"),o.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},u=function(){let o=!1;return{on(){o||(d.block(),a.removeClass("unloaded"),r.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),a.addClass("unloaded"),r.removeClass("unloaded"),d.release(),i.val(""),o=!1)}}}();function f(){return t.hasClass("loaded")}e.on("click",function(){p.on(),u.on(),i.trigger("focus")}),t.on("click",function(){p.off(),u.off()}),i.on("focus",function(){n.addClass("input-focus")}),i.on("focusout",function(){n.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").on("click",o.toggle),$("#mask").on("click",o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,r=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).on("scroll",()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(r-o)<=t)){if(o>r)ScrollHelper.hideTopbar(),e.is(":focus")&&e.trigger("blur");else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}r=o}}(),o=!1)},250)}),$(function(){var o="div.post>h1:first-of-type",e=$(o);const a=$("#topbar-title");if(0!==e.length&&!e.hasClass("dynamic-title")&&!a.is(":hidden")){const s=a.text().trim();let r=e.text().trim(),l=!1,n=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(r)&&(r=r.replace(/[0-9]/g,"").trim()),e.offset().top<$(window).scrollTop()&&a.text(r);new IntersectionObserver(o=>{var e,t;l?(t=$(window).scrollTop(),e=n<t,n=t,t=o[0],e?0===t.intersectionRatio&&a.text(r):1===t.intersectionRatio&&a.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(o)),a.on("click",function(){$("body,html").animate({scrollTop:0},800)})}});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).on("scroll",()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").on("click",()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").on("click",e=>{e=$(e.target);(e.prop("tagName")==="button".toUpperCase()?e:e.parent()).trigger("blur"),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,r=!1,l=!1;return{hideTopbar:()=>e.attr(t,"false"),showTopbar:()=>e.attr(t,"true"),addScrollUpTask:()=>{a+=1,r=r||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===l,lockOrientation:()=>l=!0,unLockOrientation:()=>l=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),r=$("#topbar-title"),l=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),r.addClass("unloaded"),t.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),e.removeClass("unloaded"),r.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)}}}();function f(){return o.hasClass("loaded")}t.on("click",function(){p.on(),u.on(),i.trigger("focus")}),o.on("click",function(){p.off(),u.off()}),i.on("focus",function(){l.addClass("input-focus")}),i.on("focusout",function(){l.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").on("click",e.toggle),$("#mask").on("click",e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).on("scroll",()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.trigger("blur");else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var e="div.post>h1:first-of-type",t=$(e);const n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=t.text().trim(),r=!1,l=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(a);new IntersectionObserver(e=>{var t,o;r?(o=$(window).scrollTop(),t=l<o,l=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(e)),n.on("click",function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$("html").attr("lang").substring(0,2),t="data-ts",o="data-df";return{locale:()=>e,attrTimestamp:()=>t,attrDateFormat:()=>o,getTimestamp:e=>Number(e.attr(t)),getDateFormat:e=>e.attr(o)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){var e=dayjs.unix(LocaleHelper.getTimestamp($(this))),t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).on("scroll",()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").on("click",()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").on("click",e=>{e=$(e.target);(e.prop("tagName")==="button".toUpperCase()?e:e.parent()).trigger("blur"),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,r=!1,l=!1;return{hideTopbar:()=>e.attr(t,"false"),showTopbar:()=>e.attr(t,"true"),addScrollUpTask:()=>{a+=1,r=r||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===l,lockOrientation:()=>l=!0,unLockOrientation:()=>l=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),r=$("#topbar-title"),l=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),r.addClass("unloaded"),t.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),e.removeClass("unloaded"),r.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)}}}();function f(){return o.hasClass("loaded")}t.on("click",function(){p.on(),u.on(),i.trigger("focus")}),o.on("click",function(){p.off(),u.off()}),i.on("focus",function(){l.addClass("input-focus")}),i.on("focusout",function(){l.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").on("click",e.toggle),$("#mask").on("click",e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).on("scroll",()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.trigger("blur");else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var e="div.post>h1:first-of-type",t=$(e);const n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=t.text().trim(),r=!1,l=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(a);new IntersectionObserver(e=>{var t,o;r?(o=$(window).scrollTop(),t=l<o,l=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(e)),n.on("click",function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$("html").attr("lang").substring(0,2),t="data-ts",o="data-df";return{locale:()=>e,attrTimestamp:()=>t,attrDateFormat:()=>o,getTimestamp:e=>Number(e.attr(t)),getDateFormat:e=>e.attr(o)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){var e=dayjs.unix(LocaleHelper.getTimestamp($(this))),t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).on("scroll",()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").on("click",()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").on("click",e=>{e=$(e.target);(e.prop("tagName")==="button".toUpperCase()?e:e.parent()).trigger("blur"),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let r=0,a=!1,l=!1;return{hideTopbar:()=>e.attr(t,"false"),showTopbar:()=>e.attr(t,"true"),addScrollUpTask:()=>{r+=1,a=a||!0},popScrollUpTask:()=>--r,hasScrollUpTask:()=>0<r,topbarLocked:()=>!0===a,unlockTopbar:()=>a=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===l,lockOrientation:()=>l=!0,unLockOrientation:()=>l=!1}}();$(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),r=$("#main"),a=$("#topbar-title"),l=$("#search-wrapper"),n=$("#search-result-wrapper"),i=$("#search-results"),s=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),a.addClass("unloaded"),t.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),e.removeClass("unloaded"),a.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),r.addClass("unloaded"),e=!0)},off(){e&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),r.removeClass("unloaded"),d.release(),s.val(""),e=!1)}}}();function f(){return o.hasClass("loaded")}t.on("click",function(){p.on(),u.on(),s.trigger("focus")}),o.on("click",function(){p.off(),u.off()}),s.on("focus",function(){l.addClass("input-focus")}),s.on("focusout",function(){l.removeClass("input-focus")}),s.on("input",()=>{""===s.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").on("click",e.toggle),$("#mask").on("click",e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,r=0;function a(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||a()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&a()}),$(window).on("scroll",()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(r-e)<=o)){if(e>r)ScrollHelper.hideTopbar(),t.is(":focus")&&t.trigger("blur");else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}r=e}}(),e=!1)},250)}),$(function(){var e="div.post>h1:first-of-type",t=$(e);const n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const i=n.text().trim();let r=t.text().trim(),a=!1,l=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(r)&&(r=r.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(r);new IntersectionObserver(e=>{var t,o;a?(o=$(window).scrollTop(),t=l<o,l=o,o=e[0],t?0===o.intersectionRatio&&n.text(r):1===o.intersectionRatio&&n.text(i)):a=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(e)),n.on("click",function(){$("body,html").animate({scrollTop:0},800)})}}),$("#core-wrapper img[data-src]")<=0||($(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),document.addEventListener("lazyloaded",function(e){$(e.target).parent().removeClass("shimmer")})),$(function(){var e=".code-header>button";const t="timeout",r="data-title-succeed",a="data-original-title";function l(e){if($(e)[0].hasAttribute(t)){e=$(e).attr(t);if(Number(e)>Date.now())return 1}}function n(e){$(e).attr(t,Date.now()+2e3)}function i(e){$(e).removeAttr(t)}var o=new ClipboardJS(e,{target(e){return e.parentNode.nextElementSibling.querySelector("code .rouge-code")}});$(e).tooltip({trigger:"hover",placement:"left"});const s=$(e).children().attr("class");o.on("success",e=>{e.clearSelection();const t=e.trigger;var o;l(t)||(e=t,$(e).children().attr("class","fas fa-check"),e=t,o=$(e).attr(r),$(e).attr(a,o).tooltip("show"),n(t),setTimeout(()=>{var e;e=t,$(e).tooltip("hide").removeAttr(a),e=t,$(e).children().attr("class",s),i(t)},2e3))}),$("#copy-link").on("click",e=>{let o=$(e.target);l(o)||navigator.clipboard.writeText(window.location.href).then(()=>{const e=o.attr(a);var t=o.attr(r);o.attr(a,t).tooltip("show"),n(o),setTimeout(()=>{o.attr(a,e),i(o)},2e3)})})}),$(function(){const e=$("#topbar-title"),s="scroll-focus";$("a[href*='#']").not("[href='#']").not("[href='#0']").on("click",function(a){if(this.pathname.replace(/^\//,"")===location.pathname.replace(/^\//,"")&&location.hostname===this.hostname){var l=decodeURI(this.hash);let t=RegExp(/^#fnref:/).test(l),o=!t&&RegExp(/^#fn:/).test(l);var n="#"+$.escapeSelector(l.substring(1));let r=$(n);var n=e.is(":visible"),i=$(window).width()<$(window).height();if(void 0!==r){a.preventDefault(),history.pushState&&history.pushState(null,null,l);a=$(window).scrollTop();let e=r.offset().top-=8;e<a&&(ScrollHelper.hideTopbar(),ScrollHelper.addScrollUpTask()),n&&i&&(e-=ScrollHelper.getTopbarHeight()),$("html").animate({scrollTop:e},500,()=>{r.trigger("focus");var e=$(`[${s}=true]`),e=(e.length&&e.attr(s,"false"),$(":target"));if(e.length&&e.attr(s,"false"),(o||t)&&r.attr(s,"true"),r.is(":focus"))return!1;r.attr("tabindex","-1"),r.trigger("focus"),ScrollHelper.hasScrollUpTask()&&ScrollHelper.popScrollUpTask()})}}})});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
$(function(){$(window).on("scroll",()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").on("click",()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").on("click",t=>{t=$(t.target);(t.prop("tagName")==="button".toUpperCase()?t:t.parent()).trigger("blur"),flipMode()})});const ScrollHelper=function(){const t=$("body"),e="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let r=0,a=!1,l=!1;return{hideTopbar:()=>t.attr(e,"false"),showTopbar:()=>t.attr(e,"true"),addScrollUpTask:()=>{r+=1,a=a||!0},popScrollUpTask:()=>--r,hasScrollUpTask:()=>0<r,topbarLocked:()=>!0===a,unlockTopbar:()=>a=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===l,lockOrientation:()=>l=!0,unLockOrientation:()=>l=!1}}(),LocaleHelper=($(function(){const t=$("#sidebar-trigger"),e=$("#search-trigger"),o=$("#search-cancel"),r=$("#main"),a=$("#topbar-title"),l=$("#search-wrapper"),n=$("#search-result-wrapper"),i=$("#search-results"),s=$("#search-input"),c=$("#search-hints"),d=function(){let t=0;return{block(){t=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(t)},getOffset(){return t}}}(),p={on(){t.addClass("unloaded"),a.addClass("unloaded"),e.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),t.removeClass("unloaded"),a.removeClass("unloaded"),e.removeClass("unloaded")}},u=function(){let t=!1;return{on(){t||(d.block(),n.removeClass("unloaded"),r.addClass("unloaded"),t=!0)},off(){t&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),r.removeClass("unloaded"),d.release(),s.val(""),t=!1)}}}();function h(){return o.hasClass("loaded")}e.on("click",function(){p.on(),u.on(),s.trigger("focus")}),o.on("click",function(){p.off(),u.off()}),s.on("focus",function(){l.addClass("input-focus")}),s.on("focusout",function(){l.removeClass("input-focus")}),s.on("input",()=>{""===s.val()?h()?c.removeClass("unloaded"):u.off():(u.on(),h()&&c.addClass("unloaded"))})}),$(function(){var t=function(){const t="sidebar-display";let e=!1;const o=$("body");return{toggle(){!1===e?o.attr(t,""):o.removeAttr(t),e=!e}}}();$("#sidebar-trigger").on("click",t.toggle),$("#mask").on("click",t.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),o=ScrollHelper.getTopbarHeight();let t,r=0;function a(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var t=screen.orientation.type;"landscape-primary"!==t&&"landscape-secondary"!==t||a()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&a()}),$(window).on("scroll",()=>{t=t||!0}),setInterval(()=>{t&&(!function(){var t=$(this).scrollTop();if(!(Math.abs(r-t)<=o)){if(t>r)ScrollHelper.hideTopbar(),e.is(":focus")&&e.trigger("blur");else if(t+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}r=t}}(),t=!1)},250)}),$(function(){var t="div.post>h1:first-of-type",e=$(t);const n=$("#topbar-title");if(0!==e.length&&!e.hasClass("dynamic-title")&&!n.is(":hidden")){const i=n.text().trim();let r=e.text().trim(),a=!1,l=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(r)&&(r=r.replace(/[0-9]/g,"").trim()),e.offset().top<$(window).scrollTop()&&n.text(r);new IntersectionObserver(t=>{var e,o;a?(o=$(window).scrollTop(),e=l<o,l=o,o=t[0],e?0===o.intersectionRatio&&n.text(r):1===o.intersectionRatio&&n.text(i)):a=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(t)),n.on("click",function(){$("body,html").animate({scrollTop:0},800)})}}),$("#core-wrapper img[data-src]")<=0||($(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),document.addEventListener("lazyloaded",function(t){$(t.target).parent().removeClass("shimmer")})),function(){const t=$("html").attr("lang").substring(0,2),e="data-ts",o="data-df";return{locale:()=>t,attrTimestamp:()=>e,attrDateFormat:()=>o,getTimestamp:t=>Number(t.attr(e)),getDateFormat:t=>t.attr(o)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){var t=dayjs.unix(LocaleHelper.getTimestamp($(this))),e=t.format(LocaleHelper.getDateFormat($(this))),e=($(this).text(e),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==e&&"tooltip"===e&&(e=t.format("llll"),$(this).attr("data-original-title",e))})}),$(function(){var t=".code-header>button";const e="timeout",r="data-title-succeed",a="data-original-title";function l(t){if($(t)[0].hasAttribute(e)){t=$(t).attr(e);if(Number(t)>Date.now())return 1}}function n(t){$(t).attr(e,Date.now()+2e3)}function i(t){$(t).removeAttr(e)}var o=new ClipboardJS(t,{target(t){return t.parentNode.nextElementSibling.querySelector("code .rouge-code")}});$(t).tooltip({trigger:"hover",placement:"left"});const s=$(t).children().attr("class");o.on("success",t=>{t.clearSelection();const e=t.trigger;var o;l(e)||(t=e,$(t).children().attr("class","fas fa-check"),t=e,o=$(t).attr(r),$(t).attr(a,o).tooltip("show"),n(e),setTimeout(()=>{var t;t=e,$(t).tooltip("hide").removeAttr(a),t=e,$(t).children().attr("class",s),i(e)},2e3))}),$("#copy-link").on("click",t=>{let o=$(t.target);l(o)||navigator.clipboard.writeText(window.location.href).then(()=>{const t=o.attr(a);var e=o.attr(r);o.attr(a,e).tooltip("show"),n(o),setTimeout(()=>{o.attr(a,t),i(o)},2e3)})})}),$(function(){const t=$("#topbar-title"),s="scroll-focus";$("a[href*='#']").not("[href='#']").not("[href='#0']").on("click",function(a){if(this.pathname.replace(/^\//,"")===location.pathname.replace(/^\//,"")&&location.hostname===this.hostname){var l=decodeURI(this.hash);let e=RegExp(/^#fnref:/).test(l),o=!e&&RegExp(/^#fn:/).test(l);var n="#"+$.escapeSelector(l.substring(1));let r=$(n);var n=t.is(":visible"),i=$(window).width()<$(window).height();if(void 0!==r){a.preventDefault(),history.pushState&&history.pushState(null,null,l);a=$(window).scrollTop();let t=r.offset().top-=8;t<a&&(ScrollHelper.hideTopbar(),ScrollHelper.addScrollUpTask()),n&&i&&(t-=ScrollHelper.getTopbarHeight()),$("html").animate({scrollTop:t},500,()=>{r.trigger("focus");var t=$(`[${s}=true]`),t=(t.length&&t.attr(s,"false"),$(":target"));if(t.length&&t.attr(s,"false"),(o||e)&&r.attr(s,"true"),r.is(":focus"))return!1;r.attr("tabindex","-1"),r.trigger("focus"),ScrollHelper.hasScrollUpTask()&&ScrollHelper.popScrollUpTask()})}}})});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Chirpy v5.5.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
3
|
+
* © 2019 Cotes Chung
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
const getInitStatus=function(){let t=!1;return()=>{var e=t;return t=t||!0,e}}(),PvOpts=function(){function t(e){return $(e).attr("content")}function e(e){e=t(e);return void 0!==e&&!1!==e}return{getProxyMeta(){return t("meta[name=pv-proxy-endpoint]")},getLocalMeta(){return t("meta[name=pv-cache-path]")},hasProxyMeta(){return e("meta[name=pv-proxy-endpoint]")},hasLocalMeta(){return e("meta[name=pv-cache-path]")}}}(),PvStorage=function(){const a={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t={LOCAL:"same-origin",PROXY:"cors"};function r(e){return localStorage.getItem(e)}function o(e,t){localStorage.setItem(e,t)}function n(e,t){o(a.KEY_PV,e),o(a.KEY_PV_SRC,t),o(a.KEY_CREATION,(new Date).toJSON())}return{keysCount(){return Object.keys(a).length},hasCache(){return null!==localStorage.getItem(a.KEY_PV)},getCache(){return JSON.parse(localStorage.getItem(a.KEY_PV))},saveLocalCache(e){n(e,t.LOCAL)},saveProxyCache(e){n(e,t.PROXY)},isExpired(){var e=new Date(r(a.KEY_CREATION));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()},isFromLocal(){return r(a.KEY_PV_SRC)===t.LOCAL},isFromProxy(){return r(a.KEY_PV_SRC)===t.PROXY},newerThan(e){return PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"]},inspectKeys(){if(localStorage.length!==PvStorage.keysCount())localStorage.clear();else for(let e=0;e<localStorage.length;e++)switch(localStorage.key(e)){case a.KEY_PV:case a.KEY_PV_SRC:case a.KEY_CREATION:break;default:return void localStorage.clear()}}}}();function countUp(e,t,a){e<t&&((a=new CountUp(a,e,t)).error?console.error(a.error):a.start())}function countPV(t,a){let r=0;if(void 0!==a)for(let e=0;e<a.length;++e)if(a[parseInt(e,10)][0]===t){r+=parseInt(a[parseInt(e,10)][1],10);break}return r}function tacklePV(e,t,a,r){t=0===(t=countPV(t,e))?1:t;r?(e=parseInt(a.text().replace(/,/g,""),10))<t&&countUp(e,t,a.attr("id")):a.text((new Intl.NumberFormat).format(t))}function displayPageviews(e){if(void 0!==e){let t=getInitStatus();const a=e.rows;0<$("#post-list").length?$(".post-preview").each(function(){var e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)}):0<$(".post").length&&(e=window.location.pathname,tacklePV(a,e,$("#pv"),t))}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(t=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(e=>{t&&PvStorage.isFromProxy()&&PvStorage.newerThan(e)||(displayPageviews(e),PvStorage.saveLocalCache(JSON.stringify(e)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
@@ -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
|
+
|
data/assets/js/pwa/sw.js
ADDED
@@ -0,0 +1,90 @@
|
|
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: "%Y%m%d.%H%M%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 (event.request.method !== 'GET' ||
|
70
|
+
!verifyDomain(url) ||
|
71
|
+
isExcluded(url)) {
|
72
|
+
return response;
|
73
|
+
}
|
74
|
+
|
75
|
+
/*
|
76
|
+
see: <https://developers.google.com/web/fundamentals/primers/service-workers#cache_and_return_requests>
|
77
|
+
*/
|
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
|
+
});
|
90
|
+
|
data/assets/robots.txt
ADDED
metadata
ADDED
@@ -0,0 +1,236 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: custom-chirpy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 5.5.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- 0tax00
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jekyll-paginate
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jekyll-redirect-from
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.16'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.16'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jekyll-seo-tag
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.7'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jekyll-archives
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.2'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jekyll-sitemap
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.4'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.4'
|
97
|
+
description:
|
98
|
+
email:
|
99
|
+
- mateusgodinho0102@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- LICENSE
|
105
|
+
- README.md
|
106
|
+
- _data/assets/cross_origin.yml
|
107
|
+
- _data/assets/self_host.yml
|
108
|
+
- _data/authors.yml
|
109
|
+
- _data/contact.yml
|
110
|
+
- _data/locales/ar.yml
|
111
|
+
- _data/locales/bg-BG.yml
|
112
|
+
- _data/locales/cs-CZ.yml
|
113
|
+
- _data/locales/de-DE.yml
|
114
|
+
- _data/locales/el-GR.yml
|
115
|
+
- _data/locales/en.yml
|
116
|
+
- _data/locales/es-ES.yml
|
117
|
+
- _data/locales/fi-FI.yml
|
118
|
+
- _data/locales/fr-FR.yml
|
119
|
+
- _data/locales/hu-HU.yml
|
120
|
+
- _data/locales/id-ID.yml
|
121
|
+
- _data/locales/it-IT.yml
|
122
|
+
- _data/locales/ko-KR.yml
|
123
|
+
- _data/locales/my-MM.yml
|
124
|
+
- _data/locales/pt-BR.yml
|
125
|
+
- _data/locales/ru-RU.yml
|
126
|
+
- _data/locales/tr-TR.yml
|
127
|
+
- _data/locales/uk-UA.yml
|
128
|
+
- _data/locales/vi-VN.yml
|
129
|
+
- _data/locales/zh-CN.yml
|
130
|
+
- _data/share.yml
|
131
|
+
- _includes/assets-origin.html
|
132
|
+
- _includes/comments.html
|
133
|
+
- _includes/comments/disqus.html
|
134
|
+
- _includes/comments/giscus.html
|
135
|
+
- _includes/comments/utterances.html
|
136
|
+
- _includes/datetime.html
|
137
|
+
- _includes/embed/twitch.html
|
138
|
+
- _includes/embed/youtube.html
|
139
|
+
- _includes/favicons.html
|
140
|
+
- _includes/footer.html
|
141
|
+
- _includes/google-analytics.html
|
142
|
+
- _includes/head.html
|
143
|
+
- _includes/js-selector.html
|
144
|
+
- _includes/jsdelivr-combine.html
|
145
|
+
- _includes/language-alias.html
|
146
|
+
- _includes/mermaid.html
|
147
|
+
- _includes/mode-toggle.html
|
148
|
+
- _includes/no-linenos.html
|
149
|
+
- _includes/post-nav.html
|
150
|
+
- _includes/post-paginator.html
|
151
|
+
- _includes/post-sharing.html
|
152
|
+
- _includes/read-time.html
|
153
|
+
- _includes/refactor-content.html
|
154
|
+
- _includes/related-posts.html
|
155
|
+
- _includes/search-loader.html
|
156
|
+
- _includes/search-results.html
|
157
|
+
- _includes/sidebar.html
|
158
|
+
- _includes/toc.html
|
159
|
+
- _includes/topbar.html
|
160
|
+
- _includes/trending-tags.html
|
161
|
+
- _includes/update-list.html
|
162
|
+
- _layouts/archives.html
|
163
|
+
- _layouts/categories.html
|
164
|
+
- _layouts/category.html
|
165
|
+
- _layouts/compress.html
|
166
|
+
- _layouts/default.html
|
167
|
+
- _layouts/home.html
|
168
|
+
- _layouts/page.html
|
169
|
+
- _layouts/post.html
|
170
|
+
- _layouts/tag.html
|
171
|
+
- _layouts/tags.html
|
172
|
+
- _sass/addon/commons.scss
|
173
|
+
- _sass/addon/module.scss
|
174
|
+
- _sass/addon/syntax.scss
|
175
|
+
- _sass/addon/variables.scss
|
176
|
+
- _sass/colors/dark-syntax.scss
|
177
|
+
- _sass/colors/dark-typography.scss
|
178
|
+
- _sass/colors/light-syntax.scss
|
179
|
+
- _sass/colors/light-typography.scss
|
180
|
+
- _sass/jekyll-theme-chirpy.scss
|
181
|
+
- _sass/layout/archives.scss
|
182
|
+
- _sass/layout/categories.scss
|
183
|
+
- _sass/layout/category-tag.scss
|
184
|
+
- _sass/layout/home.scss
|
185
|
+
- _sass/layout/post.scss
|
186
|
+
- _sass/layout/tags.scss
|
187
|
+
- _sass/variables-hook.scss
|
188
|
+
- assets/404.html
|
189
|
+
- assets/css/style.scss
|
190
|
+
- assets/feed.xml
|
191
|
+
- assets/img/favicons/android-chrome-192x192.png
|
192
|
+
- assets/img/favicons/android-chrome-512x512.png
|
193
|
+
- assets/img/favicons/apple-touch-icon.png
|
194
|
+
- assets/img/favicons/browserconfig.xml
|
195
|
+
- assets/img/favicons/favicon-16x16.png
|
196
|
+
- assets/img/favicons/favicon-32x32.png
|
197
|
+
- assets/img/favicons/favicon.ico
|
198
|
+
- assets/img/favicons/mstile-150x150.png
|
199
|
+
- assets/img/favicons/site.webmanifest
|
200
|
+
- assets/js/data/search.json
|
201
|
+
- assets/js/data/swcache.js
|
202
|
+
- assets/js/dist/categories.min.js
|
203
|
+
- assets/js/dist/commons.min.js
|
204
|
+
- assets/js/dist/home.min.js
|
205
|
+
- assets/js/dist/misc.min.js
|
206
|
+
- assets/js/dist/page.min.js
|
207
|
+
- assets/js/dist/post.min.js
|
208
|
+
- assets/js/dist/pvreport.min.js
|
209
|
+
- assets/js/pwa/app.js
|
210
|
+
- assets/js/pwa/sw.js
|
211
|
+
- assets/js/pwa/unregister.js
|
212
|
+
- assets/robots.txt
|
213
|
+
homepage: https://github.com/0tax00/custom-chirpy
|
214
|
+
licenses:
|
215
|
+
- MIT
|
216
|
+
metadata: {}
|
217
|
+
post_install_message:
|
218
|
+
rdoc_options: []
|
219
|
+
require_paths:
|
220
|
+
- lib
|
221
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
222
|
+
requirements:
|
223
|
+
- - ">="
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '2.6'
|
226
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
|
+
requirements:
|
228
|
+
- - ">="
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
231
|
+
requirements: []
|
232
|
+
rubygems_version: 3.3.5
|
233
|
+
signing_key:
|
234
|
+
specification_version: 4
|
235
|
+
summary: A minimal, responsive and feature-rich Jekyll theme for technical writing.
|
236
|
+
test_files: []
|