1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 13:44:15 +00:00

Compare commits

..

63 Commits

Author SHA1 Message Date
Cotes Chung
493e1d934b Bump version to 2.7.2 2020-12-31 22:54:58 +08:00
Cotes Chung
b9104d0f4c Upgrade dependencies in Gemfile.lock 2020-12-31 22:38:30 +08:00
Cotes Chung
3c72298563 Improve the smooth scrolling
- Add smooth scrolling to the footnotes
- Add hash to URL
2020-12-31 21:37:17 +08:00
Henk van Achterberg
ca2194770c Update pages-deploy.yml.hook (#229)
This change will make the baseurl configuration/testing work. Previous version failed. Posts should have /index.html as suffix in my experience.
2020-12-30 22:22:42 +08:00
Cotes Chung
08fbd06c63 Optimize the DOM of post link on homepage 2020-12-29 15:39:29 +08:00
Dinesh Prasanth M K
a20fd5bf6f Fix the dir name for hosting posts 2020-12-29 06:06:36 +08:00
Cotes Chung
7a88347c63 Remove inline code extra content 2020-12-28 19:38:24 +08:00
Cotes Chung
813443b206 Improve GitHub stuff
- Add more events to the issue interceptor
- Reduce issue label
2020-12-28 02:33:06 +08:00
Cotes Chung
c381353f86 Use liquid to determine whether to render ToC 2020-12-28 02:30:32 +08:00
Cotes Chung
aa6c33526a Fix the compatibility of the smooth scrolling in Safari
Safari(at least on v14) does not support CSS property `scroll-behavior`
2020-12-28 02:28:57 +08:00
Cotes Chung
081e77d462 Bump version to 2.7.1 2020-12-26 00:45:16 +08:00
Cotes Chung
bca7a2a634 Update docs
-  Add description list sample
-  Improve doc content
2020-12-26 00:41:06 +08:00
Cotes Chung
505da84a26 Fix the position of the table scroll bar 2020-12-26 00:41:06 +08:00
Cotes Chung
dfba411d61 Jump to the anchor position smoothly 2020-12-26 00:41:06 +08:00
Cotes Chung
fa310d3190 Optimize typography
- Set the table width to 100% on small screens
- Optimize list style
- Optimize image style
- Make checkbox color lighter (light mode)
- Reduce the space for inline code
2020-12-26 00:41:06 +08:00
Cotes Chung
ef0c9ce770 Simplify sidebar style
Avoid element shifting when rendering
2020-12-26 00:41:06 +08:00
Cotes Chung
7429ef3539 Fix the Jekyll minimum version requirement
Starting from Jekyll v4.1.0, the filter `number_of_words` accepts optional parameters to handle CKJ characters
2020-12-21 23:50:54 +08:00
Cotes Chung
6d4abcc437 Stop local HTML compression 2020-12-21 23:50:54 +08:00
Cotes Chung
5bdea71622 Bump version to 2.7.0 2020-12-19 00:49:31 +08:00
Cotes Chung
8e0004146b Improve CSS selector for image 2020-12-19 00:18:30 +08:00
Cotes Chung
557413cc4c Simplify the image custom class statement 2020-12-19 00:18:30 +08:00
Cotes Chung
6dc6f2a7cf Improve code style 2020-12-18 21:05:47 +08:00
Cotes Chung
8e5d8b8931 Feature: display the language of code snippets 2020-12-18 20:52:39 +08:00
Cotes Chung
260a906b11 Optimize code snippet background color 2020-12-18 20:24:14 +08:00
Cotes Chung
5ffbfaec26 Beautify the pin label on home page 2020-12-17 15:30:49 +08:00
Cotes Chung
b9ffe15ffb Feature: Add reading time to posts 2020-12-17 15:30:49 +08:00
Cotes Chung
87ba30a393 Hire a new bot to deal with the issues 2020-12-17 14:33:52 +08:00
Cotes Chung
cb984aa021 Simplify checkbox with fontawesome icon 2020-12-15 15:20:40 +08:00
Cotes Chung
0225d28fd3 Beautify shape and color of checkbox 2020-12-15 00:39:50 +08:00
Cotes Chung
aba3d25d7a Always load browser default checkbox 2020-12-15 00:39:50 +08:00
Cotes Chung
dc88321ed5 Improve image style (#204) 2020-12-15 00:39:50 +08:00
Cotes Chung
cc24af11fc Revert "Improve image style (#204)"
This reverts commit 07d29ec9bf.
2020-12-14 14:02:32 +08:00
Cotes Chung
d70354021c Make table horizontal scroll (#206) 2020-12-14 02:13:31 +08:00
Cotes Chung
d61446fafc Create a more beautiful checkbox
The browser's default checkbox is too ugly, especially in dark mode
2020-12-14 02:13:31 +08:00
Cotes Chung
d0a8d072fd Add checkbox demo 2020-12-14 00:20:56 +08:00
Cotes Chung
9d59461632 Reduce the frequency of error reporting
The project maintainer determines whether it is a bug
2020-12-13 20:36:26 +08:00
Cotes Chung
cea339088b Improve the checkbox style (#207)
Hotfix: the solution of #203 will affect the layout `archives`
2020-12-13 01:45:52 +08:00
Cotes Chung
07d29ec9bf Improve image style (#204) 2020-12-13 00:43:19 +08:00
Alexandra Zaharia
464fa001b2 Add checkbox style to remove bogus rendered bullet (#203) 2020-12-13 00:35:45 +08:00
Cotes Chung
53a98feff3 Update pwa cache list 2020-12-11 23:08:57 +08:00
Cotes Chung
b8ee5a7b0c Fix underscores in the links of tags/categories (#199) 2020-12-11 23:05:36 +08:00
Cotes Chung
289ce1263d Fix detection of mermaid objects 2020-12-11 02:20:18 +08:00
Cotes Chung
63f57fbc12 Delay GA loading 2020-12-10 23:57:48 +08:00
Cotes Chung
cdaa79cf80 Improve JS loading sequence 2020-12-10 20:13:03 +08:00
Cotes Chung
d53769e52b Improve the dark-mode color of the italics in code snippet 2020-12-10 20:13:03 +08:00
Cotes Chung
7de13415e7 Update README & improve manual 2020-12-10 20:13:03 +08:00
Cotes Chung
d196645d88 Introduce the mermaid in docs 2020-12-10 06:39:03 +08:00
Cotes Chung
4d2f13c0d7 Integrate with mermaid-js 2020-12-10 05:00:01 +08:00
Cotes Chung
5ed39300cb Add gitattributes 2020-12-08 13:49:12 +08:00
Cotes Chung
d7d3bc9947 Simplify site config 2020-12-08 13:49:12 +08:00
Cotes Chung
cf3943342a Update the minimum version requirements of Jekyll
Jekyll allow custom sorting of collection documents from 4.x
2020-12-07 19:51:30 +08:00
Cotes Chung
59deef469d Improve travis config. 2020-12-07 02:19:50 +08:00
Cotes Chung
bb13b52d44 Simplify theme-mode config 2020-12-07 01:14:40 +08:00
Cotes Chung
8d4c555638 Fix gh-actions cache not being hit issue (#191) 2020-12-07 00:10:15 +08:00
Cotes Chung
cbf707dc56 Update runner tool
allow LAN access Jekyll
2020-12-06 14:17:41 +08:00
Cotes Chung
6335991164 Avoid mode switch button shifting 2020-12-06 14:09:47 +08:00
Cotes Chung
5d6014ecee Regular improvement for liquid code 2020-12-05 02:44:28 +08:00
Cotes Chung
13aca77275 Change mode-toggle icon 2020-12-05 01:40:01 +08:00
Cotes Chung
1172f1646d Restore the archive-title that was deleted by mistake 2020-12-04 14:45:17 +08:00
Cotes Chung
e27825d3eb Improve JS/CSS selector
Separate layout from tabs, and more friendly to tabs rename (#187)
2020-12-04 14:18:25 +08:00
Cotes Chung
36c4f32b17 Fix yaml syntax of workflow 2020-12-02 18:40:06 +08:00
Cotes Chung
6a326dc8e0 Improve the interceptor action
Avoid secondary runs
2020-11-30 22:04:52 +08:00
Cotes Chung
20c14c0207 Fix & rename CN version README 2020-11-30 22:04:52 +08:00
63 changed files with 1329 additions and 820 deletions

16
.gitattributes vendored Normal file
View File

@@ -0,0 +1,16 @@
# Set default behavior to automatically normalize line endings.
* text=auto
# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.ico binary

View File

@@ -1,7 +1,6 @@
---
name: Bug Report
about: Create a report to help us improve
labels: bug
---
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->

17
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
# Clean up the stale issues
daysUntilStale: 30
daysUntilClose: 1
exemptLabels:
- in progress
- pending
staleLabel: stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
closeComment: false

View File

@@ -36,13 +36,13 @@ jobs:
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.7
- name: Bundle Caching
uses: actions/cache@v2
with:
path: ${{ env.GEMS_PATH }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-

View File

@@ -1,16 +1,20 @@
name: "Intercept bad issue/PRs"
on: [issues, pull_request]
on:
issues:
types: [opened, reopened]
pull_request:
types: [opened, reopened]
jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: Autoclose issues that did not follow issue template
- name: Auto close issues/pr that did not follow template
uses: roots/issue-closer@v1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-pattern: "\\[x\\] I have read"
issue-close-message: "Hi @${issue.user.login} :wave:,\n\nThis issue is being automatically closed because it does not follow the issue template."
issue-close-message: ":wave: Hi @${issue.user.login},\n\nThis issue is being automatically closed because it does not follow the issue template."
pr-pattern: "\\[x\\] Bug|\\[x\\] New feat|\\[x\\] Break|\\[x\\] Doc"
pr-close-message: "Hi @${pull_request.user.login} :wave:,\n\nThis PR is being automatically closed because it does not follow the PR template."
pr-close-message: ":wave: Hi @${pull_request.user.login},\n\nThis PR is being automatically closed because it does not follow the PR template."

View File

@@ -25,13 +25,13 @@ jobs:
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 2.7
- name: Bundle Caching
uses: actions/cache@v2
with:
path: ${{ env.GEMS_PATH }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
@@ -44,28 +44,25 @@ jobs:
run: |
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
if [[ -n $baseurl ]]; then
echo "SPEC_TEST=_site_no_baseurl" >> $GITHUB_ENV
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
fi
- name: Build Site
env:
JEKYLL_ENV: production
run: |
bundle exec jekyll b
if [[ -n $SPEC_TEST ]]; then
# Bypass the defects of htmlproofer
bundle exec jekyll b -b "" -d "$SPEC_TEST"
fi
bundle exec jekyll b -d "_site$BASE_URL"
- name: Test Site
run: |
if [[ -n $SPEC_TEST ]]; then
bash tools/test.sh -d "$SPEC_TEST"
else
bash tools/test.sh
fi
bash tools/test.sh
- name: Deploy
run: |
if [[ -n $BASE_URL ]]; then
mv _site$BASE_URL _site-rename
rm -rf _site
mv _site-rename _site
fi
bash tools/deploy.sh

1
.gitignore vendored
View File

@@ -4,5 +4,4 @@
# jekyll cache
_site
Gemfile.lock
vendor

View File

@@ -2,13 +2,9 @@ os: linux
dist: bionic
language: ruby
rvm: 2.6.5
rvm: 2.7.0
before_install:
- bundle config path 'vendor/bundle'
install:
- bundle install --quiet
cache: bundler
addons:
apt:
@@ -25,10 +21,6 @@ branches:
git:
depth: false # for posts lastmod
cache:
directories:
- $TRAVIS_BUILD_DIR/vendor/bundle
notifications:
email:
recipients:

View File

@@ -1,18 +1,18 @@
source "https://rubygems.org"
gem "jekyll", ">= 3.8.6", "< 5.0"
gem "jekyll", ">= 4.1.0", "< 5.0"
# plugins
group :jekyll_plugins do
gem "jekyll-paginate"
gem "jekyll-redirect-from"
gem "jekyll-seo-tag", "~> 2.6.1"
gem "jekyll-seo-tag"
gem "jekyll-archives"
gem "jekyll-sitemap"
end
group :test do
gem "html-proofer", "~> 3.16.0"
gem "html-proofer"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem

111
Gemfile.lock Normal file
View File

@@ -0,0 +1,111 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
ffi (1.14.2)
forwardable-extended (2.6.0)
html-proofer (3.18.3)
addressable (~> 2.3)
mercenary (~> 0.3)
nokogumbo (~> 2.0)
parallel (~> 1.3)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jekyll (4.2.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-archives (2.2.1)
jekyll (>= 3.6, < 5.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.3.3)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
mini_portile2 (2.4.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogumbo (2.0.4)
nokogiri (~> 1.8, >= 1.8.4)
parallel (1.20.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rainbow (3.0.0)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.4)
rouge (3.26.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo-data (1.2020.6)
tzinfo (>= 1.0.0)
unicode-display_width (1.7.0)
wdm (0.1.1)
yell (2.2.2)
PLATFORMS
ruby
DEPENDENCIES
html-proofer
jekyll (>= 4.1.0, < 5.0)
jekyll-archives
jekyll-paginate
jekyll-redirect-from
jekyll-seo-tag
jekyll-sitemap
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.1)
BUNDLED WITH
2.1.4

View File

@@ -1,6 +1,6 @@
# Chirpy
Language: English | [简体中文](docs/README_zh-CN.md)
Language: English | [简体中文](docs/README.zh-CN.md)
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?branch=master&event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8220b926db514f13afc3f02b7f884f4b)](https://app.codacy.com/manual/cotes2020/jekyll-theme-chirpy?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade_Dashboard)
@@ -31,6 +31,7 @@ A minimal, sidebar, responsive web design Jekyll theme that focuses on text pres
- Automatically recommend related posts
- Syntax highlighting
- Mathematical expressions
- Mermaid diagram & flowchart
- Search
- Atom Feeds
- Disqus Comments

View File

@@ -6,7 +6,7 @@
# jekyll-seo-tag settings https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
#--------------------------
# --------------------------
title: Chirpy # the main title
tagline: A text-focused Jekyll theme. # it will display as the sub-title
@@ -41,7 +41,7 @@ social:
# - https://www.linkedin.com/in/username
google_site_verification: google_meta_tag_verification # change to your verification string
#--------------------------
# --------------------------
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
@@ -67,31 +67,29 @@ disqus:
shortname: '' # Fill with your Disqus shortname. https://help.disqus.com/en/articles/1717111-what-s-a-shortname
# Prefer color scheme setting, available values:
# Prefer color scheme setting.
#
# dual - Follow the system prefer color by default, and a toggle will display
# in the left bottom of Sidebar, which used for switch the theme between dark and light.
# Note: Keep empty will follow the system prefer color by default,
# and there will be a toggle to switch the theme between dark and light
# on the bottom left of the sidebar.
#
# Available options:
#
# light - Use the light color scheme
#
# dark - Use the dark color scheme
#
theme_mode: dual
theme_mode: # <light|dark>
# boolean type, the global switch for ToC in posts.
toc: true
paginate: 10
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
syntax_highlighter: rouge
syntax_highlighter_opts: # Rouge Options https://github.com/jneen/rouge#full-options
css_class: 'highlight'
syntax_highlighter_opts: # Rouge Options https://github.com/jneen/rouge#full-options
css_class: highlight
# default_lang: console
span:
line_numbers: false
@@ -179,7 +177,7 @@ compress_html:
profile: false
blanklines: false
ignore:
envs: []
envs: [development]
exclude:
- vendor
@@ -196,5 +194,5 @@ jekyll-archives:
category: category
tag: tag
permalinks:
tag: '/tags/:name/'
category: '/categories/:name/'
tag: /tags/:name/
category: /categories/:name/

View File

@@ -4,16 +4,17 @@
# © 2017-2019 Cotes Chung
# MIT Licensed
panel:
lastmod: "Recent Update"
trending_tags: "Trending Tags"
toc: "Contents"
lastmod: Recent Update
trending_tags: Trending Tags
toc: Contents
post:
relate_posts: "Further Reading"
relate_posts: Further Reading
button:
next: Newer
previous: Older
search_hint: "Search" # text show on search bar
search_hint: Search # text show on search bar
pin_prompt: Pinned # pinned prompt

View File

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

7
_data/read_time.yml Normal file
View File

@@ -0,0 +1,7 @@
# words per minute
wpm: 180
# minimum value
min_time: 1
prompt: min

View File

@@ -6,50 +6,21 @@
MIT Licensed
-->
{% if page.layout == 'home' %}
<link rel="preload" href="{{ '/assets/css/home.css' | relative_url }}" as="style">
<link rel="stylesheet" href="{{ '/assets/css/home.css' | relative_url }}">
{% elsif page.layout == 'page' %}
{% if page.layout == 'category' or page.layout == 'tag' %}
{% assign style = 'category-tag' %}
{% else %}
{% assign style = page.layout %}
{% endif %}
{% if page.collection == 'tabs' and page.title != 'About' %}
{% assign src = style | prepend: '/assets/css/' | append: '.css' | relative_url %}
{% if page.title == 'Categories' %}
<link rel="preload" href="{{ '/assets/css/categories.css' | relative_url }}" as="style">
<link rel="stylesheet" href="{{ '/assets/css/categories.css' | relative_url }}">
{% elsif page.title == 'Tags' %}
<link rel="preload" href="{{ '/assets/css/tags.css' | relative_url }}" as="style">
<link rel="stylesheet" href="{{ '/assets/css/tags.css' | relative_url }}">
{% elsif page.title == 'Archives'%}
<link rel="preload" href="{{ '/assets/css/archives.css' | relative_url }}" as="style">
<link rel="stylesheet" href="{{ '/assets/css/archives.css' | relative_url }}">
{% endif %}
{% else %}
<link rel="preload" href="{{ '/assets/css/page.css' | relative_url }}" as="style">
<link rel="stylesheet" href="{{ '/assets/css/page.css' | relative_url }}">
{% endif %}
{% elsif page.layout == 'category' or page.layout == 'tag' %}
<link rel="preload" href="{{ '/assets/css/category-tag.css' | relative_url }}" as="style">
<link rel="stylesheet" href="{{ '/assets/css/category-tag.css' | relative_url }}">
{% elsif page.layout == 'post' %}
<link rel="preload" as="style" href="{{ '/assets/css/post.css' | relative_url }}">
<link rel="stylesheet" href="{{ '/assets/css/post.css' | relative_url }}">
<link rel="preload" href="{{ src }}" as="style">
<link rel="stylesheet" href="{{ src }}">
{% if page.layout == 'post' %}
{% if site.toc and page.toc %}
<link rel="preload" as="style" href="{{ '/assets/css/lib/bootstrap-toc.min.css' | relative_url }}">
<link rel="stylesheet" href="{{ '/assets/css/lib/bootstrap-toc.min.css' | relative_url }}" />
{% endif %}
{% endif %}

View File

@@ -6,11 +6,13 @@
MIT License
-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async 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>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
document.addEventListener("DOMContentLoaded", function(event) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics.id }}');
gtag('js', new Date());
gtag('config', '{{ site.google_analytics.id }}');
});
</script>

View File

@@ -61,7 +61,7 @@
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
<script async
<script defer
src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
{% include js-selector.html %}

View File

@@ -6,36 +6,29 @@
MIT Licensed
-->
{% if page.layout == 'home' %}
<script async src="{{ '/assets/js/home.min.js' | relative_url }}"></script>
{% elsif page.layout == 'post' %}
<script async src="{{ '/assets/js/post.min.js' | relative_url }}"></script>
{% if page.math %}
<!-- MathJax -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
{% endif %}
{% elsif page.layout == 'page' %}
{% if page.title == 'Categories' and page.collection == 'tabs' %}
<script async src="{{ '/assets/js/categories.min.js' | relative_url }}"></script>
{% else %}
<script async src="{{ '/assets/js/page.min.js' | relative_url }}"></script>
{% endif %}
{% if page.layout == 'home' or page.layout == 'post' or page.layout == 'categories' %}
{% assign js = page.layout %}
{% else %}
<script async src="{{ '/assets/js/page.min.js' | relative_url }}"></script>
{% assign js = "page" %}
{% endif %}
{% assign js_src = js | prepend: '/assets/js/' | append: '.min.js' | relative_url %}
<script async src="{{ js_src }}"></script>
{% if page.math %}
<!-- MathJax -->
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script defer src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
{% endif %}
{% if jekyll.environment == 'production' %}
<!-- PWA -->
<script defer src="{{ '/app.js' | relative_url }}"></script>
<!-- GA -->
{% if site.google_analytics.id %}
{% include google-analytics.html %}
{% endif %}
{% endif %}

28
_includes/mermaid.html Normal file
View File

@@ -0,0 +1,28 @@
<!--
mermaid-js loader
-->
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>
$(function() {
let initTheme = "default";
if ($("html[mode=dark]").length > 0
|| ($("html[mode]").length == 0
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
initTheme = "dark";
}
let mermaidConf = {
theme: initTheme /* <default|dark|forest|neutral> */
};
/* Markdown converts to HTML */
$("pre").has("code.language-mermaid").each(function() {
let svgCode = $(this).children().html();
$(this).addClass("unloaded");
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
});
mermaid.initialize(mermaidConf);
});
</script>

View File

@@ -7,8 +7,7 @@
MIT License
-->
<i class="mode-toggle fas fa-sun" dark-mode-invisible></i>
<i class="mode-toggle fas fa-moon" light-mode-invisible></i>
<i class="mode-toggle fas fa-adjust"></i>
<script type="text/javascript">
@@ -18,8 +17,8 @@
static get LIGHT_MODE() { return "light"; }
constructor() {
if (this.mode != null) {
if (this.mode == ModeToggle.DARK_MODE) {
if (this.hasMode) {
if (this.isDarkMode) {
if (!this.isSysDarkPrefer) {
this.setDark();
}
@@ -34,8 +33,8 @@
/* always follow the system prefers */
this.sysDarkPrefers.addListener(function() {
if (self.mode != null) {
if (self.mode == ModeToggle.DARK_MODE) {
if (self.hasMode) {
if (self.isDarkMode) {
if (!self.isSysDarkPrefer) {
self.setDark();
}
@@ -48,6 +47,8 @@
self.clearMode();
}
self.updateMermaid();
});
} /* constructor() */
@@ -80,6 +81,33 @@
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
/* get the current mode on screen */
get modeStatus() {
if (this.isDarkMode
|| (!this.hasMode && this.isSysDarkPrefer) ) {
return ModeToggle.DARK_MODE;
} else {
return ModeToggle.LIGHT_MODE;
}
}
updateMermaid() {
if (typeof mermaid !== "undefined") {
let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
let config = { theme: expectedTheme };
/* re-render the SVG <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
$(".mermaid").each(function() {
let svgCode = $(this).prev().children().html();
$(this).removeAttr("data-processed");
$(this).html(svgCode);
});
mermaid.initialize(config);
mermaid.init(undefined, ".mermaid");
}
}
flipMode() {
if (this.hasMode) {
if (this.isSysDarkPrefer) {
@@ -105,6 +133,8 @@
}
}
this.updateMermaid();
} /* flipMode() */
} /* ModeToggle */
@@ -112,7 +142,9 @@
let toggle = new ModeToggle();
$(".mode-toggle").click(function() {
toggle.flipMode();
});
</script>

View File

@@ -37,9 +37,9 @@
<span>{{- site.data.label.panel.trending_tags -}}</span>
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
{% for tag in trending_tags %}
{% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
{% for tag_name in trending_tags %}
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
{% endfor %}
</div>
@@ -47,13 +47,13 @@
{% endif %}
</div> <!-- .access -->
{% if page.layout == 'post' and site.toc and page.toc %}
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
<span class="pl-3 pt-2 mb-2">
{% if include.toc %}
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
<span class="pl-3 pt-2 mb-2">
{{- site.data.label.panel.toc -}}
</span>
<nav id="toc" data-toggle="toc"></nav>
</div>
</span>
<nav id="toc" data-toggle="toc"></nav>
</div>
{% endif %}
</div> <!-- #panel-wrapper -->

15
_includes/read-time.html Normal file
View File

@@ -0,0 +1,15 @@
<!--
Calculate the post's reading time, and display the word count in tooltip
-->
{% assign words = include.content | strip_html | number_of_words: "auto" %}
{% assign read_time = words | divided_by: site.data.read_time.wpm %}
{% unless read_time > 0 %}
{% assign read_time = site.data.read_time.min_time %}
{% endunless %}
<!-- return element -->
<span class="readtime" data-toggle="tooltip" data-placement="bottom" title="{{ words }} words">
{{- read_time -}}{{" "}}{{- site.data.read_time.prompt -}}
</span>

View File

@@ -5,23 +5,35 @@
{% assign _content = include.content %}
<!--
Suroundding the markdown table with '<div class="table-wrapper">. and '</div>'
In order to allow a wide table to scroll horizontally,
we suround the markdown table with `<div class="table-wrapper">` and `</div>`
-->
{% if _content contains '<table>' %}
{% assign _content = _content | replace: '<table>', '<div class="table-wrapper"><table>' %}
{% assign _content = _content | replace: '</table>', '</table></div>' %}
{% assign _content = _content | replace: '</table></div></code>', '</table></code>' %}
{% assign _content = _content
| replace: '<table>', '<div class="table-wrapper"><table>'
| replace: '</table>', '</table></div>'
| replace: '</table></div></code>', '</table></code>'
%}
{% endif %}
<!--
Fixed kramdown code highlight rendering:
https://github.com/penibelst/jekyll-compress-html/issues/101
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
-->
{% if _content contains '<pre class="highlight">' %}
{% assign _content = _content | replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code' %}
{% assign _content = _content | replace: '</code></pre></div>', '</code></div>' %}
{% assign _content = _content
| replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code'
| replace: '</code></pre></div>', '</code></div>'
%}
{% endif %}
<!-- Add attribute 'hide-bullet' to the checkbox list -->
{% if _content contains '<li class="task-list-item"><' %}
{% assign _content = _content
| replace: '"task-list-item"><', '"task-list-item" hide-bullet><'
%}
{% endif %}
<!-- return -->
{{ _content }}

View File

@@ -13,7 +13,7 @@
{% include trending-tags.html %}
{% for tag in trending_tags %}
{% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
{% capture url %}/tags/{{ tag | slugify | url_encode }}/{% endcapture %}
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
{% endfor %}

View File

@@ -6,11 +6,11 @@
MIT License
-->
<div id="nav-wrapper">
<div id="sidebar" class="d-flex flex-column align-items-end">
<div id="profile-wrapper" class="d-flex flex-column">
<div id="avatar" class="d-flex justify-content-center">
<a href="{{ site.baseurl }}/" alt="avatar">
<div class="profile-wrapper text-center">
<div id="avatar">
<a href="{{ site.baseurl }}/" alt="avatar" class="mx-auto">
{% assign avatar_url = site.avatar %}
{% capture start %}{{ site.avatar | slice: 0 }}{% endcapture %}
{% if start == '/' %}
@@ -20,26 +20,26 @@
</a>
</div>
<div class="profile-text mt-3">
<div class="site-title">
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
</div>
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
<div class="site-title mt-3">
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
</div>
</div><!-- #profile-wrapper -->
<ul class="nav flex-column">
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
</div><!-- .profile-wrapper -->
<ul class="w-100">
<!-- home -->
<li class="nav-item d-flex justify-content-center {% if page.layout == 'home' %}active{% endif %}">
<a href="{{ '/' | relative_url }}" class="nav-link d-flex justify-content-center align-items-center w-100">
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
<a href="{{ '/' | relative_url }}" class="nav-link">
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
<span>{{ "HOME" }}</span>
</a>
</li>
<!-- the real tabs -->
{% for tab in site.tabs %}
<li class="nav-item d-flex justify-content-center {% if tab.url == page.url %}active{% endif %}">
<a href="{{ tab.url | relative_url }}" class="nav-link d-flex justify-content-center align-items-center w-100">
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
<a href="{{ tab.url | relative_url }}" class="nav-link">
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
<span>{{ tab.title | upcase }}</span>
</a>
@@ -48,38 +48,44 @@
</ul> <!-- ul.nav.flex-column -->
</div><!-- #nav-wrapper -->
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center">
<div class="sidebar-bottom d-flex flex-wrap justify-content-around mt-4">
{% for entry in site.data.contact %}
{% capture url %}
{%- if entry.type == 'github' -%}
https://github.com/{{ site.github.username }}
{%- elsif entry.type == 'twitter' -%}
https://twitter.com/{{ site.twitter.username }}
{%- elsif entry.type == 'email' -%}
{% assign email = site.social.email | split: '@' %}
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }}
{%- else -%}
{{ entry.url }}
{%- endif -%}
{% endcapture %}
{% if site.theme_mode == "dual" %}
<span id="mode-toggle-wrapper">
{% include mode-toggle.html %}
</span>
<span class="icon-border"></span>
{% endif %}
{% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}"
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% for entry in site.data.contact %}
{% capture url %}
{%- if entry.type == 'github' -%}
https://github.com/{{ site.github.username }}
{%- elsif entry.type == 'twitter' -%}
https://twitter.com/{{ site.twitter.username }}
{%- elsif entry.type == 'email' -%}
{% assign email = site.social.email | split: '@' %}
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }}
{%- else -%}
{{ entry.url }}
{%- endif -%}
{% endcapture %}
{% endfor %}
{% if url != '' %}
<a href="{{ url }}" aria-label="{{ entry.type }}" {% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% endfor %}
{% unless site.theme_mode %}
{% if site.data.contact.size > 0 %}
<span class="icon-border order-2"></span>
{% endif %}
</div>
<span id="mode-toggle-wrapper" class="order-1">
{% include mode-toggle.html %}
</span>
{% endunless %}
</div> <!-- .sidebar-bottom -->
</div><!-- #sidebar -->

View File

@@ -15,7 +15,7 @@
{% assign size = tag | last | size %}
{% assign size_list = size_list | push: size %}
{% assign tag_str = tag | first | replace: " ", "-" | append: "::" | append: size %}
{% assign tag_str = tag | first | append: "::" | append: size %}
{% assign tag_list = tag_list | push: tag_str %}
{% endfor %}

41
_layouts/archives.html Normal file
View File

@@ -0,0 +1,41 @@
---
layout: page
# The Archives of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
<div id="archives" class="pl-xl-2">
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture pre_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% if forloop.first %}
{% assign last_day = "" %}
{% assign last_month = "" %}
<span class="lead">{{this_year}}</span>
<ul class="list-unstyled">
{% endif %}
<li>
<div>
{% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%b" }}{% endcapture %}
<span class="date day">{{ this_day }}</span>
<span class="date month small text-muted">{{ this_month }}</span>
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</div>
</li>
{% if forloop.last %}
</ul>
{% elsif this_year != pre_year %}
</ul>
<span class="lead">{{pre_year}}</span>
<ul class="list-unstyled">
{% assign last_day = "" %}
{% assign last_month = "" %}
{% endif %}
{% endfor %}
</div>

105
_layouts/categories.html Normal file
View File

@@ -0,0 +1,105 @@
---
layout: page
# All the Categories of posts
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
{% assign HEAD_PREFIX = "h_" %}
{% assign LIST_PREFIX = "l_" %}
{% assign group_index = 0 %}
{% assign sort_categories = site.categories | sort %}
{% for category in sort_categories %}
{% assign category_name = category | first %}
{% assign posts_of_category = category | last %}
{% assign first_post = posts_of_category | first %}
{% if category_name == first_post.categories[0] %}
{% assign sub_categories = "" | split: "" %}
{% for post in posts_of_category %}
{% assign second_category = post.categories[1] %}
{% if second_category %}
{% unless sub_categories contains second_category %}
{% assign sub_categories = sub_categories | push: second_category %}
{% endunless %}
{% endif %}
{% endfor %}
{% assign sub_categories = sub_categories | sort %}
{% assign sub_categories_size = sub_categories | size %}
<div class="card categories">
<!-- top-category -->
<div class="card-header d-flex justify-content-between hide-border-bottom"
id="{{ HEAD_PREFIX }}{{ group_index }}">
<span>
{% if sub_categories_size > 0 %}
<i class="far fa-folder-open fa-fw"></i>
{% else %}
<i class="far fa-folder fa-fw"></i>
{% endif %}
<a href="{{ site.baseurl }}/categories/{{ category_name | slugify | url_encode }}/"
class="ml-1 mr-2">
{{ category_name }}
</a>
<!-- content count -->
{% assign top_posts_size = site.categories[category_name] | size %}
<span class="text-muted small font-weight-light">
{% if sub_categories_size > 0 %}
{{ sub_categories_size }}
{% if sub_categories_size > 1 %}categories{% else %}category{% endif %},
{% endif %}
{{ top_posts_size }}
post{% if top_posts_size > 1 %}s{% endif %}
</span>
</span>
<!-- arrow -->
{% if sub_categories_size > 0%}
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse"
aria-expanded="true" aria-label="{{ HEAD_PREFIX }}{{ group_index }}-trigger"
class="category-trigger hide-border-bottom">
<i class="fas fa-fw fa-angle-down"></i>
</a>
{% else %}
<span data-toggle="collapse" class="category-trigger hide-border-bottom disabled">
<i class="fas fa-fw fa-angle-right"></i>
</span>
{% endif %}
</div> <!-- .card-header -->
<!-- Sub-categories -->
{% if sub_categories_size > 0 %}
<div id="{{ LIST_PREFIX }}{{ group_index }}" class="collapse show" aria-expanded="true">
<ul class="list-group">
{% for sub_category in sub_categories %}
<li class="list-group-item">
<i class="far fa-folder fa-fw"></i>
<a href="{{ site.baseurl }}/categories/{{ sub_category | slugify | url_encode }}/"
class="ml-1 mr-2">{{ sub_category }}</a>
{% assign posts_size = site.categories[sub_category] | size %}
<span class="text-muted small font-weight-light">{{ posts_size }}
post{% if posts_size > 1 %}s{% endif %}
</span>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div> <!-- .card -->
{% assign group_index = group_index | plus: 1 %}
{% endif %}
{% endfor %}

View File

@@ -9,27 +9,19 @@ layout: compress
<!DOCTYPE html>
{% if site.lang %}
{% assign lang = site.lang | split: "_" | first %}
{% else %}
{% assign lang = 'en' %}
{% endif %}
{% capture prefer_mode %}
{% if site.theme_mode != "dual" %}
{% if site.theme_mode %}
mode="{{ site.theme_mode }}"
{% endif %}
{% endcapture %}
<html lang="{{ lang }}" {{ prefer_mode }} >
<html lang="{{ site.lang | split: "_" | first | default: "en" }}" {{ prefer_mode }}>
{% include head.html %}
<body data-spy="scroll" data-target="#toc">
<div id="sidebar" class="d-flex flex-column">
{% include sidebar.html %}
</div>
{% include sidebar.html %}
{% include topbar.html %}
@@ -46,6 +38,10 @@ layout: compress
</div> <!-- #main-wrapper -->
{% if page.mermaid %}
{% include mermaid.html %}
{% endif %}
<div id="mask"></div>
<a id="back-to-top" href="#" aria-label="back-to-top" class="btn btn-lg btn-box-shadow" role="button">
@@ -54,10 +50,6 @@ layout: compress
{% include search-loader.html %}
{% if site.google_analytics.id and jekyll.environment == 'production' %}
{% include google-analytics.html %}
{% endif %}
</body>
</html>

View File

@@ -49,13 +49,10 @@ layout: page
{% for post in posts %}
<div class="post-preview">
<div class="d-flex justify-content-between pr-xl-2">
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
{% if post.pin == true %}
<i class="fas fa-thumbtack fa-fw text-muted mt-1 ml-2 mt-xl-2" data-toggle="tooltip" data-placement="left"
title="Pinned"></i>
{% endif %}
</div>
<h1>
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</h1>
<div class="post-content">
<p>
{% include no-linenos.html content=post.content %}
@@ -63,19 +60,35 @@ layout: page
</p>
</div>
<div class="post-meta text-muted">
<!-- posted date -->
<i class="far fa-clock fa-fw"></i>
{% include timeago.html date=post.date tooltip=true %}
<div class="post-meta text-muted d-flex justify-content-between">
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<i class="far fa-eye fa-fw"></i>
<span id="pv_{{-post.title-}}" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</span>
<div>
<!-- posted date -->
<i class="far fa-calendar fa-fw"></i>
{% include timeago.html date=post.date tooltip=true %}
<!-- time to read -->
<i class="far fa-clock fa-fw"></i>
{% include read-time.html content=post.content %}
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<i class="far fa-eye fa-fw"></i>
<span id="pv_{{-post.title-}}" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</span>
{% endif %}
</div>
{% if post.pin %}
<div class="pin">
<i class="fas fa-thumbtack fa-fw"></i>
<span>{{ site.data.label.pin_prompt }}</span>
</div>
{% endif %}
</div>
</div> <!-- .post-meta -->
</div> <!-- .post-review -->
{% endfor %}

View File

@@ -18,43 +18,41 @@ layout: default
<div class="post-meta text-muted d-flex flex-column">
<!-- Published date and author -->
<div>
Posted
{% include timeago.html date=page.date tooltip=true %}
by
<span class="author">
{% if page.author %}
{{ page.author }}
{% else %}
{{ site.author }}
{% endif %}
{{ page.author | default: site.author }}
</span>
</div>
<!-- lastmod -->
{% if page.last_modified_at %}
<div>
Updated
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
</div>
{% endif %}
<!-- lastmod -->
{% if page.last_modified_at %}
<span>
Updated
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
</span>
{% endif %}
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<div>
<!-- read time -->
{% include read-time.html content=content %}
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span>
views
{% endif %}
</div>
{% endif %}
</div> <!-- .post-meta -->
<div class="post-content">
{%- capture img_placehodler -%}
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
{% endcapture%}
{%- endcapture -%}
{% if page.image %}
<img src="{{ img_placehodler }}" data-src="{{ page.image }}" class="post-preview-img">
<img src="{{ img_placehodler }}" data-src="{{ page.image }}" class="preview-img">
{% endif %}
<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
@@ -73,7 +71,7 @@ layout: default
<div class="post-meta mb-3">
<i class="far fa-folder-open fa-fw mr-1"></i>
{% for category in page.categories %}
<a href='{{ site.baseurl }}/categories/{{ category | replace: ' ', '-' | downcase | url_encode }}/'>{{ category }}</a>
<a href='{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/'>{{ category }}</a>
{%- unless forloop.last -%}, {%- endunless -%}
{% endfor %}
</div>
@@ -84,7 +82,7 @@ layout: default
<div class="post-tags">
<i class="fa fa-tags fa-fw mr-1"></i>
{% for tag in page.tags %}
<a href="{{ site.baseurl }}/tags/{{ tag | replace: ' ', '-' | downcase | url_encode }}/"
<a href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
class="post-tag no-text-decoration" >
{{- tag -}}
</a>
@@ -113,7 +111,15 @@ layout: default
</div> <!-- #post-wrapper -->
{% include panel.html %}
{% assign enable_toc = false %}
{% if site.toc and page.toc %}
{% if content contains '<h2' or content contains '<h3' %}
{% assign enable_toc = true %}
{% endif %}
{% endif %}
{% include panel.html toc=enable_toc %}
</div> <!-- .row -->

26
_layouts/tags.html Normal file
View File

@@ -0,0 +1,26 @@
---
layout: page
# 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">
{% assign tags = "" | split: "" %}
{% for t in site.tags %}
{% assign tags = tags | push: t[0] %}
{% endfor %}
{% assign sorted_tags = tags | sort_natural %}
{% for t in sorted_tags %}
<div>
<a class="tag" href="{{ site.baseurl }}/tags/{{ t | slugify | url_encode }}/">{{ t }}<span class="text-muted">{{ site.tags[t].size }}</span></a>
</div>
{% endfor %}
</div>

View File

@@ -5,6 +5,7 @@ date: 2019-08-08 11:33:00 +0800
categories: [Blogging, Demo]
tags: [typography]
math: true
mermaid: true
image: /assets/img/sample/devices-mockup.png
---
@@ -12,18 +13,16 @@ This post is to show Markdown syntax rendering on [**Chirpy**](https://github.co
## Titles
---
# H1 - heading
# H1
<h2 data-toc-skip>H2 - heading</h2>
<h2 data-toc-skip>H2</h2>
<h3 data-toc-skip>H3</h3>
<h4>H4</h4>
<h3 data-toc-skip>H3 - heading</h3>
<h4>H4 - heading</h4>
---
<br>
## Paragraph
@@ -39,21 +38,38 @@ Beside the lake, beneath the trees,
Fluttering and dancing in the breeze.
## List
## Lists
### Ordered list
1. first item
2. second item
3. third item
1. Firstly
2. Secondly
3. Thirdly
### Unordered list
- item 1
- sub item 1
- sub item 2
- Chapter
- Setcion
- Paragraph
### Task list
- [ ] TODO
- [x] Completed
- Hold on
- [ ] Defeat COVID-19
- [x] Vaccine production
- [ ] Economic recovery
- [ ] People smile again
### Description list
Sun
: the star around which the earth orbits
Moon
: the natural satellite of the earth, visible by reflected light from the sun
- item 2
## Block Quote
@@ -61,53 +77,68 @@ Fluttering and dancing in the breeze.
## Tables
| Company | contact | Country |
| Company | Contact | Country |
|:-----------------------------|:-----------------|--------:|
| Alfreds Futterkiste | Maria Anders | Germany |
| Island Trading | Helen Bennett | UK |
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
## Link
## Links
<http://127.0.0.1:4000>
## Footnote
Click the hook will locate the footnote[^footnote].
Click the hook will locate the footnote[^footnote], and here is another footnote[^fn-nth-2].
## Images
By default, the image is centered and the image caption can be displayed at the bottom:
- Default (with caption)
![Desktop View](/assets/img/sample/mockup.png)
_Full screen width and center alignment_
You can change the size of the picture:
<br>
- Specify width
![Desktop View](/assets/img/sample/mockup.png){: width="400"}
_400px image width_
In addition, you can use class `normal` , `left` and `right` to specify the image position (but in these case, the image caption is prohibited), for example:
<br>
- Normal position
- Left aligned
![Desktop View](/assets/img/sample/mockup.png){: width="350" class="normal"}
![Desktop View](/assets/img/sample/mockup.png){: width="350" .normal}
- Float to the left
<br>
![Desktop View](/assets/img/sample/mockup.png){: width="240" class="left"}
- Float to left
![Desktop View](/assets/img/sample/mockup.png){: width="240" .left}
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
- Float to the right
<br>
![Desktop View](/assets/img/sample/mockup.png){: width="240" class="right"}
- Float to right
![Desktop View](/assets/img/sample/mockup.png){: width="240" .right}
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
## Inline code
<br>
## Mermaid SVG
```mermaid
gantt
title Adding GANTT diagram functionality to mermaid
apple :a, 2017-07-20, 1w
banana :crit, b, 2017-07-23, 1d
cherry :active, c, after b a, 1d
```
This is an example of `Inline Code`.
## Mathematics
@@ -119,7 +150,13 @@ When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
## Code Snippet
## Inline code
This is an example of `Inline Code`.
## Code block
### Common
@@ -132,14 +169,6 @@ This is a common code snippet, without syntax highlight and line number.
#### Console
```console
$ date
Sun Nov 3 15:11:12 CST 2019
```
#### Terminal
```terminal
$ env |grep SHELL
SHELL=/usr/local/bin/bash
PYENV_SHELL=bash
@@ -173,38 +202,18 @@ fi;
```
{% endraw %}
#### HTML
#### Java
```html
<div class="sidenav">
<a href="#contact">Contact</a>
<button class="dropdown-btn">Dropdown
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-container">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
<a href="#contact">Search</a>
</div>
```java
private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException {
// Write out any hidden serialization magic
s.defaultWriteObject();
for (E e: map.keySet()) s.writeObject(e);
}
```
**Horizontal Scrolling**
```html
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading" id="{{ category_name }}">
<i class="far fa-folder"></i>
<p>This is a very long long long long long long long long long long long long long long long long long long long long long line.</p>
</a>
</div>
</div>
</div>
```
## Reverse Footnote
[^footnote]: The footnote source.
[^footnote]: The footnote source
[^fn-nth-2]: The 2nd footnote source

View File

@@ -8,7 +8,7 @@ tags: [writing]
## Naming and Path
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_post/` of the root directory. Please note that the `EXTENSION` must be one of `md` and `markdown`. From `v2.4.1`, you can create sub-directories under `_posts/` to categorize posts.
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_posts/` of the root directory. Please note that the `EXTENSION` must be one of `md` and `markdown`.
## Front Matter
@@ -68,7 +68,21 @@ math: true
---
```
## Preview Image
## Mermaid
[**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagrams generation tool. To enable it on your post, add the following to the YAML block:
```yml
---
mermaid: true
---
```
Then you can use it like other markdown language: surround the graph code with ```` ```mermaid ```` and ```` ``` ````.
## Images
### Preview image
If you want to add an image to the top of the post contents, specify the url for the image by:
@@ -78,6 +92,49 @@ image: /path/to/image-file
---
```
### Image caption
Add italics to the next line of an imagethen it will become the caption and appear at the bottom of the image:
```markdown
![img-description](/path/to/image)
_Image Caption_
```
### Image size
You can specify the width (and height) of a image with `width`:
```markdown
![Desktop View](/assets/img/sample/mockup.png){: width="400"}
```
### Image position
By default, the image is centered, but you can specify the position by using one of class `normal` , `left` and `right`. For example:
- **Normal position**
Image will be left aligned in below sample:
```markdown
![Desktop View](/assets/img/sample/mockup.png){: width="350" .normal}
```
- **Float to the left**
```markdown
![Desktop View](/assets/img/sample/mockup.png){: width="240" .left}
```
- **Float to the right**
```markdown
![Desktop View](/assets/img/sample/mockup.png){: width="240" .right}
```
> **Limitation**: Once you specify the position of an image, it is forbidden to add the image caption.
## Pinned Posts
You can pin one or more posts to the top of the home page, and the fixed posts are sorted in reverse order according to their release date. Enable by:
@@ -90,7 +147,7 @@ pin: true
## Code Block
Markdown symbols <code class="highlighter-rouge">```</code> can easily create a code block as following examples.
Markdown symbols ```` ``` ```` can easily create a code block as following examples.
```
This is a common code snippet, without syntax highlight and line number.
@@ -98,7 +155,7 @@ This is a common code snippet, without syntax highlight and line number.
## Specific Language
Using <code class="highlighter-rouge">```language</code> you will get code snippets with line numbers and syntax highlight.
Using ```` ```language ```` you will get code snippets with line numbers and syntax highlight.
> **Note**: The Jekyll style `{% raw %}{%{% endraw %} highlight LANGUAGE {% raw %}%}{% endraw %}` or `{% raw %}{%{% endraw %} highlight LANGUAGE linenos {% raw %}%}{% endraw %}` are not allowed to be used in this theme !

View File

@@ -1,42 +1,7 @@
---
layout: archives
title: Archives
icon: fas fa-archive
order: 3
# The Archives of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
<div id="archives" class="pl-xl-2">
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture pre_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% if forloop.first %}
{% assign last_day = "" %}
{% assign last_month = "" %}
<span class="lead">{{this_year}}</span>
<ul class="list-unstyled">
{% endif %}
<li>
<div>
{% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%b" }}{% endcapture %}
<span class="date day">{{ this_day }}</span>
<span class="date month small text-muted">{{ this_month }}</span>
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</div>
</li>
{% if forloop.last %}
</ul>
{% elsif this_year != pre_year %}
</ul>
<span class="lead">{{pre_year}}</span>
<ul class="list-unstyled">
{% assign last_day = "" %}
{% assign last_month = "" %}
{% endif %}
{% endfor %}
</div>

View File

@@ -1,106 +1,6 @@
---
layout: categories
title: Categories
icon: fas fa-stream
order: 1
# All the Categories of posts
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
{% assign HEAD_PREFIX = "h_" %}
{% assign LIST_PREFIX = "l_" %}
{% assign group_index = 0 %}
{% assign sort_categories = site.categories | sort %}
{% for category in sort_categories %}
{% assign category_name = category | first %}
{% assign posts_of_category = category | last %}
{% assign first_post = posts_of_category | first %}
{% if category_name == first_post.categories[0] %}
{% assign sub_categories = "" | split: "" %}
{% for post in posts_of_category %}
{% assign second_category = post.categories[1] %}
{% if second_category %}
{% unless sub_categories contains second_category %}
{% assign sub_categories = sub_categories | push: second_category %}
{% endunless %}
{% endif %}
{% endfor %}
{% assign sub_categories = sub_categories | sort %}
{% assign sub_categories_size = sub_categories | size %}
<div class="card categories">
<!-- top-category -->
<div class="card-header d-flex justify-content-between hide-border-bottom"
id="{{ HEAD_PREFIX }}{{ group_index }}">
<span>
{% if sub_categories_size > 0 %}
<i class="far fa-folder-open fa-fw"></i>
{% else %}
<i class="far fa-folder fa-fw"></i>
{% endif %}
<a href="{{ site.baseurl }}/categories/{{ category_name | replace: ' ', '-' | downcase | url_encode }}/"
class="ml-1 mr-2">
{{ category_name }}
</a>
<!-- content count -->
{% assign top_posts_size = site.categories[category_name] | size %}
<span class="text-muted small font-weight-light">
{% if sub_categories_size > 0 %}
{{ sub_categories_size }}
{% if sub_categories_size > 1 %}categories{% else %}category{% endif %},
{% endif %}
{{ top_posts_size }}
post{% if top_posts_size > 1 %}s{% endif %}
</span>
</span>
<!-- arrow -->
{% if sub_categories_size > 0%}
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse"
aria-expanded="true" aria-label="{{ HEAD_PREFIX }}{{ group_index }}-trigger"
class="category-trigger hide-border-bottom">
<i class="fas fa-fw fa-angle-down"></i>
</a>
{% else %}
<span data-toggle="collapse" class="category-trigger hide-border-bottom disabled">
<i class="fas fa-fw fa-angle-right"></i>
</span>
{% endif %}
</div> <!-- .card-header -->
<!-- Sub-categories -->
{% if sub_categories_size > 0 %}
<div id="{{ LIST_PREFIX }}{{ group_index }}" class="collapse show" aria-expanded="true">
<ul class="list-group">
{% for sub_category in sub_categories %}
<li class="list-group-item">
<i class="far fa-folder fa-fw"></i>
<a href="{{ site.baseurl }}/categories/{{ sub_category | replace: ' ', '-' | downcase | url_encode }}/"
class="ml-1 mr-2">{{ sub_category }}</a>
{% assign posts_size = site.categories[sub_category] | size %}
<span class="text-muted small font-weight-light">{{ posts_size }}
post{% if posts_size > 1 %}s{% endif %}
</span>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div> <!-- .card -->
{% assign group_index = group_index | plus: 1 %}
{% endif %}
{% endfor %}

View File

@@ -1,31 +1,6 @@
---
layout: tags
title: Tags
icon: fas fa-tags
order: 2
# All the Tags of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
{% comment %}
'site.tags' looks like a Map, e.g. site.tags.MyTag.[ Post0, Post1, ... ]
Print the {{ site.tags }} will help you to understand it.
{% endcomment %}
<div id="tags" class="d-flex flex-wrap ml-xl-2 mr-xl-2">
{% assign tags = "" | split: "" %}
{% for t in site.tags %}
{% assign tags = tags | push: t[0] %}
{% endfor %}
{% assign sorted_tags = tags | sort_natural %}
{% for t in sorted_tags %}
<div>
<a class="tag" href="{{ site.baseurl }}/tags/{{ t | replace: ' ', '-' | downcase | url_encode }}/">{{ t }}<span class="text-muted">{{ site.tags[t].size }}</span></a>
</div>
{% endfor %}
</div>

View File

@@ -1,7 +0,0 @@
/*
* The field 'font-display' is added for Google-fonts.
*
* See: <https://fonts.google.com/>
*/
@import url('https://fonts.googleapis.com/css2?family=Lato&family=Roboto+Condensed:wght@400;700&family=Source+Sans+Pro:wght@400;600;700;900&display=swap');

View File

@@ -6,29 +6,25 @@
* MIT Licensed
*/
@import "_addon/fonts";
@import "_addon/module";
@import "_addon/variables";
@import "_colors/light-typography";
@import "_colors/dark-typography";
@mixin set-visible($light-display, $dark-display) {
[light-mode-invisible] {
display: $light-display;
}
@import url('https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;900&display=swap');
[dark-mode-invisible] {
display: $dark-display;
}
}
@mixin mode-toggle($dark-mode: false) {
@if $dark-mode {
@include set-visible(inline-block, none);
@include dark-scheme;
.mode-toggle {
transform: rotateY(180deg);
}
} @else {
@include set-visible(none, inline-block);
@include light-scheme;
.mode-toggle {
transform: none;
}
}
}
@@ -50,7 +46,7 @@ html[mode=dark] {
}
}
html, body {
:root {
font-size: 16px;
}
@@ -78,44 +74,45 @@ $sidebar-display: "sidebar-display";
width: $sidebar-width-medium;
z-index: 99;
background: var(--sidebar-bg);
a {
@include sidebar-links;
&:hover {
color: #fff;
@include no-text-decoration;
}
}
.site-title {
text-align: center;
a {
font-weight: 900;
font-size: 1.5rem;
letter-spacing: 0.5px;
&:hover {
color: #fff;
text-decoration: none;
}
}
}
.site-subtitle {
font-size: 95%;
text-align: center;
color: #828282;
line-height: 1.2rem;
word-spacing: 1px;
margin: 0.5rem 1.5rem 2rem 1.5rem;
margin: 0.5rem 1.5rem 0.5rem 1.5rem;
min-height: 3rem; // avoid vertical shifting in multi-line words
user-select: none;
}
.sidebar-bottom {
.icon-border + a { // the icon behide mode-toggle
margin-left: 0.1rem;
}
}
.nav-link {
border-radius: 0;
font-size: 0.95rem;
font-weight: 600;
letter-spacing: 1px;
display: table-cell;
vertical-align: middle;
}
.nav-item {
text-align: center;
display: table;
height: $tab-height;
&:hover {
.nav-link {
@@ -128,27 +125,38 @@ $sidebar-display: "sidebar-display";
}
}
}
ul {
height: $tab-height * $tab-count;
display: -webkit-box;
display: -ms-flexbox;
margin-bottom: 2rem;
padding-left: 0;
> li:last-child {
> a {
margin-right: -3px;
max-width: calc(100% - 3px);
> li {
width: 100%;
&:last-child {
$cursor-width: 3px;
> a {
position: relative;
left: $cursor-width / 2;
width: 100%;
}
&::after { // the cursor
display: table;
visibility: hidden;
content: "";
position: relative;
right: 1px;
width: $cursor-width;
height: $tab-cursor-height;
border-radius: 1px;
background-color: var(--nav-cursor-color);
pointer-events: none;
}
}
&::after { // the cursor
visibility: hidden;
content: "";
position: relative;
right: 1px;
width: 3px;
height: $tab-cursor-height;
background-color: var(--nav-cursor-color);
pointer-events: none;
}
}
} // li
@mixin fix-cursor($top) {
top: $top;
@@ -179,9 +187,18 @@ $sidebar-display: "sidebar-display";
.sidebar-bottom {
font-size: 1.2rem;
margin: 2rem 2.5rem 1.6rem;
margin-bottom: 2.1rem;
@include ml-mr(auto);
@include pl-pr(1rem);
%icon {
width: 2.4rem;
text-align: center;
}
a {
margin-bottom: 0.5rem; // icons may have multi lines
@extend %icon;
}
a:hover, #mode-toggle-wrapper > i:hover {
@@ -189,42 +206,45 @@ $sidebar-display: "sidebar-display";
}
#mode-toggle-wrapper {
@extend %icon;
i {
@include sidebar-links;
margin-right: 0;
margin: 0;
font-size: 1.05rem;
text-align: center;
position: relative;
bottom: 1px;
}
}
.icon-border {
background: #525354;
background-color: #525354;
content: "";
width: 3px;
height: 3px;
border-radius: 50%;
margin-top: 0.75rem;
position: relative;
top: 12px;
}
}
} // .sidebar-bottom
} // #sidebar
@media (hover: hover) {
#sidebar ul > li:last-child::after {
-webkit-transition: top .5s ease;
-moz-transition: top .5s ease;
-o-transition: top .5s ease;
transition: top .5s ease;
-webkit-transition: top 0.5s ease;
-moz-transition: top 0.5s ease;
-o-transition: top 0.5s ease;
transition: top 0.5s ease;
}
}
#nav-wrapper {
width: 100%;
flex-grow: 1;
}
#profile-wrapper {
.profile-wrapper {
margin-top: 2rem;
width: 100%;
}
#avatar {
@@ -248,9 +268,9 @@ $sidebar-display: "sidebar-display";
img {
width: 100%;
height: 100%;
-webkit-transition: transform .5s;
-moz-transition: transform .5s;
transition: transform .5s;
-webkit-transition: transform 0.5s;
-moz-transition: transform 0.5s;
transition: transform 0.5s;
&:hover {
-ms-transform: scale(1.2);
@@ -303,7 +323,7 @@ $sidebar-display: "sidebar-display";
&:not(:last-child) {
&::after {
content: "";
padding: 0 .3rem;
padding: 0 0.3rem;
}
}
}
@@ -320,7 +340,7 @@ $sidebar-display: "sidebar-display";
border-radius: 1rem;
border: 1px solid var(--search-wrapper-bg);
background: var(--search-wrapper-bg);
padding: 0 .5rem;
padding: 0 0.5rem;
i {
z-index: 2;
font-size: 0.9rem;
@@ -341,8 +361,9 @@ $sidebar-display: "sidebar-display";
background: center;
border: 0;
border-radius: 0;
padding: 0.18rem .3rem;
padding: 0.18rem 0.3rem;
color: var(--text-color);
font-size: 95%;
}
#search-input {
@@ -543,8 +564,8 @@ footer {
background: none;
border: 1px solid var(--btn-border-color);
border-radius: 0.8rem;
padding: 0.3rem .5rem;
margin: 0 .35rem .5rem 0;
padding: 0.3rem 0.5rem;
margin: 0 0.35rem 0.5rem 0;
&:hover {
background-color: #2a408e;
border-color: #2a408e;
@@ -647,29 +668,22 @@ blockquote {
}
kbd {
margin: 0 .3rem;
margin: 0 0.3rem;
}
sup {
z-index: 1;
&:target {
@extend %anchor;
z-index: 0;
}
}
.footnotes ol {
.footnotes > ol {
padding-left: 2rem;
margin-top: 0.5rem;
> li {
padding-top: 0.2rem;
margin-top: -0.2rem;
> p {
padding-left: 0.2em;
}
&:not(:last-child) {
margin-bottom: -.8rem;
margin-bottom: 0.3rem;
}
&:target > p {
> p {
margin-left: 0.25em;
margin-top: 0;
margin-bottom: 0;
}
&:target:not([scroll-focus]), &[scroll-focus=true] > p { // [scroll-focus] added by `smooth-scroll.js`
background-color: var(--footnote-target-bg);
width: fit-content;
-webkit-transition: background-color 1.5s ease-in-out;
@@ -681,14 +695,14 @@ sup {
.footnote {
@at-root a#{&} {
margin: 0 .2em;
@include ml-mr(1px);
@include pl-pr(2px);
border-bottom-style: none !important;
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
transition: background-color 1.5s ease-in-out;
}
@at-root sup:target > a#{&} {
@at-root sup:target:not([scroll-focus]), sup[scroll-focus=true] > a#{&} { // [scroll-focus] added by `smooth-scroll.js`
background-color: var(--footnote-target-bg);
padding: 0 2px;
}
}
@@ -748,14 +762,15 @@ img {
/*--- Begin of Markdown table style ---*/
div.post-content .table-wrapper {
.table-wrapper { // it will be created by Liquid
overflow-x: auto;
margin-bottom: 1.5rem;
> table {
min-width: 60%;
min-width: 100%;
overflow-x: auto;
border-spacing: 0;
margin-bottom: 1.5rem;
thead {
border-bottom: solid 2px rgba(210, 215, 217, 0.75);
@@ -811,16 +826,27 @@ div.post-content .table-wrapper {
overflow-wrap: break-word;
word-wrap: break-word;
img[data-src] {
margin: 0.5rem 0;
}
@mixin img-caption {
+ em {
display: block;
text-align: center;
font-style: normal;
font-size: 80%;
padding: 0;
color: #6d6c6c;
}
}
@mixin img($caption: false) {
> img:not([style]) {
margin: 0.5rem 0;
&:not(.normal):not(.left):not(.right) {
@include align-center;
> img[data-src] {
@if $caption {
@include img-caption;
}
@if $caption {
@include img-caption;
}
&.left {
@@ -836,17 +862,6 @@ div.post-content .table-wrapper {
}
}
@mixin img-caption {
+ em {
display: block;
text-align: center;
font-style: normal;
font-size: 80%;
padding: 0;
color: #6d6c6c;
}
}
a {
&:not(.img-hyperlink) {
@extend %link-color;
@@ -861,11 +876,67 @@ div.post-content .table-wrapper {
}
}
> p {
> img[data-src]:not(.normal):not(.left):not(.right) {
@include align-center;
}
}
p {
font-size: 1.08rem;
@include img(true);
}// p
}
}
ul {
// attribute 'hide-bullet' was added by liquid
.task-list-item[hide-bullet] {
list-style-type: none;
> i { // checkbox icon
margin: 0 0.4rem 0.2rem -1.4rem;
vertical-align: middle;
color: var(--checkbox-color);
&.checked {
color: var(--checkbox-checked-color);
}
}
}
input[type=checkbox] {
margin: 0 0.5rem 0.2rem -1.3rem;
vertical-align: middle;
}
} // ul
> ol, > ul {
padding-left: 2rem;
li {
+ li {
margin-top: 0.3rem;
}
ol, ul { // sub list
padding-left: 2rem;
margin-top: 0.3rem;
}
}
}
> ol {
li {
padding-left: 0.25em;
}
}
dl > dd {
margin-left: 1rem;
}
} // .post-content
.tag:hover {
@extend %tag-hover;
@@ -877,7 +948,7 @@ div.post-content .table-wrapper {
text-align: center;
background: var(--tag-bg);
border-radius: 0.3rem;
padding: 0 .4rem;
padding: 0 0.4rem;
color: inherit;
line-height: 1.3rem;
&:not(:last-child) {
@@ -961,7 +1032,7 @@ div.post-content .table-wrapper {
box-shadow: none;
border-color: var(--input-focus-border-color) !important;
background: center !important;
transition: background-color .15s ease-in-out,border-color .15s ease-in-out;
transition: background-color 0.15s ease-in-out,border-color 0.15s ease-in-out;
}
/*--- Responsive Design ---*/
@@ -992,13 +1063,6 @@ div.post-content .table-wrapper {
@include ml-mr(1.8rem);
}
/* table text in small screens */
div > table, p ~ table {
width: 100%;
table-layout: fixed;
word-wrap: break-word;
}
#main-wrapper {
padding-bottom: $footer-height;
}
@@ -1029,7 +1093,6 @@ div.post-content .table-wrapper {
transition: transform 0.4s ease;
}
html, body {
overflow-x: hidden;
}
@@ -1133,13 +1196,9 @@ div.post-content .table-wrapper {
justify-content: center!important;
}
sup:target {
padding-top: 3.4rem;
}
.footnotes ol > li {
padding-top: 3.5rem;
margin-top: -4.3rem;
margin-top: -3.2rem;
&:first-child {
margin-top: -3.5rem;
}
@@ -1166,7 +1225,7 @@ div.post-content .table-wrapper {
margin-left: $sidebar-width-medium;
}
#profile-wrapper {
.profile-wrapper {
margin-top: 3rem;
}
@@ -1175,6 +1234,10 @@ div.post-content .table-wrapper {
min-width: 150px;
}
div.post-content .table-wrapper > table {
min-width: 70%;
}
/* button 'back-to-Top' position */
#back-to-top {
bottom: 5.5rem;
@@ -1211,9 +1274,11 @@ div.post-content .table-wrapper {
#sidebar {
width: $sidebar-width-small;
.sidebar-bottom {
@include ml-mr(1.5rem);
a, span {
width: 2rem;
}
.icon-border {
@include ml-mr(.25rem);
left: -3px;
}
}
}
@@ -1299,8 +1364,8 @@ div.post-content .table-wrapper {
}
#search-input {
-webkit-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#search-result-wrapper {
@@ -1393,112 +1458,123 @@ div.post-content .table-wrapper {
margin-right: 3%;
}
#profile-wrapper {
margin: 4rem 2rem 3rem 4rem;
-ms-flex-direction: column!important;
#avatar {
-webkit-box-pack: normal !important;
-ms-flex-pack: normal !important;
justify-content: normal !important;
> a {
width: 6.2rem;
height: 6.2rem;
}
}
.profile-text {
margin-left: 0.5rem;
/* .d-flex */
display: -webkit-box!important;
display: -ms-flexbox!important;
display: flex!important;
/* .flex-wrap */
-ms-flex-wrap: wrap!important;
flex-wrap: wrap!important;
/* .align-content-center */
-ms-flex-line-pack: center!important;
align-content: center!important;
> div {
text-align: left !important;
width: 100%;
}
}
}
#sidebar {
width: $sidebar-width-large;
.site-title a {
font-size: 1.7rem;
letter-spacing: 1px;
margin: 0;
}
.profile-wrapper {
margin-top: 4rem;
margin-bottom: 1rem;
.site-subtitle {
word-spacing: 0;
margin: 0.3rem 0 0 0;
}
&.text-center {
text-align: left !important;
}
%profile-ml {
margin-left: 4.5rem;
}
#avatar {
@extend %profile-ml;
> a {
width: 6.2rem;
height: 6.2rem;
&.mx-auto {
margin-left: 0 !important;
}
}
}
.site-title {
@extend %profile-ml;
a {
font-size: 1.7rem;
letter-spacing: 1px;
}
}
.site-subtitle {
@extend %profile-ml;
word-spacing: 0;
margin-top: 0.3rem;
}
} // .profile-wrapper (min-width: 1650px)
ul {
margin-left: 3%;
> li > a {
padding-left: 2.5rem;
-webkit-box-pack: start!important;
-ms-flex-pack: start!important;
justify-content: flex-start!important;
}
}
padding-left: 2.5rem;
.nav-link {
> span {
letter-spacing: 3px;
> li:last-child {
> a {
position: static;
}
}
> i {
@include icon-round(1.65rem);
line-height: 1rem;
font-size: 0.6rem;
padding: 0.5em 0 0 .1em;
display: inline-block!important;
.nav-item {
text-align: left;
.nav-link {
> span {
letter-spacing: 3px;
}
> i {
@include icon-round(1.65rem);
line-height: 1.5rem;
font-size: 0.6rem;
padding-top: 1px;
padding-left: 1px;
position: relative;
bottom: 1px;
&.unloaded {
display: inline-block !important;
}
}
}
}
}
.sidebar-bottom {
margin-left: 3.5rem;
margin-right: 3rem;
font-size: 1.3rem;
padding-left: 3.5rem;
width: 100%;
&.justify-content-center {
-webkit-box-pack: start!important;
-ms-flex-pack: start!important;
justify-content: flex-start!important;
}
a {
border: 1px solid;
border-radius: 50%;
font-size: 1rem;
width: 2rem;
height: 2rem;
text-align: center;
i {
text-align: center;
width: 1.25em;
padding-top: 0.44rem;
}
width: 3rem;
}
i {
@include icon-round(2rem);
padding-top: 0.44rem;
margin-top: .7rem; // multi line space
bottom: 0;
}
#mode-toggle-wrapper {
font-size: 0.9rem;
width: 3rem;
i {
@include icon-round(2rem);
padding-top: 0.44rem;
bottom: 0;
top: 11px;
}
}
.icon-border {
@include ml-mr(.2rem);
margin-top: 0.85rem;
+a {
margin-left: 0;
}
top: 26px;
}
} // .sidebar-bottom
} // #sidebar
footer > div.d-flex {
width: 87%;
max-width: 1140px;

View File

@@ -17,6 +17,7 @@
%table-cell {
padding: 0.4rem 1rem;
font-size: 95%;
white-space: nowrap;
}
%link-hover {
@@ -64,7 +65,6 @@
color: $color;
transition: color 0.35s ease-in-out;
user-select: none;
margin: 0 0.25rem;
}
@mixin icon-round($diameter) {
@@ -96,7 +96,6 @@
color: $color;
font-size: $font-size;
font-weight: $font-weight;
font-family: 'Roboto Condensed', 'Microsoft Yahei', sans-serif;
}
@mixin panel-label {

View File

@@ -36,11 +36,11 @@ html[mode=dark] {
}
%code-snippet-radius {
border-radius: 5px;
border-radius: 6px;
}
%code-snippet-padding {
padding: 0.8rem 1rem;
padding: 1.5rem;
}
$code-font-size: 0.85rem;
@@ -56,6 +56,7 @@ div > pre {
@extend %code-snippet-radius;
color: var(--highlighter-rouge-color);
margin-top: 0.5rem;
margin-bottom: 1.2em; /* Override BS Inline-code style */
}
@@ -69,8 +70,8 @@ div > pre {
overflow: auto;
.lineno {
margin: 0.8rem 0;
padding: 0 0.5rem;
margin-left: 0.2rem;
padding-right: 0.5rem;
min-width: 2.2rem;
text-align: right;
color: var(--highlight-lineno-color);
@@ -111,7 +112,6 @@ code {
&.highlighter-rouge {
font-size: $code-font-size;
padding: 3px 5px;
margin: 0 0.15rem;
border-radius: 4px;
background-color: var(--inline-code-bg);
}
@@ -131,8 +131,7 @@ code {
}
td.rouge-code {
padding-left: 1rem;
padding-right: 1rem;
padding: 1.5rem 1.5rem 1.5rem 1rem;
}
/* Hide line numbers for default, console, and terminal code snippets */
@@ -149,3 +148,20 @@ div {
}
}
}
div[class^='language-']::before {
content: attr(lang);
position: absolute;
right: 1.8rem;
margin-top: 3px;
font-size: 0.7rem;
font-weight: 600;
color: var(--highlight-lineno-color);
text-transform: uppercase;
}
@media (min-width: 768px) {
div[class^='language-']::before {
right: 3.1rem;
}
}

View File

@@ -9,7 +9,7 @@
/* --- ↓ width and height ---- */
$tab-height: 3.3rem;
$tab-height: 3.2rem;
$tab-cursor-height: 1.6rem;
$sidebar-width-small: 210px;

View File

@@ -8,22 +8,22 @@
@mixin dark-syntax {
/* ----- My styles ------ */
--highlight-bg-color: #272822;
--highlight-bg-color: #252525;
--highlighter-rouge-color: #de6b18;
--highlight-lineno-color: #6c6c6d;
--highlight-lineno-border-color: #3c4042;
--inline-code-bg: var(--highlight-bg-color);
--highlight-lineno-border-color: #303435;
--inline-code-bg: #272822;
.highlight {
.gp { color: #818c96; }
}
pre { color: #818c96; } /* override Bootstrap */
pre { color: #bfbfbf; } /* override Bootstrap */
kbd { background-color: black; }
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
.highlight pre { background-color: #272822; }
.highlight .hll { background-color: #272822; }
.highlight pre { background-color: var(--highlight-bg-color); }
.highlight .hll { background-color: var(--highlight-bg-color); }
.highlight .c { color: #75715e; } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010; } /* Error */
.highlight .k { color: #66d9ef; } /* Keyword */
@@ -35,7 +35,7 @@
.highlight .cp { color: #75715e; } /* Comment.Preproc */
.highlight .c1 { color: #75715e; } /* Comment.Single */
.highlight .cs { color: #75715e; } /* Comment.Special */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .ge { color: inherit; font-style: italic; } /* Generic.Emph */
.highlight .gs { font-weight: bold; } /* Generic.Strong */
.highlight .kc { color: #66d9ef; } /* Keyword.Constant */
.highlight .kd { color: #66d9ef; } /* Keyword.Declaration */

View File

@@ -32,6 +32,8 @@
--btn-box-shadow: var(--main-wrapper-bg);
--card-header-bg: rgb(51, 50, 50);
--label-color: rgb(108, 117, 125);
--checkbox-color: rgb(118 120 121);
--checkbox-checked-color: var(--link-color);
/* Sidebar */
--nav-cursor-color: rgb(183, 182, 182);
@@ -49,6 +51,8 @@
--btn-text-color: var(--text-color);
--btn-paginator-border-color: var(--btn-border-color);
--btn-paginator-shadow: var(--main-wrapper-bg);
--pin-bg: rgb(34 35 37);
--pin-color: iherit;
/* Posts */
--toc-highlight: rgb(116, 178, 243);

View File

@@ -23,8 +23,10 @@
--tb-border-color: #eaeaea;
--button-bg: #fff;
--btn-backtotop-color: #686868;
--btn-backtotop-border-color: #f1f1f1; //--main-border-color,
--btn-backtotop-border-color: #f1f1f1;
--btn-box-shadow: #eaeaea;
--checkbox-color: #c5c5c5;
--checkbox-checked-color: #07a8f7;
/* Sidebar */
--sidebar-bg: radial-gradient(
@@ -50,12 +52,14 @@
--btn-text-color: #f8f8f8;
--btn-paginator-border-color: #f1f1f1;
--btn-paginator-shadow: #4b92d2;
--pin-bg: #f5f5f5;
--pin-color: #999fa4;
/* Posts */
--btn-share-hover-color: var(--link-color);
--card-border-color: #f1f1f1;
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
--label-color: #808080;
--label-color: #616161;
--relate-post-date: rgba(30, 55, 70, 0.4);
--tag-bg: rgba(0, 0, 0, 0.075);
--tag-border: #dee2e6;

View File

@@ -19,10 +19,6 @@
background-color: var(--timeline-color);
}
%date-font {
font-family: 'Roboto Condensed', sans-serif;
}
#archives {
letter-spacing: 0.03rem;
li {
@@ -42,7 +38,6 @@
span.lead {
font-size: 1.5rem;
@extend %date-font;
position: relative;
left: 8px;
@@ -54,8 +49,7 @@
}
}
&::after {
/* Year dot */
&::after { /* Year dot */
content: "";
display: block;
position: relative;
@@ -80,8 +74,8 @@
&.month {
width: 1.4rem;
text-align: center;
@extend %date-font;
~a::before {
~ a::before {
/* A dot for Month and Day */
content: "";
display: inline-block;

View File

@@ -20,17 +20,14 @@
h1 {
font-size: 1.4rem;
margin: 0;
~i { // pinned icon
font-size: 0.86rem;
}
}
.post-meta {
i {
font-size: 0.73rem;
&:not(:first-child) { // post-meta icons on the homepage
margin-left: 1.5rem;
}
}
span:not(:last-child) {
margin-right: 1.2rem;
}
}
@@ -38,7 +35,7 @@
margin-top: 0.6rem;
margin-bottom: 0.6rem;
color: var(--post-list-text-color);
>p {
> p {
/* Make preview shorter on the homepage */
margin: 0;
overflow: hidden;
@@ -49,6 +46,17 @@
}
}
.pin {
> i {
transform: rotate(45deg);
padding-left: 3px;
color: var(--pin-color);
}
> span {
display: none;
}
}
} // .post-preview
} // #post-list
@@ -107,12 +115,6 @@
} // .pagination
@media all and (max-width: 576px) {
#post-list .post-meta>span i:not(:first-child) {
margin-left: 1rem;
}
}
/* Hide SideBar and TOC */
@media all and (max-width: 830px) {
.pagination {
@@ -125,6 +127,21 @@
#post-list {
margin-top: 1.5rem;
.post-preview .post-meta {
.pin {
background: var(--pin-bg);
border-radius: 5px;
line-height: 1.4rem;
height: 1.3rem;
margin-top: 3px;
padding-left: 1px;
padding-right: 6px;
> span {
display: inline;
}
}
}
}
.pagination {

View File

@@ -27,22 +27,29 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
border-color: var(--btn-border-color);
}
@mixin dot($pl: 0.2rem, $pr: 0.4rem) {
content: "\2022";
color: rgba(158, 158, 158, 0.8);
padding-left: $pl;
padding-right: $pr;
}
.post .post-meta {
> div:nth-child(2) {
> span:not(:first-child)::before {
@include dot;
}
}
#pv::after {
content: " views";
}
.readtime::after {
content: " read";
}
}
.post-content {
> ol, > ul, > dl {
padding-left: 2rem;
li+li {
margin-top: 0.3rem;
}
}
li {
> ol, > ul, > dl { // sub list
padding-left: 2rem;
}
> p {
margin: 1rem 0 0.8rem;
}
}
.post-preview-img {
.preview-img {
margin-top: 0;
margin-bottom: 2.5rem;
@include align-center;
@@ -137,7 +144,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
position: sticky;
top: 4rem;
transition: top 0.2s ease-in-out;
animation: fade-up .8s;
animation: fade-up 0.8s;
&.topbar-down {
top: 6rem;
}
@@ -160,19 +167,19 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
@include label(1.1rem, 600);
}
.card {
border: 1px solid var(--card-border-color);
border-color: var(--card-border-color);
background-color: var(--card-bg);
box-shadow: 0 0 5px 0 var(--card-box-shadow);
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
h3 {
color: var(--text-color);
}
&:hover {
-webkit-transform: translate3d(0, -3px, 0);
transform: translate3d(0, -3px, 0);
box-shadow: 0 20px 35px -4px rgba(0, 0, 0, 0.15);
box-shadow: 0 10px 15px -4px rgba(0,0,0,0.15);
}
}
@@ -317,11 +324,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
.post {
.post-meta {
>div:not(:first-child)::before {
content: "\2022";
color: rgba(158, 158, 158, 0.8);
font-weight: bold;
padding-left: 0.5rem;
padding-right: 0.3rem;
@include dot(0.5rem, 0.2rem);
}
&.flex-column {
-webkit-box-orient: horizontal!important;

View File

@@ -18,4 +18,6 @@
{% include_relative _commons/copy-link.js %}
{% include_relative _commons/checkbox.js %}
{% include_relative _utils/tooltip-loader.js %}

View File

@@ -1,18 +1,20 @@
/*
Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
*/
$(window).scroll(function() {
if ($(this).scrollTop() > 50
&& $("#sidebar-trigger").css("display") === "none") {
$("#back-to-top").fadeIn();
} else {
$("#back-to-top").fadeOut();
}
});
$(function() {
$("#back-to-top").click(function() {
$("body,html").animate({scrollTop: 0}, 800);
$(window).scroll(() => {
if ($(this).scrollTop() > 50 &&
$("#sidebar-trigger").css("display") === "none") {
$("#back-to-top").fadeIn();
} else {
$("#back-to-top").fadeOut();
}
});
$("#back-to-top").click(() => {
$("body,html").animate({
scrollTop: 0
}, 800);
return false;
});
});

View File

@@ -0,0 +1,12 @@
/*
* Create a more beautiful checkbox
*/
$(function() {
/* hide browser default checkbox */
$("input[type=checkbox]").addClass("unloaded");
/* create checked checkbox */
$("input[type=checkbox][checked]").before("<i class=\"fas fa-check-circle checked\"></i>");
/* create normal checkbox */
$("input[type=checkbox]:not([checked])").before("<i class=\"far fa-circle\"></i>");
});

View File

@@ -0,0 +1,20 @@
/**
* Add language indicator to code snippets
*/
$(function() {
const prefix = "language-";
const regex = new RegExp(`^${prefix}([a-z])+$`);
$(`div[class^=${prefix}`).each(function() {
let clzsses = $(this).attr("class").split(" ");
clzsses.forEach((clzss) => {
if (regex.test(clzss)) {
let lang = clzss.substring(prefix.length);
$(this).attr("lang", `${lang}`);
}
});
});
});

View File

@@ -145,7 +145,7 @@ function displayPageviews(data) {
if ($("#post-list").length > 0) { /* the Home page */
$(".post-preview").each(function() {
var path = $(this).children("div").children("h1").children("a").attr("href");
var path = $(this).find("a").attr("href");
tacklePV(rows, path, $(this).find(".pageviews"), hasInit);
});

View File

@@ -0,0 +1,80 @@
/*
Safari doesn't support CSS `scroll-behavior: smooth`,
so here is a compatible sollution for all browser to smooth scrolling
See: <https://css-tricks.com/snippets/jquery/smooth-scrolling/>
Warning: It must be called after all `<a>` tags (e.g., the dynamic TOC) are ready.
*/
$(function() {
$("a[href*='#']")
.not("[href='#']")
.not("[href='#0']")
.click(function(event) {
if (location.pathname.replace(/^\//, "") === this.pathname.replace(/^\//, "")
&& location.hostname === this.hostname) {
const REM = 16; /* 16px */
const hash = decodeURI(this.hash);
let isFnRef = RegExp(/^#fnref:/).test(hash);
let isFn = RegExp(/^#fn:/).test(hash);
let selector = hash.includes(":") ? hash.replace(/\:/, "\\:") : hash;
const target = $(selector);
if (target.length) {
event.preventDefault();
if (history.pushState) { /* add hash to URL */
history.pushState(null, null, hash);
}
let curOffset = $(this).offset().top;
let destOffset = target.offset().top;
const scrollUp = (destOffset < curOffset);
const topbarHeight = $("#topbar-wrapper").outerHeight();
if (scrollUp && isFnRef) {
/* Avoid the top-bar covering `fnref` when scrolling up
because `fnref` has no `%anchor`(see: module.scss) style. */
destOffset -= (topbarHeight + REM / 2);
}
$("html,body").animate({
scrollTop: destOffset
}, 800, () => {
var $target = $(target);
$target.focus();
const SCROLL_MARK = "scroll-focus";
/* clean up old scroll mark */
if ($(`[${ SCROLL_MARK }=true]`).length) {
$(`[${ SCROLL_MARK }=true]`).attr(SCROLL_MARK, false);
}
/* Clean :target links */
if ($(":target").length) { /* element that visited by the URL with hash */
$(":target").attr(SCROLL_MARK, false);
}
/* set scroll mark to footnotes */
if (isFn || isFnRef) {
$target.attr(SCROLL_MARK, true);
}
if ($target.is(":focus")) { /* Checking if the target was focused */
return false;
} else {
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
$target.focus(); /* Set focus again */
}
});
}
}
}); /* click() */
});

View File

@@ -1,14 +0,0 @@
/*
* Hide the empty ToC in posts.
* v2.0
* https://github.com/cotes2020/jekyll-theme-chirpy
* © 2019 Cotes Chung
* MIT Licensed
*/
$(function() {
if ($("#post-wrapper .post-content h1").length === 0
&& $("#post-wrapper .post-content h2").length === 0) {
$("#toc-wrapper").addClass("unloaded");
}
});

View File

@@ -26,18 +26,13 @@ const include = [
'{{ "/assets/js/home.min.js" | relative_url }}',
'{{ "/assets/js/page.min.js" | relative_url }}',
'{{ "/assets/js/post.min.js" | relative_url }}',
'{{ "/assets/js/categories.min.js" | relative_url }}',
/*--- HTML ---*/
/* Tabs */
{% for tab in site.data.tabs %}
{% capture item %}
{%- unless tab.name == 'Home' -%}
/tabs/{{ tab.name | downcase }}
{%- endunless -%}
{{- "/" -}}
{% endcapture %}
'{{ item | relative_url }}',
{% for tab in site.tabs %}
'{{ tab.url }}',
{% endfor %}
/*--- Icons ---*/

View File

@@ -9,3 +9,5 @@ layout: compress
---
{% include_relative _commons.js %}
{% include_relative _utils/smooth-scroll.js %}

View File

@@ -12,6 +12,9 @@ layout: compress
{% include_relative lib/_bootstrap-toc.min.js %}
{% include_relative _utils/toc-filter.js %}
{% include_relative _utils/img-hyperlink.js %}
{% include_relative _utils/lang-badge.js %}
{% comment %} `smooth-scroll.js` must be called after ToC is ready {% endcomment %}
{% include_relative _utils/smooth-scroll.js %}

View File

@@ -11,7 +11,7 @@ Language: [English](../README.md) | 简体中文
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)](https://chirpy.cotes.info)
> ⚠️ 中文版文档存在更新不及时的风险(开源文档以英文为主,请见谅)。如果发现中、英文内容不匹配的情况,一切以英文版内容为准。如果您愿意的话,可提交 issuse 提醒作者更新中文版 README谢谢。
> :bulb: 中文版文档存在更新不及时的风险(开源文档以英文为主,请见谅)。如果发现中、英文内容不匹配的情况,一切以英文版内容为准。如果您愿意的话,可提交 issue 提醒作者更新中文版 README谢谢。
## 目录
@@ -19,7 +19,7 @@ Language: [English](../README.md) | 简体中文
- [安装](#安装)
- [使用](#使用)
- [参与贡献](#参与贡献)
- [](#)
- [](#)
- [赞助](#赞助)
- [许可证书](#许可证书)
@@ -33,6 +33,7 @@ Language: [English](../README.md) | 简体中文
- 语法高亮
- 二级目录
- 数学表达式
- Mermaid 图表
- 搜索
- Atom 订阅
- Disqus 评论

View File

@@ -15,6 +15,16 @@ _no_branch=false
_backup_dir="$(mktemp -d)"
init() {
if [[ -z ${GITHUB_ACTION+x} ]]; then
echo "ERROR: This script is not allowed to run outside of GitHub Action."
exit -1
fi
# Gemfile could be changed by `bundle install` in actions workflow
if [[ -n $(git status Gemfile.lock --porcelain) ]]; then
git checkout -- Gemfile.lock
fi
if [[ -z $(git branch -av | grep "$PAGES_BRANCH") ]]; then
_no_branch=true
git checkout -b "$PAGES_BRANCH"

View File

@@ -7,5 +7,5 @@
# © 2020 Cotes Chung
# MIT Licensed
bundle exec jekyll s -l -o
bundle exec jekyll s -H 0.0.0.0 -l

View File

@@ -64,7 +64,7 @@ if $_build; then
JEKYLL_ENV=production bundle exec jekyll b
fi
bundle exec htmlproofer $DEST \
bundle exec htmlproofer "$DEST" \
--disable-external \
--check-html \
--empty_alt_ignore \