Improve the copyrights of the assets

This commit is contained in:
Cotes Chung 2021-01-25 06:20:51 +08:00
parent cbb3bd4be5
commit 893db51ff0
72 changed files with 139 additions and 342 deletions

View file

@ -1,14 +1,9 @@
--- ---
# The 404 page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
layout: page layout: page
title: "404: Page not found" title: "404: Page not found"
permalink: /404.html permalink: /404.html
redirect_from: # part of site.sitemap_exclude redirect_from:
- /norobots/ - /norobots/
- /assets/ - /assets/
- /tabs/ - /tabs/
@ -22,4 +17,4 @@ dynamic_title: true
<div class="lead"> <div class="lead">
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p> <p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
<p><a href="{{ site.baseurl }}/">Head back Home</a> to try finding it again, or search for it on the <a href="{{ site.baseurl }}/tabs/archives">Archives page</a>.</p> <p><a href="{{ site.baseurl }}/">Head back Home</a> to try finding it again, or search for it on the <a href="{{ site.baseurl }}/tabs/archives">Archives page</a>.</p>
</div> </div>

View file

@ -1,9 +1,4 @@
# The Site Settings # The Site Configuration
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT licensed
# jekyll-seo-tag settings https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md # jekyll-seo-tag settings https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
# -------------------------- # --------------------------

View file

@ -1,8 +1,4 @@
# The contact options. # The contact options.
# v2.3
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
- -
type: github type: github

View file

@ -1,9 +1,4 @@
# The date format # The date format
# v2.1
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
tooltip: "%a, %b %e, %Y, %l:%M %p %z" tooltip: "%a, %b %e, %Y, %l:%M %p %z"

View file

@ -1,8 +1,4 @@
# The label text of site. # The label text of site.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
panel: panel:
lastmod: Recent Update lastmod: Recent Update

View file

@ -1,3 +0,0 @@
name: Chirpy
version: 2.7.2
homepage: https://github.com/cotes2020/jekyll-theme-chirpy/

View file

@ -1,10 +1,4 @@
# License data. # License data
#
# v2.1
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
license: license:
name: CC BY 4.0 name: CC BY 4.0
@ -14,4 +8,4 @@ brief: Some rights reserved.
verbose: >- verbose: >-
Except where otherwise noted, the blog posts on this site are licensed Except where otherwise noted, the blog posts on this site are licensed
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author. under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.

View file

@ -1,10 +1,5 @@
# Sharing options at the bottom of the post. # Sharing options at the bottom of the post.
# Icons from <https://fontawesome.com/> # Icons from <https://fontawesome.com/>
#
# v2.1
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
platforms: platforms:
- -

View file

@ -1,9 +1,5 @@
<!-- <!--
CSS selector for site. CSS selector for site.
Chirpy v2.3
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT Licensed
--> -->
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}"> <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">

View file

@ -1,10 +1,6 @@
<!-- <!--
The Disqus lazy loading. The Disqus lazy loading.
Powered by: <https://github.com/osvaldasvalutis/disqusLoader.js> Powered by: <https://github.com/osvaldasvalutis/disqusLoader.js>
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT License
--> -->
<div id="disqus" class="pt-2 pb-2"> <div id="disqus" class="pt-2 pb-2">

View file

@ -1,10 +1,6 @@
<!-- <!--
The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps
Generated by: https://www.favicon-generator.org/ Generated by: https://www.favicon-generator.org/
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
Published under the MIT license
--> -->
{% capture icon_url %}{{ site.baseurl }}/assets/img/favicons{% endcapture %} {% capture icon_url %}{{ site.baseurl }}/assets/img/favicons{% endcapture %}

View file

@ -1,9 +1,5 @@
<!-- <!--
The Footer The Footer
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<footer class="d-flex w-100 justify-content-center"> <footer class="d-flex w-100 justify-content-center">

View file

@ -1,9 +1,5 @@
<!-- <!--
The GA snippet The GA snippet
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script> <script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>

View file

@ -1,15 +1,10 @@
<!-- <!--
The Head The Head
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme" content="{{ site.data.meta.name }} v{{ site.data.meta.version }}">
{% if page.layout == 'home' or page.layout == 'post' %} {% if page.layout == 'home' or page.layout == 'post' %}
<meta name="pv-cache-enabled" content="{{ site.google_analytics.pv.enabled }}"> <meta name="pv-cache-enabled" content="{{ site.google_analytics.pv.enabled }}">

View file

@ -1,9 +1,5 @@
<!-- <!--
JS selector for site. JS selector for site.
Chirpy v2.3
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT Licensed
--> -->
{% if page.layout == 'home' or page.layout == 'post' %} {% if page.layout == 'home' or page.layout == 'post' %}

View file

@ -1,4 +1,6 @@
<!-- image lazy load: https://github.com/ApoorvSaxena/lozad.js --> <!--
image lazy load: https://github.com/ApoorvSaxena/lozad.js
-->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View file

@ -1,10 +1,5 @@
<!-- <!--
Switch the mode between dark and light. Switch the mode between dark and light.
v2.1
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT License
--> -->
<i class="mode-toggle fas fa-adjust"></i> <i class="mode-toggle fas fa-adjust"></i>

View file

