Joseph Hale's Technical Blog
0

Configure Feed

Select the types of activity you want to include in your feed.

Improve the copyrights of the assets

Cotes Chung (Jan 26, 2021, 8:24 PM +0800) 893db51f cbb3bd4b

+139 -342
+2 -7
404.html
··· 1 1 --- 2 - # The 404 page 3 - # v2.0 4 - # https://github.com/cotes2020/jekyll-theme-chirpy 5 - # © 2017-2019 Cotes Chung 6 - # MIT License 7 2 layout: page 8 3 title: "404: Page not found" 9 4 permalink: /404.html 10 5 11 - redirect_from: # part of site.sitemap_exclude 6 + redirect_from: 12 7 - /norobots/ 13 8 - /assets/ 14 9 - /tabs/ ··· 22 17 <div class="lead"> 23 18 <p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p> 24 19 <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> 25 - </div> 20 + </div>
+1 -6
_config.yml
··· 1 - # The Site Settings 2 - # v2.0 3 - # https://github.com/cotes2020/jekyll-theme-chirpy 4 - # © 2017-2019 Cotes Chung 5 - # MIT licensed 6 - 1 + # The Site Configuration 7 2 8 3 # jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md 9 4 # --------------------------
+1 -5
app.js
··· 1 1 --- 2 2 layout: compress 3 - # Chirpy v2.2 4 - # https://github.com/cotes2020/jekyll-theme-chirpy 5 - # © 2020 Cotes Chung 6 - # MIT Licensed 7 3 --- 8 4 9 5 /* Registering Service Worker */ 10 6 if('serviceWorker' in navigator) { 11 7 navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}'); 12 - }; 8 + };
-4
feed.xml
··· 1 1 --- 2 2 layout: compress 3 3 # Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2019 Cotes Chung 7 - # MIT License 8 4 --- 9 5 10 6 {% capture source %}
-5
index.html
··· 1 1 --- 2 2 layout: home 3 - 4 3 # Index page 5 - # v2.0 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2017-2019 Cotes Chung 8 - # MIT License 9 4 ---
+3 -2
package.json
··· 20 20 }, 21 21 "homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme", 22 22 "dependencies": { 23 - "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony", 24 23 "gulp": "^4.0.2", 25 24 "gulp-concat": "^2.6.1", 25 + "gulp-insert": "^0.5.0", 26 26 "gulp-rename": "^2.0.0", 27 - "gulp-uglify": "^3.0.2" 27 + "gulp-uglify": "^3.0.2", 28 + "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony" 28 29 } 29 30 }
+1 -6
robots.txt
··· 1 1 --- 2 - # The robots rules 3 - # v2.0 4 - # https://github.com/cotes2020/jekyll-theme-chirpy 5 - # © 2017-2019 Cotes Chung 6 - # MIT License 7 - layout: null 8 2 permalink: robots.txt 3 + # The robots rules 9 4 --- 10 5 11 6 User-agent: *
+1 -5
sw.js
··· 1 1 --- 2 2 layout: compress 3 - 4 - # Chirpy v2.2 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2020 Cotes Chung 7 - # MIT Licensed 3 + # PWA service worker 8 4 --- 9 5 10 6 self.importScripts('{{ "/assets/js/data/cache-list.js" | relative_url }}');
-4
_data/contact.yml
··· 1 1 # The contact options. 2 - # v2.3 3 - # https://github.com/cotes2020/jekyll-theme-chirpy 4 - # © 2020 Cotes Chung 5 - # MIT Licensed 6 2 7 3 - 8 4 type: github
-5
_data/date_format.yml
··· 1 1 # The date format 2 - # v2.1 3 - # https://github.com/cotes2020/jekyll-theme-chirpy 4 - # © 2020 Cotes Chung 5 - # MIT Licensed 6 - 7 2 8 3 tooltip: "%a, %b %e, %Y, %l:%M %p %z" 9 4
-4
_data/label.yml
··· 1 1 # The label text of site. 2 - # v2.0 3 - # https://github.com/cotes2020/jekyll-theme-chirpy 4 - # © 2017-2019 Cotes Chung 5 - # MIT Licensed 6 2 7 3 panel: 8 4 lastmod: Recent Update
-3
_data/meta.yml
··· 1 - name: Chirpy 2 - version: 2.7.2 3 - homepage: https://github.com/cotes2020/jekyll-theme-chirpy/
+2 -8
_data/rights.yml
··· 1 - # License data. 2 - # 3 - # v2.1 4 - # https://github.com/cotes2020/jekyll-theme-chirpy 5 - # © 2020 Cotes Chung 6 - # MIT Licensed 7 - 1 + # License data 8 2 9 3 license: 10 4 name: CC BY 4.0 ··· 14 8 15 9 verbose: >- 16 10 Except where otherwise noted, the blog posts on this site are licensed 17 - under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author. 11 + under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
-5
_data/share.yml
··· 1 1 # Sharing options at the bottom of the post. 2 2 # Icons from <https://fontawesome.com/> 3 - # 4 - # v2.1 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2020 Cotes Chung 7 - # MIT Licensed 8 3 9 4 platforms: 10 5 -
-4
_includes/css-selector.html
··· 1 1 <!-- 2 2 CSS selector for site. 3 - Chirpy v2.3 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2020 Cotes Chung 6 - MIT Licensed 7 3 --> 8 4 9 5 <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
-4
_includes/disqus.html
··· 1 1 <!-- 2 2 The Disqus lazy loading. 3 3 Powered by: <https://github.com/osvaldasvalutis/disqusLoader.js> 4 - v2.0 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2019 Cotes Chung 7 - MIT License 8 4 --> 9 5 10 6 <div id="disqus" class="pt-2 pb-2">
-4
_includes/favicons.html
··· 1 1 <!-- 2 2 The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps 3 3 Generated by: https://www.favicon-generator.org/ 4 - v2.0 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2019 Cotes Chung 7 - Published under the MIT license 8 4 --> 9 5 10 6 {% capture icon_url %}{{ site.baseurl }}/assets/img/favicons{% endcapture %}
-4
_includes/footer.html
··· 1 1 <!-- 2 2 The Footer 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 9 5 <footer class="d-flex w-100 justify-content-center">
-4
_includes/google-analytics.html
··· 1 1 <!-- 2 2 The GA snippet 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 <!-- Global site tag (gtag.js) - Google Analytics --> 9 5 <script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>
-5
_includes/head.html
··· 1 1 <!-- 2 2 The Head 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 9 5 <head> 10 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 11 7 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 12 - <meta name="theme" content="{{ site.data.meta.name }} v{{ site.data.meta.version }}"> 13 8 14 9 {% if page.layout == 'home' or page.layout == 'post' %} 15 10 <meta name="pv-cache-enabled" content="{{ site.google_analytics.pv.enabled }}">
-4
_includes/js-selector.html
··· 1 1 <!-- 2 2 JS selector for site. 3 - Chirpy v2.3 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2020 Cotes Chung 6 - MIT Licensed 7 3 --> 8 4 9 5 {% if page.layout == 'home' or page.layout == 'post' %}
+3 -1
_includes/lozad.html
··· 1 - <!-- image lazy load: https://github.com/ApoorvSaxena/lozad.js --> 1 + <!-- 2 + image lazy load: https://github.com/ApoorvSaxena/lozad.js 3 + --> 2 4 <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script> 3 5 4 6 <script type="text/javascript">
-5
_includes/mode-toggle.html
··· 1 1 <!-- 2 2 Switch the mode between dark and light. 3 - 4 - v2.1 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2020 Cotes Chung 7 - MIT License 8 3 --> 9 4 10 5 <i class="mode-toggle fas fa-adjust"></i>
-4
_includes/no-linenos.html
··· 1 1 {% comment %} 2 2 Remove the line number of the code snippet. 3 - v2.2 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2020 Cotes Chung 6 - Published under the MIT License 7 3 {% endcomment %} 8 4 9 5 {% assign content = include.content %}
-4
_includes/panel.html
··· 1 1 <!-- 2 2 The Pannel on right side (Desktop views) 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 9 5 <div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
-5
_includes/post-nav.html
··· 1 1 <!-- 2 2 Navigation buttons at the bottom of the post. 3 - 4 - v2.1 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2020 Cotes Chung 7 - MIT License 8 3 --> 9 4 10 5 <div class="post-navigation d-flex justify-content-between">
-5
_includes/post-paginator.html
··· 1 1 <!-- 2 2 The paginator for post list on HomgPage. 3 - 4 - v2.1 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2020 Cotes Chung 7 - MIT License 8 3 --> 9 4 10 5 <ul class="pagination mt-4 mb-0 pl-lg-2">
-5
_includes/post-sharing.html
··· 1 1 <!-- 2 2 Post sharing snippet 3 - 4 - v2.1 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2019 Cotes Chung 7 - Published under the MIT License 8 3 --> 9 4 10 5 <div class="share-wrapper">
-5
_includes/related-posts.html
··· 1 1 <!-- 2 2 Recommend the other 3 posts according to the tags and categories of the current post, 3 3 if the number is not enough, use the other latest posts to supplement. 4 - 5 - v2.0 6 - https://github.com/cotes2020/jekyll-theme-chirpy 7 - © 2019 Cotes Chung 8 - Published under the MIT License 9 4 --> 10 5 11 6 <!-- The total size of related posts -->
-4
_includes/search-loader.html
··· 1 1 <!-- 2 2 Jekyll Simple Search loader 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 9 5 {% capture result_elem %}
-4
_includes/search-results.html
··· 1 1 <!-- 2 2 The Search results 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 <div id="search-result-wrapper" class="d-flex justify-content-center unloaded"> 9 5 <div class="col-12 col-xl-11 post-content">
-4
_includes/sidebar.html
··· 1 1 <!-- 2 2 The Side Bar 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 8 4 9 5 <div id="sidebar" class="d-flex flex-column align-items-end">
-5
_includes/timeago.html
··· 1 1 <!-- 2 2 Date format snippet 3 - 4 - v2.4.1 5 - https://github.com/cotes2020/jekyll-theme-chirpy 6 - © 2020 Cotes Chung 7 - MIT License 8 3 --> 9 4 10 5 {% assign tooltip_df = site.data.date_format.tooltip | default: '%a, %b %e, %Y, %l:%M %p %z' %}
+1 -4
_includes/topbar.html
··· 1 1 <!-- 2 2 The Top Bar 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2017-2019 Cotes Chung 6 - MIT License 7 3 --> 4 + 8 5 <div id="topbar-wrapper" class="row justify-content-center topbar-down"> 9 6 <div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between"> 10 7 <span id="breadcrumb">
-4
_includes/trending-tags.html
··· 1 1 {% comment %} 2 2 The trending tags list 3 - v2.0 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2019 Cotes Chung 6 - MIT Licensed 7 3 {% endcomment %} 8 4 9 5 {% assign MAX = 10 %}
-4
_includes/update-list.html
··· 1 1 {% comment %} 2 2 Get the last 5 posts from lastmod list. 3 - v2.2 4 - https://github.com/cotes2020/jekyll-theme-chirpy 5 - © 2020 Cotes Chung 6 - MIT License 7 3 {% endcomment %} 8 4 9 5 {% assign MAX_SIZE = 5 %}
-5
_layouts/archives.html
··· 1 1 --- 2 2 layout: page 3 - 4 3 # The Archives of posts. 5 - # v2.0 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2017-2019 Cotes Chung 8 - # MIT License 9 4 --- 10 5 11 6
-5
_layouts/categories.html
··· 1 1 --- 2 2 layout: page 3 - 4 3 # All the Categories of posts 5 - # v2.0 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2017-2019 Cotes Chung 8 - # MIT License 9 4 --- 10 5 11 6
-3
_layouts/category.html
··· 1 1 --- 2 2 layout: page 3 3 # The Category layout 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # MIT Licensed 7 4 --- 8 5 9 6 <div id="page-category">
-4
_layouts/default.html
··· 1 1 --- 2 2 layout: compress 3 3 # Default layout 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2017-2019 Cotes Chung 7 - # MIT Licensed 8 4 --- 9 5 10 6 <!DOCTYPE html>
-4
_layouts/home.html
··· 1 1 --- 2 2 layout: page 3 3 # The Home page layout 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2017-2019 Cotes Chung 7 - # MIT Licensed 8 4 --- 9 5 10 6
-4
_layouts/page.html
··· 1 1 --- 2 2 layout: default 3 3 # The page layout 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2017-2019 Cotes Chung 7 - # MIT License 8 4 --- 9 5 10 6 <div class="row">
-4
_layouts/post.html
··· 1 1 --- 2 2 layout: default 3 3 # The posts' layout 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2017-2019 Cotes Chung 7 - # MIT Licensed 8 4 --- 9 5 10 6 <div class="row">
-4
_layouts/tag.html
··· 1 1 --- 2 2 layout: page 3 3 # The layout for Tag page 4 - # v2.0 5 - # https://github.com/cotes2020/jekyll-theme-chirpy 6 - # © 2017-2019 Cotes Chung 7 - # MIT Licensed 8 4 --- 9 5 10 6
-5
_layouts/tags.html
··· 1 1 --- 2 2 layout: page 3 - 4 3 # All the Tags of posts. 5 - # v2.0 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2017-2019 Cotes Chung 8 - # MIT License 9 4 --- 10 5 11 6 <div id="tags" class="d-flex flex-wrap ml-xl-2 mr-xl-2">
+3
_plugins/posts-lastmod-hook.rb
··· 1 + #!/usr/bin/env ruby 2 + # 1 3 # Check for changed posts 4 + 2 5 Jekyll::Hooks.register :posts, :post_init do |post| 3 6 4 7 commit_num = `git rev-list --count HEAD "#{ post.path }"`
+3 -4
_sass/jekyll-theme-chirpy.scss
··· 1 - /* 2 - * The main styles 1 + /*! 2 + * The styles for Jekyll theme Chirpy 3 3 * 4 - * v2.7.2 5 - * https://github.com/cotes2020/jekyll-theme-chirpy 4 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy) 6 5 * © 2021 Cotes Chung 7 6 * MIT Licensed 8 7 */
-6
_tabs/about.md
··· 2 2 title: About 3 3 icon: fas fa-info 4 4 order: 4 5 - 6 - # The About page 7 - # v2.0 8 - # https://github.com/cotes2020/jekyll-theme-chirpy 9 - # © 2017-2019 Cotes Chung 10 - # MIT License 11 5 --- 12 6 13 7
-53
tools/bump-version.sh
··· 1 - #!/usr/bin/env bash 2 - # 3 - # Bump latest version to file `_data/meta.yml` 4 - # 5 - # v2.5.1 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2020 Cotes Chung 8 - # Published under MIT License 9 - 10 - set -eu 11 - 12 - META_FILE="_data/meta.yml" 13 - 14 - bump() { 15 - _version_field="version: $1" 16 - 17 - if [[ ! -f $META_FILE ]]; then 18 - echo "name: Chirpy" > $META_FILE 19 - echo "$_version_field" >> $META_FILE 20 - echo "homepage: https://github.com/cotes2020/jekyll-theme-chirpy/" >> $META_FILE 21 - else 22 - sed -i "s/^version:.*/$_version_field/g" $META_FILE 23 - fi 24 - 25 - if [[ -n $(git status $META_FILE -s) ]]; then 26 - git add $META_FILE 27 - git commit -m "Bump version to $1" 28 - fi 29 - } 30 - 31 - _latest_tag="$(git describe --tags --abbrev=0)" 32 - 33 - echo "Input a version number (hint: latest version is ${_latest_tag:1})" 34 - 35 - read version 36 - 37 - if [[ $version =~ ^[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?$ ]]; then 38 - 39 - if git tag --list | egrep -q "^v$version$"; then 40 - echo "Error: version '$version' already exists" 41 - exit -1 42 - fi 43 - 44 - echo "Bump version to $version" 45 - bump "$version" 46 - 47 - echo "Create tag v$version" 48 - git tag "v$version" 49 - 50 - else 51 - 52 - echo "Error: Illegal version number: '$version'" 53 - fi
+75
tools/bump.sh
··· 1 + #!/usr/bin/env bash 2 + # 3 + # Bump latest version to 4 + # - _sass/jekyll-theme-chirpy.scss 5 + # - assets/js/_commons/_copyright.js 6 + # - assets/js/dist/*.js 7 + # - jekyll-theme-chirpy.gemspec 8 + # 9 + # Required: gulp 10 + 11 + set -eu 12 + 13 + ASSETS=( 14 + "_sass/jekyll-theme-chirpy.scss" 15 + "assets/js/.copyright" 16 + ) 17 + 18 + GEM_SPEC="jekyll-theme-chirpy.gemspec" 19 + 20 + bump_assets() { 21 + _version="$1" 22 + for i in ${!ASSETS[@]}; do 23 + sed -i "s/v[[:digit:]]\.[[:digit:]]\.[[:digit:]]/v$_version/" ${ASSETS[$i]} 24 + done 25 + 26 + gulp 27 + } 28 + 29 + bump_gemspec() { 30 + _version="$1" 31 + sed -i "s/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/$_version/" $GEM_SPEC 32 + } 33 + 34 + bump() { 35 + bump_assets $1 36 + bump_gemspec $1 37 + 38 + if [[ -n $(git status . -s) ]]; then 39 + git add . 40 + git commit -m "Bump version to $1" 41 + fi 42 + } 43 + 44 + main() { 45 + if [[ -n $(git status . -s) ]]; then 46 + echo "Warning: commit unstaged files first, and then run this tool againt." 47 + exit -1 48 + fi 49 + 50 + _latest_tag="$(git describe --tags --abbrev=0)" 51 + 52 + echo "Input a version number (hint: latest version is ${_latest_tag:1})" 53 + 54 + read _version 55 + 56 + if [[ $_version =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]$ ]]; then 57 + 58 + if git tag --list | egrep -q "^v$_version$"; then 59 + echo "Error: version '$_version' already exists" 60 + exit -1 61 + fi 62 + 63 + echo "Bump version to $_version" 64 + bump "$_version" 65 + 66 + echo "Create tag v$_version" 67 + git tag "v$_version" 68 + 69 + else 70 + 71 + echo "Error: Illegal version number: '$_version'" 72 + fi 73 + } 74 + 75 + main
+1 -6
tools/deploy.sh
··· 1 - #!/bin/bash 1 + #!/usr/bin/env bash 2 2 # 3 3 # Deploy the content of _site to 'origin/<pages_branch>' 4 - # 5 - # v2.5 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2020 Cotes Chung 8 - # Published under MIT License 9 4 10 5 set -eu 11 6
+1 -6
tools/init.sh
··· 1 - #!/bin/bash 1 + #!/usr/bin/env bash 2 2 # 3 3 # Init the evrionment for new user. 4 - # 5 - # v2.5 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2020 Cotes Chung 8 - # Published under MIT License 9 4 10 5 set -eu 11 6
+1 -7
tools/pv.sh
··· 1 - #!/bin/bash 1 + #!/usr/bin/env bash 2 2 # 3 3 # Fetch Google Analytics Pageviews reporting cache 4 4 # and save as 'assets/data/pagevies.json' ··· 6 6 # Requirement: 7 7 # - jq 8 8 # - wget 9 - # 10 - # v2.0 11 - # https://github.com/cotes2020/jekyll-theme-chirpy 12 - # © 2019 Cotes Chung 13 - # MIT Licensed 14 - 15 9 16 10 set -eu 17 11
-6
tools/run.sh
··· 1 1 #!/usr/bin/env bash 2 2 # 3 3 # Run jekyll serve and then launch the site 4 - # 5 - # v2.6.1 6 - # https://github.com/cotes2020/jekyll-theme-chirpy 7 - # © 2020 Cotes Chung 8 - # MIT Licensed 9 4 10 5 bundle exec jekyll s -H 0.0.0.0 -l 11 -
+1 -6
tools/test.sh
··· 1 - #!/bin/bash 1 + #!/usr/bin/env bash 2 2 # 3 3 # Using HTML-proofer to test site. 4 4 # 5 5 # Requirement: https://github.com/gjtorikian/html-proofer 6 6 # 7 7 # Usage: bash /path/to/test.sh [indicated path] 8 - # 9 - # v2.0 10 - # https://github.com/cotes2020/jekyll-theme-chirpy 11 - # © 2020 Cotes Chung 12 - # MIT Licensed 13 8 14 9 DEST=_site 15 10 URL_IGNORE=cdn.jsdelivr.net
+5
assets/js/.copyright
··· 1 + /*! 2 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) 3 + * © 2021 Cotes Chung 4 + * MIT Licensed 5 + */
+8 -6
gulpfile.js/tasks/js.js
··· 7 7 const concat = require('gulp-concat'); 8 8 const rename = require("gulp-rename"); 9 9 const uglify = require('gulp-uglify'); 10 + const insert = require('gulp-insert'); 11 + const fs = require('fs'); 10 12 11 13 const JS_ROOT = './assets/js'; 12 14 const jsDest = `${ JS_ROOT }/dist/`; 15 + const copyrightPath = `${ JS_ROOT }/.copyright`; 13 16 14 17 function concatJs(files, output) { 15 18 return src(files) ··· 20 23 21 24 function minifyJs() { 22 25 return src(`${ jsDest }/*.js`) 23 - .pipe(uglify()) 26 + .pipe(insert.prepend(fs.readFileSync(copyrightPath, 'utf8'))) 27 + .pipe(uglify({output: {comments: /^!|@preserve|@license|@cc_on/i}})) 24 28 .pipe(dest(jsDest)); 25 29 } 26 30 ··· 63 67 64 68 // GA pageviews report 65 69 const pvreportJs = () => { 66 - return concatJs([ 67 - `${JS_ROOT}/_utils/pageviews.js` 68 - ], 'pvreport' 69 - ); 70 + return concatJs(`${JS_ROOT}/_utils/pageviews.js`, 'pvreport'); 70 71 }; 71 72 72 73 const buildJs = parallel(homeJs, postJs, categoriesJs, pageJs, pvreportJs); ··· 78 79 79 80 watch([ 80 81 `${ JS_ROOT }/_commons/*.js`, 81 - `${ JS_ROOT }/_utils/*.js` 82 + `${ JS_ROOT }/_utils/*.js`, 83 + `${ JS_ROOT }/lib/*.js` 82 84 ], 83 85 buildJs 84 86 )
-4
assets/js/_commons/copy-link.js
··· 1 1 /* 2 2 * Copy current page url to clipboard. 3 - * v2.1 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2020 Cotes Chung 6 - * MIT License 7 3 */ 8 4 9 5 function copyLink(url) {
-4
assets/js/_commons/search-display.js
··· 1 1 /* 2 2 * This script make #search-result-wrapper switch to unloaded or shown automatically. 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2018-2019 Cotes Chung 6 - * MIT License 7 3 */ 8 4 9 5 $(function() {
-4
assets/js/_commons/sidebar.js
··· 1 1 /** 2 2 * Expand or close the sidebar in mobile screens. 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2018-2019 Cotes Chung 6 - * MIT License 7 3 */ 8 4 9 5 $(function() {
-4
assets/js/_commons/tooltip-loader.js
··· 1 1 /** 2 2 * Initial Bootstrap Tooltip. 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2019 Cotes Chung 6 - * MIT License 7 3 */ 8 4 $(function () { 9 5 $("[data-toggle=\"tooltip\"]").tooltip();
-4
assets/js/_commons/topbar-switch.js
··· 1 1 /* 2 2 * Hide Header on scroll down 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2018-2019 Cotes Chung 6 - * MIT License 7 3 */ 8 4 9 5 $(function() {
-4
assets/js/_commons/topbar-title.js
··· 1 1 /* 2 2 * Top bar title auto change while scrolling in mobile screens. 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2018-2019 Cotes Chung 6 - * MIT License 7 3 */ 8 4 9 5 $(function() {
-4
assets/js/_utils/category-collapse.js
··· 1 1 /* 2 2 * Tab 'Categories' expand/close effect. 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2018-2019 Cotes Chung 6 - * MIT License 7 3 */ 8 4 9 5 $(function() {
-5
assets/js/_utils/img-hyperlink.js
··· 1 1 /* 2 2 * Find out the <a> tag contains an image and mark it. 3 - * 4 - * v2.5.1 5 - * https://github.com/cotes2020/jekyll-theme-chirpy 6 - * © 2020 Cotes Chung 7 - * MIT Licensed 8 3 */ 9 4 10 5 $(function() {
+1 -6
assets/js/_utils/pageviews.js
··· 1 - /** 1 + /* 2 2 * Count page views form GA or local cache file. 3 3 * 4 4 * Dependencies: 5 5 * - jQuery 6 6 * - countUp.js <https://github.com/inorganik/countUp.js> 7 - * 8 - * v2.0 9 - * https://github.com/cotes2020/jekyll-theme-chirpy 10 - * © 2018-2019 Cotes Chung 11 - * MIT License 12 7 */ 13 8 14 9 const getInitStatus = (function () {
-4
assets/js/_utils/timeago.js
··· 1 1 /* 2 2 * Calculate the Timeago 3 - * v2.0 4 - * https://github.com/cotes2020/jekyll-theme-chirpy 5 - * © 2019 Cotes Chung 6 - * MIT Licensed 7 3 */ 8 4 9 5 $(function() {
+5
assets/js/dist/categories.min.js
··· 1 + /*! 2 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) 3 + * © 2021 Cotes Chung 4 + * MIT Licensed 5 + */ 1 6 function copyLink(e){e&&0!==e.length||(e=window.location.href);const o=$("<input>");$("body").append(o),o.val(e).select(),document.execCommand("copy"),o.remove(),alert("Link copied successfully!")}$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$("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"))})});
+5
assets/js/dist/home.min.js
··· 1 + /*! 2 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) 3 + * © 2021 Cotes Chung 4 + * MIT Licensed 5 + */ 1 6 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))});
+5
assets/js/dist/page.min.js
··· 1 + /*! 2 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) 3 + * © 2021 Cotes Chung 4 + * MIT Licensed 5 + */ 1 6 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()})}}})});
+5
assets/js/dist/post.min.js
··· 1 + /*! 2 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) 3 + * © 2021 Cotes Chung 4 + * MIT Licensed 5 + */ 1 6 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"),n=$("#topbar-title"),l=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#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||(r.removeClass("unloaded"),a.addClass("hidden"),e=!0,u.block())},off(){e&&(i.empty(),d.hasClass("unloaded")&&d.removeClass("unloaded"),r.addClass("unloaded"),s.removeClass("visible"),a.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(),s.hasClass("visible")||s.addClass("visible"),p()&&d.addClass("unloaded"))}),s.on("click",function(){c.val(""),p()?(d.removeClass("unloaded"),i.empty()):f.off(),c.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,n=0;const l=5,r=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(a=!0)}),setInterval(function(){a&&(!function(){var a=$(this).scrollTop();Math.abs(n-a)<=l||(a>n&&a>r?(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")),n=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(){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"),s=o.text();$(this).text(function(t,o){let s=new Date,a=new Date(t);if(a.getFullYear()!==s.getFullYear())return e-=1,a.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric"});if(a.getMonth()!==s.getMonth())return e-=1,a.toLocaleString("en-US",{month:"short",day:"numeric"});let n=Math.floor((s-a)/1e3),l=Math.floor(n/86400);if(l>=1)return e-=1,l+" day"+(l>1?"s":"")+" ago";let r=Math.floor(n/3600);if(r>=1)return r+" hour"+(r>1?"s":"")+" ago";let i=Math.floor(n/60);return i>=1?i+" minute"+(i>1?"s":"")+" ago":(o?"just":"Just")+" now"}(s,t)),$(this).append(o)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&o()>0&&(t=setInterval(o,6e4))}),$(function(){$("a:has(img)").addClass("img-hyperlink")}),$(function(){const e=new RegExp("^language-([a-z])+$");$("div[class^=language-").each(function(){$(this).attr("class").split(" ").forEach(t=>{if(e.test(t)){let e=t.substring("language-".length);$(this).attr("lang",`${e}`)}})})}),$(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),n=o.includes(":")?o.replace(/\:/,"\\:"):o,l=$(n);if(l.length){e.preventDefault(),history.pushState&&history.pushState(null,null,o);let n=$(this).offset().top,r=l.offset().top;const i=r<n,c=$("#topbar-wrapper").outerHeight();i&&s&&(r-=c+t/2),$("html,body").animate({scrollTop:r},800,()=>{const e=$(l);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()})}}})});
+5
assets/js/dist/pvreport.min.js
··· 1 + /*! 2 + * Chirpy v2.7.2 (https://github.com/cotes2020/jekyll-theme-chirpy/) 3 + * © 2021 Cotes Chung 4 + * MIT Licensed 5 + */ 1 6 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()}});