@ -1,9 +1,5 @@
{% comment %} {% comment %}
Remove the line number of the code snippet. Remove the line number of the code snippet.
v2.2
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
Published under the MIT License
{% endcomment %} {% endcomment %}
{% assign content = include.content %} {% assign content = include.content %}

View file

@ -1,9 +1,5 @@
<!-- <!--
The Pannel on right side (Desktop views) The Pannel on right side (Desktop views)
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down"> <div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">

View file

@ -1,10 +1,5 @@
<!-- <!--
Navigation buttons at the bottom of the post. Navigation buttons at the bottom of the post.
v2.1
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT License
--> -->
<div class="post-navigation d-flex justify-content-between"> <div class="post-navigation d-flex justify-content-between">

View file

@ -1,10 +1,5 @@
<!-- <!--
The paginator for post list on HomgPage. The paginator for post list on HomgPage.
v2.1
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT License
--> -->
<ul class="pagination mt-4 mb-0 pl-lg-2"> <ul class="pagination mt-4 mb-0 pl-lg-2">

View file

@ -1,10 +1,5 @@
<!-- <!--
Post sharing snippet Post sharing snippet
v2.1
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
Published under the MIT License
--> -->
<div class="share-wrapper"> <div class="share-wrapper">

View file

@ -1,11 +1,6 @@
<!-- <!--
Recommend the other 3 posts according to the tags and categories of the current post, Recommend the other 3 posts according to the tags and categories of the current post,
if the number is not enough, use the other latest posts to supplement. if the number is not enough, use the other latest posts to supplement.
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
Published under the MIT License
--> -->
<!-- The total size of related posts --> <!-- The total size of related posts -->

View file

@ -1,9 +1,5 @@
<!-- <!--
Jekyll Simple Search loader Jekyll Simple Search loader
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
{% capture result_elem %} {% capture result_elem %}

View file

@ -1,9 +1,5 @@
<!-- <!--
The Search results The Search results
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded"> <div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
<div class="col-12 col-xl-11 post-content"> <div class="col-12 col-xl-11 post-content">

View file

@ -1,9 +1,5 @@
<!-- <!--
The Side Bar The Side Bar
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<div id="sidebar" class="d-flex flex-column align-items-end"> <div id="sidebar" class="d-flex flex-column align-items-end">

View file

@ -1,10 +1,5 @@
<!-- <!--
Date format snippet Date format snippet
v2.4.1
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT License
--> -->
{% assign tooltip_df = site.data.date_format.tooltip | default: '%a, %b %e, %Y, %l:%M %p %z' %} {% assign tooltip_df = site.data.date_format.tooltip | default: '%a, %b %e, %Y, %l:%M %p %z' %}

View file

@ -1,10 +1,7 @@
<!-- <!--
The Top Bar The Top Bar
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2017-2019 Cotes Chung
MIT License
--> -->
<div id="topbar-wrapper" class="row justify-content-center topbar-down"> <div id="topbar-wrapper" class="row justify-content-center topbar-down">
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between"> <div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
<span id="breadcrumb"> <span id="breadcrumb">

View file

@ -1,9 +1,5 @@
{% comment %} {% comment %}
The trending tags list The trending tags list
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
© 2019 Cotes Chung
MIT Licensed
{% endcomment %} {% endcomment %}
{% assign MAX = 10 %} {% assign MAX = 10 %}

View file

@ -1,9 +1,5 @@
{% comment %} {% comment %}
Get the last 5 posts from lastmod list. Get the last 5 posts from lastmod list.
v2.2
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT License
{% endcomment %} {% endcomment %}
{% assign MAX_SIZE = 5 %} {% assign MAX_SIZE = 5 %}

View file

@ -1,11 +1,6 @@
--- ---
layout: page layout: page
# The Archives of posts. # The Archives of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
--- ---

View file

@ -1,11 +1,6 @@
--- ---
layout: page layout: page
# All the Categories of posts # All the Categories of posts
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
--- ---

View file

@ -1,9 +1,6 @@
--- ---
layout: page layout: page
# The Category layout # The Category layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# MIT Licensed
--- ---
<div id="page-category"> <div id="page-category">

View file

@ -1,10 +1,6 @@
--- ---
layout: compress layout: compress
# Default layout # Default layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
--- ---
<!DOCTYPE html> <!DOCTYPE html>

View file

@ -1,10 +1,6 @@
--- ---
layout: page layout: page
# The Home page layout # The Home page layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
--- ---

View file

@ -1,10 +1,6 @@
--- ---
layout: default layout: default
# The page layout # The page layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
--- ---
<div class="row"> <div class="row">

View file

@ -1,10 +1,6 @@
--- ---
layout: default layout: default
# The posts' layout # The posts' layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
--- ---
<div class="row"> <div class="row">

View file

@ -1,10 +1,6 @@
--- ---
layout: page layout: page
# The layout for Tag page # The layout for Tag page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
--- ---

View file

@ -1,11 +1,6 @@
--- ---
layout: page layout: page
# All the Tags of posts. # All the Tags of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
--- ---
<div id="tags" class="d-flex flex-wrap ml-xl-2 mr-xl-2"> <div id="tags" class="d-flex flex-wrap ml-xl-2 mr-xl-2">

View file

@ -1,4 +1,7 @@
#!/usr/bin/env ruby
#
# Check for changed posts # Check for changed posts
Jekyll::Hooks.register :posts, :post_init do |post| Jekyll::Hooks.register :posts, :post_init do |post|
commit_num = `git rev-list --count HEAD "#{ post.path }"` commit_num = `git rev-list --count HEAD "#{ post.path }"`

View file

@ -1,8 +1,7 @@
/* /*!
* The main styles * The styles for Jekyll theme Chirpy
* *
* v2.7.2 * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy)
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2021 Cotes Chung * © 2021 Cotes Chung
* MIT Licensed * MIT Licensed
*/ */

View file

@ -2,12 +2,6 @@
title: About title: About
icon: fas fa-info icon: fas fa-info
order: 4 order: 4
# The About page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
--- ---

6
app.js
View file

@ -1,12 +1,8 @@
--- ---
layout: compress layout: compress
# Chirpy v2.2
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
--- ---
/* Registering Service Worker */ /* Registering Service Worker */
if('serviceWorker' in navigator) { if('serviceWorker' in navigator) {
navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}'); navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}');
}; };

5
assets/js/.copyright Normal file
View file

@ -0,0 +1,5 @@
/*!
* Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
* © 2021 Cotes Chung
* MIT Licensed
*/

View file

@ -1,9 +1,5 @@
/* /*
* Copy current page url to clipboard. * Copy current page url to clipboard.
* v2.1
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2020 Cotes Chung
* MIT License
*/ */
function copyLink(url) { function copyLink(url) {

View file

@ -1,9 +1,5 @@
/* /*
* This script make #search-result-wrapper switch to unloaded or shown automatically. * This script make #search-result-wrapper switch to unloaded or shown automatically.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/ */
$(function() { $(function() {

View file

@ -1,9 +1,5 @@
/** /**
* Expand or close the sidebar in mobile screens. * Expand or close the sidebar in mobile screens.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/ */
$(function() { $(function() {

View file

@ -1,9 +1,5 @@
/** /**
* Initial Bootstrap Tooltip. * Initial Bootstrap Tooltip.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT License
*/ */
$(function () { $(function () {
$("[data-toggle=\"tooltip\"]").tooltip(); $("[data-toggle=\"tooltip\"]").tooltip();

View file

@ -1,9 +1,5 @@
/* /*
* Hide Header on scroll down * Hide Header on scroll down
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/ */
$(function() { $(function() {

View file

@ -1,9 +1,5 @@
/* /*
* Top bar title auto change while scrolling in mobile screens. * Top bar title auto change while scrolling in mobile screens.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/ */
$(function() { $(function() {

View file

@ -1,9 +1,5 @@
/* /*
* Tab 'Categories' expand/close effect. * Tab 'Categories' expand/close effect.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/ */
$(function() { $(function() {

View file

@ -1,10 +1,5 @@
/* /*
* Find out the <a> tag contains an image and mark it. * Find out the <a> tag contains an image and mark it.
*
* v2.5.1
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2020 Cotes Chung
* MIT Licensed
*/ */
$(function() { $(function() {

View file

@ -1,14 +1,9 @@
/** /*
* Count page views form GA or local cache file. * Count page views form GA or local cache file.
* *
* Dependencies: * Dependencies:
* - jQuery * - jQuery
* - countUp.js <https://github.com/inorganik/countUp.js> * - countUp.js <https://github.com/inorganik/countUp.js>
*
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2018-2019 Cotes Chung
* MIT License
*/ */
const getInitStatus = (function () { const getInitStatus = (function () {

View file

@ -1,9 +1,5 @@
/* /*
* Calculate the Timeago * Calculate the Timeago
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT Licensed
*/ */
$(function() { $(function() {

View file

@ -1 +1,6 @@
/*!
* Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
* © 2021 Cotes Chung
* MIT Licensed
*/
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(){$("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=$("#sidebar-trigger"),o=$("#search-trigger"),s=$("#search-cancel"),t=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),d=$("#search-result-wrapper"),r=$("#search-results"),c=$("#search-input"),i=$("#search-hints"),f=function(){let e=0;return{block(){e=$(window).scrollTop()},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),u={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),s.addClass("loaded")},off(){s.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},p=function(){let e=!1;return{on(){e||(d.removeClass("unloaded"),a.addClass("hidden"),e=!0,f.block())},off(){e&&(r.empty(),i.hasClass("unloaded")&&i.removeClass("unloaded"),d.addClass("unloaded"),t.removeClass("visible"),a.removeClass("hidden"),c.val(""),e=!1,f.release())},isVisible:()=>e}}();function h(){return s.hasClass("loaded")}o.click(function(){u.on(),p.on(),c.focus()}),s.click(function(){u.off(),p.off()}),c.focus(function(){n.addClass("input-focus")}),c.focusout(function(){n.removeClass("input-focus")}),c.on("keyup",function(e){8===e.keyCode&&""===c.val()?h()?i.removeClass("unloaded"):p.off():""!==c.val()&&(p.on(),t.hasClass("visible")||t.addClass("visible"),h()&&i.addClass("unloaded"))}),t.on("click",function(){c.val(""),h()?(i.removeClass("unloaded"),r.empty()):p.off(),c.focus(),t.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"),s=$(".access"),t=$("#search-input");let a,l=0;const n=5,d=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>d?(e.removeClass("topbar-down").addClass("topbar-up"),o.length>0&&o.removeClass("topbar-down"),s.length>0&&s.removeClass("topbar-down"),t.is(":focus")&&t.blur()):a+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),o.length>0&&o.addClass("topbar-down"),s.length>0&&s.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),s=e.text().trim();let t=o.length>0?o.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.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()!==t&&e.text(t):e.text()!==s&&e.text(s)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const e=$(".collapse");e.on("hide.bs.collapse",function(){const e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${e} i.fas`).addClass("rotate"),$(`#${e}`).removeClass("hide-border-bottom"))}),e.on("show.bs.collapse",function(){const e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${e} i.fas`).removeClass("rotate"),$(`#${e}`).addClass("hide-border-bottom"))})}); 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(){$("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=$("#sidebar-trigger"),o=$("#search-trigger"),s=$("#search-cancel"),t=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),d=$("#search-result-wrapper"),r=$("#search-results"),c=$("#search-input"),i=$("#search-hints"),f=function(){let e=0;return{block(){e=$(window).scrollTop()},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),u={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),s.addClass("loaded")},off(){s.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},p=function(){let e=!1;return{on(){e||(d.removeClass("unloaded"),a.addClass("hidden"),e=!0,f.block())},off(){e&&(r.empty(),i.hasClass("unloaded")&&i.removeClass("unloaded"),d.addClass("unloaded"),t.removeClass("visible"),a.removeClass("hidden"),c.val(""),e=!1,f.release())},isVisible:()=>e}}();function h(){return s.hasClass("loaded")}o.click(function(){u.on(),p.on(),c.focus()}),s.click(function(){u.off(),p.off()}),c.focus(function(){n.addClass("input-focus")}),c.focusout(function(){n.removeClass("input-focus")}),c.on("keyup",function(e){8===e.keyCode&&""===c.val()?h()?i.removeClass("unloaded"):p.off():""!==c.val()&&(p.on(),t.hasClass("visible")||t.addClass("visible"),h()&&i.addClass("unloaded"))}),t.on("click",function(){c.val(""),h()?(i.removeClass("unloaded"),r.empty()):p.off(),c.focus(),t.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"),s=$(".access"),t=$("#search-input");let a,l=0;const n=5,d=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>d?(e.removeClass("topbar-down").addClass("topbar-up"),o.length>0&&o.removeClass("topbar-down"),s.length>0&&s.removeClass("topbar-down"),t.is(":focus")&&t.blur()):a+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),o.length>0&&o.addClass("topbar-down"),s.length>0&&s.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),s=e.text().trim();let t=o.length>0?o.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.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()!==t&&e.text(t):e.text()!==s&&e.text(s)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const e=$(".collapse");e.on("hide.bs.collapse",function(){const e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${e} i.fas`).addClass("rotate"),$(`#${e}`).removeClass("hide-border-bottom"))}),e.on("show.bs.collapse",function(){const e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${e} i.fas`).removeClass("rotate"),$(`#${e}`).addClass("hide-border-bottom"))})});

View file

@ -1 +1,6 @@
/*!
* Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
* © 2021 Cotes Chung
* MIT Licensed
*/
function copyLink(e){e&&0!==e.length||(e=window.location.href);const t=$("<input>");$("body").append(t),t.val(e).select(),document.execCommand("copy"),t.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(){$("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=$("#sidebar-trigger"),t=$("#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 e=0;return{block(){e=$(window).scrollTop()},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),h={on(){e.addClass("unloaded"),n.addClass("unloaded"),t.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),e.removeClass("unloaded"),n.removeClass("unloaded"),t.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(i.removeClass("unloaded"),s.addClass("hidden"),e=!0,u.block())},off(){e&&(r.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),i.addClass("unloaded"),a.removeClass("visible"),s.removeClass("hidden"),c.val(""),e=!1,u.release())},isVisible:()=>e}}();function p(){return o.hasClass("loaded")}t.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(e){8===e.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 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,n=0;const l=5,i=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(s=!0)}),setInterval(function(){s&&(!function(){var s=$(this).scrollTop();Math.abs(n-s)<=l||(s>n&&s>i?(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")),n=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){$(this).text();let t=$(this).hasClass("lastmod"),o=$(this).children("i"),a=o.text();$(this).text(function(t,o){let a=new Date,s=new Date(t);if(s.getFullYear()!==a.getFullYear())return e-=1,s.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric"});if(s.getMonth()!==a.getMonth())return e-=1,s.toLocaleString("en-US",{month:"short",day:"numeric"});let n=Math.floor((a-s)/1e3),l=Math.floor(n/86400);if(l>=1)return e-=1,l+" day"+(l>1?"s":"")+" ago";let i=Math.floor(n/3600);if(i>=1)return i+" hour"+(i>1?"s":"")+" ago";let r=Math.floor(n/60);return r>=1?r+" minute"+(r>1?"s":"")+" ago":(o?"just":"Just")+" now"}(a,t)),$(this).append(o)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&o()>0&&(t=setInterval(o,6e4))}); function copyLink(e){e&&0!==e.length||(e=window.location.href);const t=$("<input>");$("body").append(t),t.val(e).select(),document.execCommand("copy"),t.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(){$("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=$("#sidebar-trigger"),t=$("#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 e=0;return{block(){e=$(window).scrollTop()},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),h={on(){e.addClass("unloaded"),n.addClass("unloaded"),t.addClass("unloaded"),l.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),l.removeClass("d-flex"),e.removeClass("unloaded"),n.removeClass("unloaded"),t.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(i.removeClass("unloaded"),s.addClass("hidden"),e=!0,u.block())},off(){e&&(r.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),i.addClass("unloaded"),a.removeClass("visible"),s.removeClass("hidden"),c.val(""),e=!1,u.release())},isVisible:()=>e}}();function p(){return o.hasClass("loaded")}t.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(e){8===e.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 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,n=0;const l=5,i=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(s=!0)}),setInterval(function(){s&&(!function(){var s=$(this).scrollTop();Math.abs(n-s)<=l||(s>n&&s>i?(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")),n=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){$(this).text();let t=$(this).hasClass("lastmod"),o=$(this).children("i"),a=o.text();$(this).text(function(t,o){let a=new Date,s=new Date(t);if(s.getFullYear()!==a.getFullYear())return e-=1,s.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric"});if(s.getMonth()!==a.getMonth())return e-=1,s.toLocaleString("en-US",{month:"short",day:"numeric"});let n=Math.floor((a-s)/1e3),l=Math.floor(n/86400);if(l>=1)return e-=1,l+" day"+(l>1?"s":"")+" ago";let i=Math.floor(n/3600);if(i>=1)return i+" hour"+(i>1?"s":"")+" ago";let r=Math.floor(n/60);return r>=1?r+" minute"+(r>1?"s":"")+" ago":(o?"just":"Just")+" now"}(a,t)),$(this).append(o)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&o()>0&&(t=setInterval(o,6e4))});

View file

@ -1 +1,6 @@
/*!
* Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
* © 2021 Cotes Chung
* MIT Licensed
*/
function copyLink(e){e&&0!==e.length||(e=window.location.href);const t=$("<input>");$("body").append(t),t.val(e).select(),document.execCommand("copy"),t.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(){$("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=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),s=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),c=$("#search-result-wrapper"),r=$("#search-results"),i=$("#search-input"),d=$("#search-hints"),u=function(){let e=0;return{block(){e=$(window).scrollTop()},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),f={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")}},p=function(){let e=!1;return{on(){e||(c.removeClass("unloaded"),a.addClass("hidden"),e=!0,u.block())},off(){e&&(r.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),c.addClass("unloaded"),s.removeClass("visible"),a.removeClass("hidden"),i.val(""),e=!1,u.release())},isVisible:()=>e}}();function h(){return o.hasClass("loaded")}t.click(function(){f.on(),p.on(),i.focus()}),o.click(function(){f.off(),p.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?d.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),s.hasClass("visible")||s.addClass("visible"),h()&&d.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(d.removeClass("unloaded"),r.empty()):p.off(),i.focus(),s.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"),s=$("#search-input");let a,l=0;const n=5,c=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>c?(e.removeClass("topbar-down").addClass("topbar-up"),t.length>0&&t.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),s.is(":focus")&&s.blur()):a+$(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=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),t=$("div.post>h1"),o=e.text().trim();let s=t.length>0?t.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||t.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==s&&e.text(s):e.text()!==o&&e.text(o)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){$("a[href*='#']").not("[href='#']").not("[href='#0']").click(function(e){if(this.pathname.replace(/^\//,"")===location.pathname.replace(/^\//,"")&&location.hostname===this.hostname){const t=16,o=decodeURI(this.hash);let s=RegExp(/^#fnref:/).test(o),a=RegExp(/^#fn:/).test(o),l=o.includes(":")?o.replace(/\:/,"\\:"):o,n=$(l);if(n.length){e.preventDefault(),history.pushState&&history.pushState(null,null,o);let l=$(this).offset().top,c=n.offset().top;const r=c<l,i=$("#topbar-wrapper").outerHeight();r&&s&&(c-=i+t/2),$("html,body").animate({scrollTop:c},800,()=>{const e=$(n);e.focus();if($("[scroll-focus=true]").length&&$("[scroll-focus=true]").attr("scroll-focus",!1),$(":target").length&&$(":target").attr("scroll-focus",!1),(a||s)&&e.attr("scroll-focus",!0),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()})}}})}); function copyLink(e){e&&0!==e.length||(e=window.location.href);const t=$("<input>");$("body").append(t),t.val(e).select(),document.execCommand("copy"),t.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(){$("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=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),s=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),c=$("#search-result-wrapper"),r=$("#search-results"),i=$("#search-input"),d=$("#search-hints"),u=function(){let e=0;return{block(){e=$(window).scrollTop()},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),f={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")}},p=function(){let e=!1;return{on(){e||(c.removeClass("unloaded"),a.addClass("hidden"),e=!0,u.block())},off(){e&&(r.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),c.addClass("unloaded"),s.removeClass("visible"),a.removeClass("hidden"),i.val(""),e=!1,u.release())},isVisible:()=>e}}();function h(){return o.hasClass("loaded")}t.click(function(){f.on(),p.on(),i.focus()}),o.click(function(){f.off(),p.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?d.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),s.hasClass("visible")||s.addClass("visible"),h()&&d.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(d.removeClass("unloaded"),r.empty()):p.off(),i.focus(),s.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"),s=$("#search-input");let a,l=0;const n=5,c=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>c?(e.removeClass("topbar-down").addClass("topbar-up"),t.length>0&&t.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),s.is(":focus")&&s.blur()):a+$(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=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),t=$("div.post>h1"),o=e.text().trim();let s=t.length>0?t.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||t.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==s&&e.text(s):e.text()!==o&&e.text(o)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){$("a[href*='#']").not("[href='#']").not("[href='#0']").click(function(e){if(this.pathname.replace(/^\//,"")===location.pathname.replace(/^\//,"")&&location.hostname===this.hostname){const t=16,o=decodeURI(this.hash);let s=RegExp(/^#fnref:/).test(o),a=RegExp(/^#fn:/).test(o),l=o.includes(":")?o.replace(/\:/,"\\:"):o,n=$(l);if(n.length){e.preventDefault(),history.pushState&&history.pushState(null,null,o);let l=$(this).offset().top,c=n.offset().top;const r=c<l,i=$("#topbar-wrapper").outerHeight();r&&s&&(c-=i+t/2),$("html,body").animate({scrollTop:c},800,()=>{const e=$(n);e.focus();if($("[scroll-focus=true]").length&&$("[scroll-focus=true]").attr("scroll-focus",!1),$(":target").length&&$(":target").attr("scroll-focus",!1),(a||s)&&e.attr("scroll-focus",!0),e.is(":focus"))return!1;e.attr("tabindex","-1"),e.focus()})}}})});

File diff suppressed because one or more lines are too long

View file

@ -1 +1,6 @@
/*!
* Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
* © 2021 Cotes Chung
* MIT Licensed
*/
const getInitStatus=function(){let e=!1;return()=>{let t=e;return e||(e=!0),t}}(),PvOpts={isEnabled:()=>"true"===$("meta[name=pv-cache-enabled]").attr("content"),getProxyEndpoint:()=>$("meta[name=pv-proxy-endpoint]").attr("content"),getLocalData:()=>$("meta[name=pv-cache-data]").attr("content")},PvCache=function(){const e="origin",t="proxy";function a(e){return localStorage.getItem(e)}function n(e,t){localStorage.setItem(e,t)}return{getData:()=>JSON.parse(localStorage.getItem("pv")),saveOriginCache(t){n("pv",t),n("pv_source",e),n("pv_created_date",(new Date).toJSON())},saveProxyCache(e){n("pv",e),n("pv_source",t),n("pv_created_date",(new Date).toJSON())},isFromOrigin:()=>a("pv_source")===e,isFromProxy:()=>a("pv_source")===t,isExpired(){if(PvCache.isFromOrigin()){let e=new Date(a("pv_created_date"));return e.setDate(e.getDate()+1),Date.now()>=e.getTime()}if(PvCache.isFromProxy()){let e=new Date(a("pv_created_date"));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()}return!1},getAllPageviews:()=>PvCache.getData().totalsForAllResults["ga:pageviews"],newerThan:e=>PvCache.getAllPageviews()>e.totalsForAllResults["ga:pageviews"],inspectKeys(){null!==localStorage.getItem("pv")&&null!==localStorage.getItem("pv_source")&&null!==localStorage.getItem("pv_created_date")||localStorage.clear()}}}();function countUp(e,t,a){if(e<t){let n=new CountUp(a,e,t);n.error?console.error(n.error):n.start()}}function countPV(e,t){let a=0;if(void 0!==t)for(let n=0;n<t.length;++n){if(t[parseInt(n,10)][0]===e){a+=parseInt(t[parseInt(n,10)][1],10);break}}return a}function tacklePV(e,t,a,n){let r=countPV(t,e);if(r=0===r?1:r,n){const e=parseInt(a.text().replace(/,/g,""),10);r>e&&countUp(e,r,a.attr("id"))}else a.text((new Intl.NumberFormat).format(r))}function displayPageviews(e){if(void 0===e)return;let t=getInitStatus();const a=e.rows;if($("#post-list").length>0)$(".post-preview").each(function(){const e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)});else if($(".post").length>0){const e=window.location.pathname;tacklePV(a,e,$("#pv"),t)}}function fetchProxyPageviews(){$.ajax({type:"GET",url:PvOpts.getProxyEndpoint(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:(e,t,a)=>{PvCache.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchPageviews(e=!0,t=!1){PvOpts.isEnabled()&&e?fetch(PvOpts.getLocalData()).then(e=>e.json()).then(e=>{t&&PvCache.newerThan(e)||(displayPageviews(e),PvCache.saveOriginCache(JSON.stringify(e)))}).then(()=>fetchProxyPageviews()):fetchProxyPageviews()}$(function(){if($(".pageviews").length>0){PvCache.inspectKeys();let e=PvCache.getData();e?(displayPageviews(e),PvCache.isExpired()?fetchPageviews(!0,PvCache.isFromProxy()):PvCache.isFromOrigin()&&fetchPageviews(!1)):fetchPageviews()}}); const getInitStatus=function(){let e=!1;return()=>{let t=e;return e||(e=!0),t}}(),PvOpts={isEnabled:()=>"true"===$("meta[name=pv-cache-enabled]").attr("content"),getProxyEndpoint:()=>$("meta[name=pv-proxy-endpoint]").attr("content"),getLocalData:()=>$("meta[name=pv-cache-data]").attr("content")},PvCache=function(){const e="origin",t="proxy";function a(e){return localStorage.getItem(e)}function n(e,t){localStorage.setItem(e,t)}return{getData:()=>JSON.parse(localStorage.getItem("pv")),saveOriginCache(t){n("pv",t),n("pv_source",e),n("pv_created_date",(new Date).toJSON())},saveProxyCache(e){n("pv",e),n("pv_source",t),n("pv_created_date",(new Date).toJSON())},isFromOrigin:()=>a("pv_source")===e,isFromProxy:()=>a("pv_source")===t,isExpired(){if(PvCache.isFromOrigin()){let e=new Date(a("pv_created_date"));return e.setDate(e.getDate()+1),Date.now()>=e.getTime()}if(PvCache.isFromProxy()){let e=new Date(a("pv_created_date"));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()}return!1},getAllPageviews:()=>PvCache.getData().totalsForAllResults["ga:pageviews"],newerThan:e=>PvCache.getAllPageviews()>e.totalsForAllResults["ga:pageviews"],inspectKeys(){null!==localStorage.getItem("pv")&&null!==localStorage.getItem("pv_source")&&null!==localStorage.getItem("pv_created_date")||localStorage.clear()}}}();function countUp(e,t,a){if(e<t){let n=new CountUp(a,e,t);n.error?console.error(n.error):n.start()}}function countPV(e,t){let a=0;if(void 0!==t)for(let n=0;n<t.length;++n){if(t[parseInt(n,10)][0]===e){a+=parseInt(t[parseInt(n,10)][1],10);break}}return a}function tacklePV(e,t,a,n){let r=countPV(t,e);if(r=0===r?1:r,n){const e=parseInt(a.text().replace(/,/g,""),10);r>e&&countUp(e,r,a.attr("id"))}else a.text((new Intl.NumberFormat).format(r))}function displayPageviews(e){if(void 0===e)return;let t=getInitStatus();const a=e.rows;if($("#post-list").length>0)$(".post-preview").each(function(){const e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)});else if($(".post").length>0){const e=window.location.pathname;tacklePV(a,e,$("#pv"),t)}}function fetchProxyPageviews(){$.ajax({type:"GET",url:PvOpts.getProxyEndpoint(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:(e,t,a)=>{PvCache.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchPageviews(e=!0,t=!1){PvOpts.isEnabled()&&e?fetch(PvOpts.getLocalData()).then(e=>e.json()).then(e=>{t&&PvCache.newerThan(e)||(displayPageviews(e),PvCache.saveOriginCache(JSON.stringify(e)))}).then(()=>fetchProxyPageviews()):fetchProxyPageviews()}$(function(){if($(".pageviews").length>0){PvCache.inspectKeys();let e=PvCache.getData();e?(displayPageviews(e),PvCache.isExpired()?fetchPageviews(!0,PvCache.isFromProxy()):PvCache.isFromOrigin()&&fetchPageviews(!1)):fetchPageviews()}});

View file

@ -1,10 +1,6 @@
--- ---
layout: compress layout: compress
# Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html # Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT License
--- ---
{% capture source %} {% capture source %}

View file

@ -7,9 +7,12 @@ const { src, dest, watch, series, parallel} = require('gulp');
const concat = require('gulp-concat'); const concat = require('gulp-concat');
const rename = require("gulp-rename"); const rename = require("gulp-rename");
const uglify = require('gulp-uglify'); const uglify = require('gulp-uglify');
const insert = require('gulp-insert');
const fs = require('fs');
const JS_ROOT = './assets/js'; const JS_ROOT = './assets/js';
const jsDest = `${ JS_ROOT }/dist/`; const jsDest = `${ JS_ROOT }/dist/`;
const copyrightPath = `${ JS_ROOT }/.copyright`;
function concatJs(files, output) { function concatJs(files, output) {
return src(files) return src(files)
@ -20,7 +23,8 @@ function concatJs(files, output) {
function minifyJs() { function minifyJs() {
return src(`${ jsDest }/*.js`) return src(`${ jsDest }/*.js`)
.pipe(uglify()) .pipe(insert.prepend(fs.readFileSync(copyrightPath, 'utf8')))
.pipe(uglify({output: {comments: /^!|@preserve|@license|@cc_on/i}}))
.pipe(dest(jsDest)); .pipe(dest(jsDest));
} }
@ -63,10 +67,7 @@ const pageJs = () => {
// GA pageviews report // GA pageviews report
const pvreportJs = () => { const pvreportJs = () => {
return concatJs([ return concatJs(`${JS_ROOT}/_utils/pageviews.js`, 'pvreport');
`${JS_ROOT}/_utils/pageviews.js`
], 'pvreport'
);
}; };
const buildJs = parallel(homeJs, postJs, categoriesJs, pageJs, pvreportJs); const buildJs = parallel(homeJs, postJs, categoriesJs, pageJs, pvreportJs);
@ -78,7 +79,8 @@ exports.liveRebuild = () => {
watch([ watch([
`${ JS_ROOT }/_commons/*.js`, `${ JS_ROOT }/_commons/*.js`,
`${ JS_ROOT }/_utils/*.js` `${ JS_ROOT }/_utils/*.js`,
`${ JS_ROOT }/lib/*.js`
], ],
buildJs buildJs
) )

View file

@ -1,9 +1,4 @@
--- ---
layout: home layout: home
# Index page # Index page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
--- ---

View file

@ -20,10 +20,11 @@
}, },
"homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme", "homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme",
"dependencies": { "dependencies": {
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-insert": "^0.5.0",
"gulp-rename": "^2.0.0", "gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2" "gulp-uglify": "^3.0.2",
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony"
} }
} }

View file

@ -1,11 +1,6 @@
--- ---
# The robots rules
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
layout: null
permalink: robots.txt permalink: robots.txt
# The robots rules
--- ---
User-agent: * User-agent: *

6
sw.js
View file

@ -1,10 +1,6 @@
--- ---
layout: compress layout: compress
# PWA service worker
# Chirpy v2.2
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
--- ---
self.importScripts('{{ "/assets/js/data/cache-list.js" | relative_url }}'); self.importScripts('{{ "/assets/js/data/cache-list.js" | relative_url }}');

View file

@ -1,53 +0,0 @@
#!/usr/bin/env bash
#
# Bump latest version to file `_data/meta.yml`
#
# v2.5.1
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# Published under MIT License
set -eu
META_FILE="_data/meta.yml"
bump() {
_version_field="version: $1"
if [[ ! -f $META_FILE ]]; then
echo "name: Chirpy" > $META_FILE
echo "$_version_field" >> $META_FILE
echo "homepage: https://github.com/cotes2020/jekyll-theme-chirpy/" >> $META_FILE
else
sed -i "s/^version:.*/$_version_field/g" $META_FILE
fi
if [[ -n $(git status $META_FILE -s) ]]; then
git add $META_FILE
git commit -m "Bump version to $1"
fi
}
_latest_tag="$(git describe --tags --abbrev=0)"
echo "Input a version number (hint: latest version is ${_latest_tag:1})"
read version
if [[ $version =~ ^[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?$ ]]; then
if git tag --list | egrep -q "^v$version$"; then
echo "Error: version '$version' already exists"
exit -1
fi
echo "Bump version to $version"
bump "$version"
echo "Create tag v$version"
git tag "v$version"
else
echo "Error: Illegal version number: '$version'"
fi

75
tools/bump.sh Executable file
View file

@ -0,0 +1,75 @@
#!/usr/bin/env bash
#
# Bump latest version to
# - _sass/jekyll-theme-chirpy.scss
# - assets/js/_commons/_copyright.js
# - assets/js/dist/*.js
# - jekyll-theme-chirpy.gemspec
#
# Required: gulp
set -eu
ASSETS=(
"_sass/jekyll-theme-chirpy.scss"
"assets/js/.copyright"
)
GEM_SPEC="jekyll-theme-chirpy.gemspec"
bump_assets() {
_version="$1"
for i in ${!ASSETS[@]}; do
sed -i "s/v[[:digit:]]\.[[:digit:]]\.[[:digit:]]/v$_version/" ${ASSETS[$i]}
done
gulp
}
bump_gemspec() {
_version="$1"
sed -i "s/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/$_version/" $GEM_SPEC
}
bump() {
bump_assets $1
bump_gemspec $1
if [[ -n $(git status . -s) ]]; then
git add .
git commit -m "Bump version to $1"
fi
}
main() {
if [[ -n $(git status . -s) ]]; then
echo "Warning: commit unstaged files first, and then run this tool againt."
exit -1
fi
_latest_tag="$(git describe --tags --abbrev=0)"
echo "Input a version number (hint: latest version is ${_latest_tag:1})"
read _version
if [[ $_version =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]$ ]]; then
if git tag --list | egrep -q "^v$_version$"; then
echo "Error: version '$_version' already exists"
exit -1
fi
echo "Bump version to $_version"
bump "$_version"
echo "Create tag v$_version"
git tag "v$_version"
else
echo "Error: Illegal version number: '$_version'"
fi
}
main

View file

@ -1,11 +1,6 @@
#!/bin/bash #!/usr/bin/env bash
# #
# Deploy the content of _site to 'origin/<pages_branch>' # Deploy the content of _site to 'origin/<pages_branch>'
#
# v2.5
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# Published under MIT License
set -eu set -eu

View file

@ -1,11 +1,6 @@
#!/bin/bash #!/usr/bin/env bash
# #
# Init the evrionment for new user. # Init the evrionment for new user.
#
# v2.5
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# Published under MIT License
set -eu set -eu

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# #
# Fetch Google Analytics Pageviews reporting cache # Fetch Google Analytics Pageviews reporting cache
# and save as 'assets/data/pagevies.json' # and save as 'assets/data/pagevies.json'
@ -6,12 +6,6 @@
# Requirement: # Requirement:
# - jq # - jq
# - wget # - wget
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2019 Cotes Chung
# MIT Licensed
set -eu set -eu

View file

@ -1,11 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Run jekyll serve and then launch the site # Run jekyll serve and then launch the site
#
# v2.6.1
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
bundle exec jekyll s -H 0.0.0.0 -l bundle exec jekyll s -H 0.0.0.0 -l

View file

@ -1,15 +1,10 @@
#!/bin/bash #!/usr/bin/env bash
# #
# Using HTML-proofer to test site. # Using HTML-proofer to test site.
# #
# Requirement: https://github.com/gjtorikian/html-proofer # Requirement: https://github.com/gjtorikian/html-proofer
# #
# Usage: bash /path/to/test.sh [indicated path] # Usage: bash /path/to/test.sh [indicated path]
#
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
DEST=_site DEST=_site
URL_IGNORE=cdn.jsdelivr.net URL_IGNORE=cdn.jsdelivr.net