mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 14:14:17 +00:00
Compare commits
201 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41741dc336 | ||
|
|
fad8a23b87 | ||
|
|
834de0f02c | ||
|
|
1ff38722a2 | ||
|
|
1c0cd6b6b0 | ||
|
|
4973a61e39 | ||
|
|
99c12f6cd4 | ||
|
|
042cec33d8 | ||
|
|
8c940dbb96 | ||
|
|
9636612755 | ||
|
|
18f6c6ac4e | ||
|
|
88aa81dfe5 | ||
|
|
1b47c95cf6 | ||
|
|
aa7309c136 | ||
|
|
d162167580 | ||
|
|
6688e27787 | ||
|
|
89751c8e9f | ||
|
|
eae506113b | ||
|
|
3400568b09 | ||
|
|
d2bb423220 | ||
|
|
c6b0a8247b | ||
|
|
8ce8fc780f | ||
|
|
ac2ec585f6 | ||
|
|
338eddb454 | ||
|
|
3573ccb7a3 | ||
|
|
82b3d061af | ||
|
|
fc94a8e36b | ||
|
|
efc8c60b5d | ||
|
|
3e79ad6300 | ||
|
|
273f2e152d | ||
|
|
d0a23c21ee | ||
|
|
89200f3109 | ||
|
|
136773481e | ||
|
|
de7d2fab7c | ||
|
|
1b1fa93cf6 | ||
|
|
7e31ba4103 | ||
|
|
34b7a80a78 | ||
|
|
ba6c7eceec | ||
|
|
5669f792a7 | ||
|
|
f864b5c324 | ||
|
|
c8ff81e79a | ||
|
|
2bcaabdab4 | ||
|
|
4faa595b04 | ||
|
|
d7443aad5d | ||
|
|
b2beaa0f4c | ||
|
|
83a7878043 | ||
|
|
94b99350fc | ||
|
|
6dc9cdfa25 | ||
|
|
fa56ea48c3 | ||
|
|
7d3e25c90d | ||
|
|
6c9ab6e5f8 | ||
|
|
91da99282d | ||
|
|
413a86277b | ||
|
|
1879b94f3d | ||
|
|
7b5f7086b7 | ||
|
|
a8b8a379f6 | ||
|
|
eacad65cbb | ||
|
|
7a87ab4d05 | ||
|
|
c4be7c0cd6 | ||
|
|
c9765e6923 | ||
|
|
5c04d4e45b | ||
|
|
4d969ca0c5 | ||
|
|
4a084eb681 | ||
|
|
adc117972a | ||
|
|
8e84c6b9d6 | ||
|
|
d8a42d9bb4 | ||
|
|
c1b20d8f71 | ||
|
|
08ce9f6c7c | ||
|
|
0b4e40bcdf | ||
|
|
9ae2aee222 | ||
|
|
ec522e5219 | ||
|
|
4ee8f20df2 | ||
|
|
7d7c0da31b | ||
|
|
4343f1a8f8 | ||
|
|
b85980e1e2 | ||
|
|
893db51ff0 | ||
|
|
cbb3bd4be5 | ||
|
|
7ed3bef1b1 | ||
|
|
da9f7b8218 | ||
|
|
0e9104a58f | ||
|
|
b7266aceac | ||
|
|
28f36bee23 | ||
|
|
994b3e32d3 | ||
|
|
75e9feb687 | ||
|
|
ab0e3f6ee4 | ||
|
|
0194bbced9 | ||
|
|
e92cc239c1 | ||
|
|
da976ce088 | ||
|
|
6490b0fcbd | ||
|
|
ef1d05d342 | ||
|
|
e8170f8379 | ||
|
|
93fcf50131 | ||
|
|
66a132c462 | ||
|
|
6e6633c2fc | ||
|
|
594eaf5100 | ||
|
|
940db20c5c | ||
|
|
493e1d934b | ||
|
|
b9104d0f4c | ||
|
|
3c72298563 | ||
|
|
ca2194770c | ||
|
|
08fbd06c63 | ||
|
|
a20fd5bf6f | ||
|
|
7a88347c63 | ||
|
|
813443b206 | ||
|
|
c381353f86 | ||
|
|
aa6c33526a | ||
|
|
081e77d462 | ||
|
|
bca7a2a634 | ||
|
|
505da84a26 | ||
|
|
dfba411d61 | ||
|
|
fa310d3190 | ||
|
|
ef0c9ce770 | ||
|
|
7429ef3539 | ||
|
|
6d4abcc437 | ||
|
|
5bdea71622 | ||
|
|
8e0004146b | ||
|
|
557413cc4c | ||
|
|
6dc6f2a7cf | ||
|
|
8e5d8b8931 | ||
|
|
260a906b11 | ||
|
|
5ffbfaec26 | ||
|
|
b9ffe15ffb | ||
|
|
87ba30a393 | ||
|
|
cb984aa021 | ||
|
|
0225d28fd3 | ||
|
|
aba3d25d7a | ||
|
|
dc88321ed5 | ||
|
|
cc24af11fc | ||
|
|
d70354021c | ||
|
|
d61446fafc | ||
|
|
d0a8d072fd | ||
|
|
9d59461632 | ||
|
|
cea339088b | ||
|
|
07d29ec9bf | ||
|
|
464fa001b2 | ||
|
|
53a98feff3 | ||
|
|
b8ee5a7b0c | ||
|
|
289ce1263d | ||
|
|
63f57fbc12 | ||
|
|
cdaa79cf80 | ||
|
|
d53769e52b | ||
|
|
7de13415e7 | ||
|
|
d196645d88 | ||
|
|
4d2f13c0d7 | ||
|
|
5ed39300cb | ||
|
|
d7d3bc9947 | ||
|
|
cf3943342a | ||
|
|
59deef469d | ||
|
|
bb13b52d44 | ||
|
|
8d4c555638 | ||
|
|
cbf707dc56 | ||
|
|
6335991164 | ||
|
|
5d6014ecee | ||
|
|
13aca77275 | ||
|
|
1172f1646d | ||
|
|
e27825d3eb | ||
|
|
36c4f32b17 | ||
|
|
6a326dc8e0 | ||
|
|
20c14c0207 | ||
|
|
575b5c292a | ||
|
|
479bd72c9d | ||
|
|
f2efae8b01 | ||
|
|
8b2e6d1bf5 | ||
|
|
0250a9c9f4 | ||
|
|
bbfbda7562 | ||
|
|
a33b2d78b0 | ||
|
|
1280f89217 | ||
|
|
83bfd32807 | ||
|
|
4ea320b250 | ||
|
|
8909438267 | ||
|
|
9482249999 | ||
|
|
43d4036941 | ||
|
|
a410600205 | ||
|
|
864119e3cc | ||
|
|
4702244ae8 | ||
|
|
b985965bc9 | ||
|
|
a5b002b2d8 | ||
|
|
270d3ba499 | ||
|
|
1f2ed3db60 | ||
|
|
08354cc4f5 | ||
|
|
ea56a900a0 | ||
|
|
8fa1f3b497 | ||
|
|
10bc44367a | ||
|
|
1889b6b4e0 | ||
|
|
aac29d43e5 | ||
|
|
c340199191 | ||
|
|
c7241ba611 | ||
|
|
d7f351b143 | ||
|
|
62aef9f850 | ||
|
|
7d128769f6 | ||
|
|
8d4c1deb15 | ||
|
|
57a4bfdb82 | ||
|
|
5741aa4e18 | ||
|
|
ad5b614304 | ||
|
|
4f1735aad6 | ||
|
|
38b87cfdd7 | ||
|
|
bf8996fb8b | ||
|
|
2bd99ffd33 | ||
|
|
46a8efb38a | ||
|
|
b9fb716e6a | ||
|
|
154fb04987 |
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
# 2 space indentation
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
16
.gitattributes
vendored
Normal file
16
.gitattributes
vendored
Normal 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
|
||||||
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1 +1,3 @@
|
|||||||
custom: ['https://www.buymeacoffee.com/coteschung', 'https://cotes.gitee.io/alipay-wechat-donation']
|
custom:
|
||||||
|
- https://www.buymeacoffee.com/coteschung
|
||||||
|
- https://cotes.gitee.io/alipay-wechat-donation
|
||||||
|
|||||||
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
23
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,11 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Bug Report
|
name: Bug Report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
labels: bug
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Note: Please follow the template to open a new issue, otherwise your question will probably be ignored. If you are new to Jekyll or Github Pages, you may be misreporting bugs. When you are not sure if this is a bug, choose to the `Question` type instead. -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||||
@@ -19,11 +17,12 @@ labels: bug
|
|||||||
### To Reproduce
|
### To Reproduce
|
||||||
|
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
|
<!--
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
2. Click on '....'
|
2. Click on '....'
|
||||||
3. Scroll down to '....'
|
3. Scroll down to '....'
|
||||||
4. See error
|
4. See error
|
||||||
|
-->
|
||||||
|
|
||||||
### Expected behavior
|
### Expected behavior
|
||||||
<!-- A clear and concise description of what you expected to happen. -->
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
@@ -33,21 +32,23 @@ Steps to reproduce the behavior:
|
|||||||
|
|
||||||
### Software
|
### Software
|
||||||
<!-- Please complete the following information -->
|
<!-- Please complete the following information -->
|
||||||
- Ruby version: [by running: `ruby -v`]
|
- Ruby version: <!-- by running: `ruby -v` -->
|
||||||
- Gem version: [by running: `gem -v`]
|
- Gem version: <!-- by running: `gem -v`-->
|
||||||
- Bundler version: [by running: `bundle -v`]
|
- Bundler version: <!-- by running: `bundle -v`-->
|
||||||
- Jekyll version: [by running: `bundle list | grep " jekyll "`]
|
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
|
||||||
|
|
||||||
### Desktop
|
### Desktop
|
||||||
<!-- Please complete the following information -->
|
<!-- If necessary, uncomment and fill in the following list:
|
||||||
- OS: [e.g. macOS 10.15.6]
|
- OS: [e.g. macOS 10.15.6]
|
||||||
- Browser: [e.g. Chrome 85.0.4183.83 (Official Build) (64-bit)]
|
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
|
||||||
|
-->
|
||||||
|
|
||||||
### Smartphone
|
### Smartphone
|
||||||
<!-- please complete the following information -->
|
<!-- If necessary, uncomment and fill in the following list:
|
||||||
- Device: [e.g. iPhone 6]
|
- Device: [e.g. iPhone 6]
|
||||||
- OS: [e.g. iOS 13.6.1]
|
- OS: [e.g. iOS 13.6.1]
|
||||||
- Browser: [e.g. Chrome 22]
|
- Browser: [e.g. Chrome 22]
|
||||||
|
-->
|
||||||
|
|
||||||
### Additional context
|
### Additional context
|
||||||
<!-- Add any other context about the problem here. -->
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -4,7 +4,7 @@ about: Suggest an idea for this project
|
|||||||
labels: enhancement
|
labels: enhancement
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Note: Please follow the template to open a new issue, otherwise your question will probably be ignored. -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||||
|
|||||||
5
.github/ISSUE_TEMPLATE/question.md
vendored
5
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -4,7 +4,7 @@ about: Ask what ever you want
|
|||||||
labels: question
|
labels: question
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Note: Please follow the template to open a new issue, otherwise your question will probably be ignored. -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
@@ -15,6 +15,5 @@ labels: question
|
|||||||
- [ ] I searched the Internet for related problems, but still couldn't solve it.
|
- [ ] I searched the Internet for related problems, but still couldn't solve it.
|
||||||
- [ ] My question is based on the latest code of `master` branch.
|
- [ ] My question is based on the latest code of `master` branch.
|
||||||
|
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
<!-- Please describe your question. -->
|
<!-- Please describe your question in detial. -->
|
||||||
|
|||||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -22,7 +22,7 @@ Please select the desired item checkbox and change it to "[x]", then delete opti
|
|||||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- [ ] I have run `bash ./tools/build.sh && bash ./tools/test.sh` (at the root of the project) locally and passed
|
- [ ] I have run `bash ./tools/test.sh --build` (at the root of the project) locally and passed
|
||||||
- [ ] I have tested this feature in the browser
|
- [ ] I have tested this feature in the browser
|
||||||
|
|
||||||
### Test Configuration
|
### Test Configuration
|
||||||
@@ -41,4 +41,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi
|
|||||||
- [ ] I have made corresponding changes to the documentation
|
- [ ] I have made corresponding changes to the documentation
|
||||||
- [ ] My changes generate no new warnings
|
- [ ] My changes generate no new warnings
|
||||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
- [ ] I have added tests that prove my fix is effective or that my feature works
|
||||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
- [ ] Any dependent changes have been merged and published in downstream modules
|
||||||
|
|||||||
17
.github/stale.yml
vendored
Normal file
17
.github/stale.yml
vendored
Normal 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
|
||||||
49
.github/workflows/ci.yml
vendored
49
.github/workflows/ci.yml
vendored
@@ -25,55 +25,22 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: '2.6.x'
|
|
||||||
|
|
||||||
- name: Install tools (for Ubuntu)
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
run: |
|
|
||||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
|
|
||||||
sudo add-apt-repository ppa:rmescandon/yq
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install yq -y
|
|
||||||
|
|
||||||
- name: Install tools (for macOS)
|
|
||||||
if: matrix.os == 'macos-latest'
|
|
||||||
run: |
|
|
||||||
brew install coreutils
|
|
||||||
brew install yq
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # for posts's lastmod
|
||||||
|
|
||||||
- name: Bundle Caching
|
- name: Setup Ruby
|
||||||
id: bundle-cache
|
uses: ruby/setup-ruby@v1
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
with:
|
||||||
path: vendor/bundle
|
ruby-version: 2.7
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
bundler-cache: true
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gems-
|
|
||||||
|
|
||||||
- name: Bundle config
|
|
||||||
run: |
|
|
||||||
bundle config path vendor/bundle
|
|
||||||
|
|
||||||
- name: Bundle Install
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
bundle install
|
|
||||||
|
|
||||||
- name: Bundle Install locally
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
|
||||||
run: |
|
|
||||||
bundle install --local
|
|
||||||
|
|
||||||
- name: Build Site
|
- name: Build Site
|
||||||
|
env:
|
||||||
|
JEKYLL_ENV: production
|
||||||
run: |
|
run: |
|
||||||
bash tools/build.sh
|
bundle exec jekyll b
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
20
.github/workflows/issue-pr-interceptor.yml
vendored
Normal file
20
.github/workflows/issue-pr-interceptor.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: "Intercept bad issue/PRs"
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
pull_request:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
autoclose:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- 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\\]|\\[X\\]) I have read"
|
||||||
|
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\\]|\\[X\\]) (Bug fix|New feature|Breaking change|Documentation update)|@dependabot"
|
||||||
|
pr-close-message: ":wave: Hi @${pull_request.user.login},\n\nThis PR is being automatically closed because it does not follow the PR template."
|
||||||
24
.github/workflows/issues-cleaner.yml
vendored
24
.github/workflows/issues-cleaner.yml
vendored
@@ -1,24 +0,0 @@
|
|||||||
name: "Close stale issues"
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- env:
|
|
||||||
DAYS_TO_STALE: ${{ 5 }}
|
|
||||||
DAYS_TO_CLOSE: ${{ 2 }}
|
|
||||||
uses: actions/stale@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
stale-issue-message: 'This issue is stale because it has been open ${{ env.DAYS_TO_STALE }} days with no activity. Remove stale label or comment or this will be closed in ${{ env.DAYS_TO_CLOSE }} days'
|
|
||||||
stale-issue-label: 'stale'
|
|
||||||
exempt-issue-labels: 'pending, in progress'
|
|
||||||
stale-pr-message: 'This PR is stale because it has been open ${{ env.DAYS_TO_STALE }} days with no activity. Remove stale label or comment or this will be closed in ${{ env.DAYS_TO_CLOSE }} days'
|
|
||||||
stale-pr-label: 'stale'
|
|
||||||
exempt-pr-labels: 'pending, in progress'
|
|
||||||
days-before-stale: ${{ env.DAYS_TO_STALE }}
|
|
||||||
days-before-close: ${{ env.DAYS_TO_CLOSE }}
|
|
||||||
# debug-only: true
|
|
||||||
62
.github/workflows/pages-deploy.yml.hook
vendored
62
.github/workflows/pages-deploy.yml.hook
vendored
@@ -13,69 +13,41 @@ jobs:
|
|||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
|
||||||
GEMS_PATH: /tmp/bundle
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: 2.6.x
|
|
||||||
|
|
||||||
- name: Install tools
|
|
||||||
run: |
|
|
||||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
|
|
||||||
sudo add-apt-repository ppa:rmescandon/yq
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install yq -y
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # for posts's lastmod
|
||||||
|
|
||||||
- name: Bundle Caching
|
- name: Setup Ruby
|
||||||
id: bundle-cache
|
uses: ruby/setup-ruby@v1
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
with:
|
||||||
path: ${{ env.GEMS_PATH }}
|
ruby-version: 2.7
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
bundler-cache: true
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gems-
|
|
||||||
|
|
||||||
- name: Bundle config
|
|
||||||
run: |
|
|
||||||
bundle config path ${{ env.GEMS_PATH }}
|
|
||||||
|
|
||||||
- name: Bundle Install
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
bundle install
|
|
||||||
|
|
||||||
- name: Bundle Install locally
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
|
||||||
run: |
|
|
||||||
bundle install --local
|
|
||||||
|
|
||||||
- name: Check baseurl
|
- name: Check baseurl
|
||||||
run: |
|
run: |
|
||||||
baseurl="$(grep '^baseurl:' _config.yml | yq r - baseurl)"
|
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
||||||
if [[ -n $baseurl ]]; then
|
if [[ -n $baseurl ]]; then
|
||||||
echo "SPEC_TEST=_site_no_baseurl" >> $GITHUB_ENV
|
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build Site
|
- name: Build Site
|
||||||
|
env:
|
||||||
|
JEKYLL_ENV: production
|
||||||
run: |
|
run: |
|
||||||
bash tools/build.sh
|
bundle exec jekyll b -d "_site$BASE_URL"
|
||||||
|
|
||||||
if [[ -n $SPEC_TEST ]]; then
|
|
||||||
# Bypass the defects of htmlproofer
|
|
||||||
bash tools/build.sh -b "" -d "$SPEC_TEST"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: |
|
run: |
|
||||||
bash tools/test.sh "$SPEC_TEST"
|
bash tools/test.sh
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n $BASE_URL ]]; then
|
||||||
|
mv _site$BASE_URL _site-rename
|
||||||
|
rm -rf _site
|
||||||
|
mv _site-rename _site
|
||||||
|
fi
|
||||||
|
|
||||||
bash tools/deploy.sh
|
bash tools/deploy.sh
|
||||||
|
|||||||
18
.gitignore
vendored
18
.gitignore
vendored
@@ -1,17 +1,15 @@
|
|||||||
# hidden files
|
# hidden files
|
||||||
.*
|
.*
|
||||||
|
!.github
|
||||||
|
|
||||||
# python compiled files
|
# bundler cache
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# jekyll debug
|
|
||||||
_site
|
_site
|
||||||
|
vendor
|
||||||
# Jeykll Gemfile.lock
|
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
|
|
||||||
# yui-compressor
|
# rubygem
|
||||||
*.jar
|
*.gem
|
||||||
|
|
||||||
# bundle cache
|
# npm dependencies
|
||||||
vendor
|
node_modules
|
||||||
|
package-lock.json
|
||||||
|
|||||||
64
.travis.yml
64
.travis.yml
@@ -1,39 +1,49 @@
|
|||||||
os: linux
|
os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
||||||
language: ruby
|
language: minimal
|
||||||
rvm: 2.6.5
|
|
||||||
|
|
||||||
before_install:
|
jobs:
|
||||||
- bundle config path 'vendor/bundle'
|
include:
|
||||||
|
|
||||||
install:
|
- name: CD
|
||||||
- bundle install --quiet
|
language: ruby
|
||||||
|
rvm: 2.7.0
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
packages:
|
||||||
- sourceline: "ppa:rmescandon/yq"
|
# required to avoid SSL error (for htmlproofer)
|
||||||
packages:
|
- libcurl4-openssl-dev
|
||||||
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
|
|
||||||
- yq
|
|
||||||
|
|
||||||
script:
|
cache:
|
||||||
- >-
|
directories:
|
||||||
git clone https://${GH_PAT}@github.com/${GH_USER}/${BUILDER_REPO}.git
|
- $TRAVIS_BUILD_DIR/vendor/bundle
|
||||||
${HOME}/${BUILDER_REPO} --depth=1 -q
|
|
||||||
- cp -r ${HOME}/${BUILDER_REPO}/framework/* .
|
before_install:
|
||||||
- bash _cibuild.sh
|
# match the Gemfile.lock, travis' bundler is 2.1.2
|
||||||
|
- gem install bundler:2.2.4
|
||||||
|
- bundle config path 'vendor/bundle'
|
||||||
|
|
||||||
|
install:
|
||||||
|
# overriding to drop the travis `--development` flag
|
||||||
|
- bundle install --jobs=3 --retry=3
|
||||||
|
|
||||||
|
script:
|
||||||
|
- eval "$BUILD_CMD"
|
||||||
|
|
||||||
|
git:
|
||||||
|
depth: false # for posts' lastmod
|
||||||
|
|
||||||
|
- name: Flush Starter
|
||||||
|
script:
|
||||||
|
- eval "$FLUSH_STARTER"
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only: production
|
only: /.*-stable$/
|
||||||
|
|
||||||
git:
|
|
||||||
depth: false # for posts lastmod
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $TRAVIS_BUILD_DIR/vendor/bundle
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
|||||||
18
404.html
18
404.html
@@ -1,19 +1,11 @@
|
|||||||
---
|
---
|
||||||
# The 404 page
|
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
layout: page
|
layout: page
|
||||||
title: "404: Page not found"
|
title: "404: Page not found"
|
||||||
permalink: /404.html
|
permalink: /404.html
|
||||||
|
|
||||||
redirect_from: # part of site.sitemap_exclude
|
redirect_from:
|
||||||
- /norobots/
|
- /norobots/
|
||||||
- /assets/
|
- /assets/
|
||||||
- /tabs/
|
|
||||||
- /categories/
|
|
||||||
- /tags/
|
|
||||||
- /posts/
|
- /posts/
|
||||||
|
|
||||||
dynamic_title: true
|
dynamic_title: true
|
||||||
@@ -21,5 +13,9 @@ dynamic_title: true
|
|||||||
|
|
||||||
<div class="lead">
|
<div class="lead">
|
||||||
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
|
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
|
||||||
<p><a href="{{ site.baseurl }}/">Head back Home</a> to try finding it again, or search for it on the <a href="{{ site.baseurl }}/tabs/archives">Archives page</a>.</p>
|
<p>
|
||||||
</div>
|
<a href="{{ '/' | relative_url }}">Head back Home</a>
|
||||||
|
to try finding it again, or search for it on the
|
||||||
|
<a href="{{ 'archives' | relative_url }}">Archives page</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|||||||
23
Gemfile
23
Gemfile
@@ -1,14 +1,19 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "jekyll", ">=3.8.6"
|
gemspec
|
||||||
|
|
||||||
# Official Plugins
|
|
||||||
group :jekyll_plugins do
|
|
||||||
gem "jekyll-paginate"
|
|
||||||
gem "jekyll-redirect-from"
|
|
||||||
gem "jekyll-seo-tag", "~> 2.6.1"
|
|
||||||
end
|
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem "html-proofer"
|
gem "html-proofer", "~> 3.18"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
|
# and associated library.
|
||||||
|
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
|
||||||
|
gem "tzinfo", "~> 1.2"
|
||||||
|
gem "tzinfo-data"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Performance-booster for watching directories on Windows
|
||||||
|
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
|
||||||
|
|||||||
174
README.md
174
README.md
@@ -1,25 +1,16 @@
|
|||||||
# Chirpy
|
# Chirpy
|
||||||
|
|
||||||
🌏 English • [简体中文](docs/README_zh-CN.md)
|
Language: English | [简体中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
||||||
|
|
||||||
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
[](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)
|
[](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)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[](https://996.icu)
|
[](https://996.icu)
|
||||||
|
|
||||||
A minimal, sidebar, responsive web design Jekyll theme, focusing on text presentation, aim to help you easily record and share your knowledge. [Live Demo »](https://chirpy.cotes.info)
|
A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation. Designed to help you record and share your knowledge easily. [Live Demo »](https://chirpy.cotes.info)
|
||||||
|
|
||||||
[](https://chirpy.cotes.info)
|
[](https://chirpy.cotes.info)
|
||||||
|
|
||||||
## Table of Contents
|
|
||||||
|
|
||||||
- [Features](#features)
|
|
||||||
- [Installation](#installation)
|
|
||||||
- [Usage](#usage)
|
|
||||||
- [Contributing](#contributing)
|
|
||||||
- [Credits](#credits)
|
|
||||||
- [Support](#support)
|
|
||||||
- [License](#license)
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -31,6 +22,7 @@ A minimal, sidebar, responsive web design Jekyll theme, focusing on text present
|
|||||||
- Automatically recommend related posts
|
- Automatically recommend related posts
|
||||||
- Syntax highlighting
|
- Syntax highlighting
|
||||||
- Mathematical expressions
|
- Mathematical expressions
|
||||||
|
- Mermaid diagram & flowchart
|
||||||
- Search
|
- Search
|
||||||
- Atom Feeds
|
- Atom Feeds
|
||||||
- Disqus Comments
|
- Disqus Comments
|
||||||
@@ -38,122 +30,130 @@ A minimal, sidebar, responsive web design Jekyll theme, focusing on text present
|
|||||||
- GA Pageviews reporting (Advanced)
|
- GA Pageviews reporting (Advanced)
|
||||||
- SEO and Performance Optimization
|
- SEO and Performance Optimization
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub, rename the repository to `USERNAME.github.io` (where `USERNAME` is your GitHub username), and then open terminal and clone the fork to local by:
|
There are two ways to get the theme:
|
||||||
|
|
||||||
```terminal
|
- **Install from RubyGems** - Easy to update, isolate irrelevant project files so you can focus on writing.
|
||||||
$ git clone https://github.com/USERNAME/USERNAME.github.io.git -b master --single-branch
|
- **Fork on GitHub** - Convenient for custom development, but difficult to update, only suitable for web developers.
|
||||||
|
|
||||||
|
### Installing the Theme Gem
|
||||||
|
|
||||||
|
Add this line to your Jekyll site's `Gemfile`:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
gem "jekyll-theme-chirpy"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up the local envrionment
|
And add this line to your Jekyll site's `_config.yml`:
|
||||||
|
|
||||||
If you would like to run or build the project on your local machine, please follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems` and `Bundler`.
|
```yaml
|
||||||
|
theme: jekyll-theme-chirpy
|
||||||
Before running or building for the first time, please complete the installation of the Jekyll plugins. Go to the root directory of project and run:
|
|
||||||
|
|
||||||
```terminal
|
|
||||||
$ bundle install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`bundle` will automatically install all the dependencies specified by `Gemfile`.
|
And then execute:
|
||||||
|
|
||||||
In order to generate some extra files (_categories_, _tags_ and _last modified list_), we need to use some tool scripts. And they require dependency package [yq](https://github.com/mikefarah/yq#install) to be installed. What's more, if your machine is running Debian or macOS, you also need to install [GNU coreutils](https://www.gnu.org/software/coreutils/).
|
|
||||||
|
|
||||||
- on Debian:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ sudo apt-get install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
- on macOS:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ brew install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
### Setting up Docker environment (optional)
|
|
||||||
|
|
||||||
If you're a loyal fan of [**Docker**](https://www.docker.com/) or just too lazy to install the packages mentioned in [_Setting up the local envrionment_](#setting-up-the-local-envrionment), please make sure you have **Docker Engine** installed and running, and then get Docker image `jekyll/jekyll` from Docker Hub by the following command:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker pull jekyll/jekyll:latest
|
$ bundle
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
Finally, copy the required files from the theme's gem (for detailed files, see [starter project][starter]) to your Jekyll site.
|
||||||
|
|
||||||
Running [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) requires some extra files, which cannot be generated by Jekyll native commands, so please strictly follow the methods mentioned below to run or deploy your website.
|
> **Hint**: To locate the installed theme’s gem, execute:
|
||||||
|
>
|
||||||
|
> ```console
|
||||||
|
> $ bundle info --path jekyll-theme-chirpy
|
||||||
|
> ```
|
||||||
|
|
||||||
### Initialization
|
Or you can [**use the starter template**][use-starter] to create a Jekyll site to save time copying files from theme's gem. We have prepared everything for you there!
|
||||||
|
|
||||||
Go to the root directory of the project and start initialization:
|
### Fork on GitHub
|
||||||
|
|
||||||
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and then clone your fork to local. (Please note that the default branch code is in development. If you want the blog to be stable, please switch to the [latest tag](https://github.com/cotes2020/jekyll-theme-chirpy/tags) and start writing.)
|
||||||
|
|
||||||
|
Install gem dependencies by:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle
|
||||||
|
```
|
||||||
|
|
||||||
|
And then execute:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: If you not intend to deploy it on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
> **Note**: If you don't plan to deploy your site on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
||||||
|
|
||||||
What it does is:
|
What it does is:
|
||||||
|
|
||||||
1. Remove some files or directories from your repository:
|
1. Remove some files or directories from your repository:
|
||||||
|
|
||||||
- `.travis.yml`
|
- `.travis.yml`
|
||||||
- files under `_posts`
|
- files under `_posts`
|
||||||
- folder `docs`
|
- folder `docs`
|
||||||
|
|
||||||
2. If you use the `--no-gh` option, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in folder `.github`.
|
2. If you use the `--no-gh` option, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in folder `.github`.
|
||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Automatically create a commit to save the changes.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
|
Update the variables of `_config.yml` as needed. Some of them are typical options:
|
||||||
|
|
||||||
- `url`
|
- `url`
|
||||||
- `avatar`
|
- `avatar`
|
||||||
- `timezone`
|
- `timezone`
|
||||||
- `theme_mode`
|
- `lang`
|
||||||
|
|
||||||
### Run Locally
|
### Running Local Server
|
||||||
|
|
||||||
You may want to preview the site contents before publishing, so just run it by:
|
You may want to preview the site contents before publishing, so just run it by:
|
||||||
|
|
||||||
```terminal
|
```console
|
||||||
$ bash tools/run.sh
|
$ bundle exec jekyll s
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open a browser and visit to <http://localhost:4000>.
|
Or run the site on Docker with the following command:
|
||||||
|
|
||||||
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
|
|
||||||
|
|
||||||
### Run on Docker
|
|
||||||
|
|
||||||
Run the site on Docker with the following command:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ docker run --rm -it \
|
$ docker run -it --rm \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
-p 4000:4000 jekyll/jekyll \
|
-p 4000:4000 jekyll/jekyll \
|
||||||
bash tools/run.sh --docker
|
jekyll serve
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that on Docker containers, you'll lose the real-time refresh feature.
|
Open a browser and visit to _<http://localhost:4000>_.
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [_project site_](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash. For example, `/project`.
|
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash, e.g, `/project-name`.
|
||||||
|
|
||||||
Assuming you have already gone through the [initialization](#initialization), you can now choose ONE of the following methods to deploy your website.
|
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||||
|
|
||||||
#### Deploy on GitHub Pages
|
#### Deploy on GitHub Pages
|
||||||
|
|
||||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using tool scripts to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the Pages service.
|
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the GH Pages service.
|
||||||
|
|
||||||
1. Push any commit to `origin/master` to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
Quickly check the files needed for GitHub Actions build:
|
||||||
|
|
||||||
2. Browse to your repository on GitHub and choose the branch `gh-pages` as the [publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) throught _Settings_ → _Options_ → _GitHub Pages_:
|
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [workflow file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
|
||||||

|
- Ensure your Jekyll site has file `tools/test.sh` and `tools/deploy.sh`. Otherwise, copy them from this repo to your Jekyll site.
|
||||||
|
|
||||||
|
And then rename your repoistory to `<GH-USERNAME>.github.io` on GitHub.
|
||||||
|
|
||||||
|
Now publish your Jekyll site by:
|
||||||
|
|
||||||
|
1. Push any commit to remote to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
||||||
|
|
||||||
|
2. Browse to your repo's landing page on GitHub and select the branch `gh-pages` as the [publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) throught _Settings_ → _Options_ → _GitHub Pages_:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
@@ -164,23 +164,22 @@ On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Acti
|
|||||||
Go to the root of the source project, build your site by:
|
Go to the root of the source project, build your site by:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/build.sh
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: The output path can be specified with the option `-d`.
|
Or build the site with Docker by:
|
||||||
|
|
||||||
Or, build the site with Docker by:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ docker run --rm -it \
|
$ docker run -it --rm \
|
||||||
|
--env JEKYLL_ENV=production \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
jekyll/jekyll \
|
jekyll/jekyll \
|
||||||
bash tools/build.sh --docker
|
jekyll build
|
||||||
```
|
```
|
||||||
|
|
||||||
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to your web server.
|
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to your web server.
|
||||||
|
|
||||||
### Documentation
|
## Documentation
|
||||||
|
|
||||||
For more details and the better reading experience, please check out the [tutorials on demo site](https://chirpy.cotes.info/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki).
|
For more details and the better reading experience, please check out the [tutorials on demo site](https://chirpy.cotes.info/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki).
|
||||||
|
|
||||||
@@ -194,10 +193,25 @@ This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Boot
|
|||||||
|
|
||||||
:tada: Thanks to all the volunteers who contributed to this project, their GitHub IDs are on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget those guys who submitted the issues or unmerged PR because they reported bugs, shared ideas or inspired me to write more readable documentation.
|
:tada: Thanks to all the volunteers who contributed to this project, their GitHub IDs are on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget those guys who submitted the issues or unmerged PR because they reported bugs, shared ideas or inspired me to write more readable documentation.
|
||||||
|
|
||||||
## Support
|
Also, thank [JetBrains][jb] for providing the open source license.
|
||||||
|
|
||||||
If you enjoy this theme or find it helpful, please consider becoming my sponsor, I'd really appreciate it! Click the button <kbd>:heart: Sponsor</kbd> at the top of the [Home Page](https://github.com/cotes2020/jekyll-theme-chirpy) and choose a link that suits you to donate; this will encourage and help me better maintain the project.
|
## Sponsoring
|
||||||
|
|
||||||
|
If you like this theme or find it helpful, please consider sponsoring me, because it will encourage and help me better maintain the project, I will be very grateful!
|
||||||
|
|
||||||
|
[](https://www.buymeacoffee.com/coteschung)
|
||||||
|
[][cn-donation]
|
||||||
|
[][cn-donation]
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
|
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
|
||||||
|
|
||||||
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
|
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||||
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
|
|
||||||
|
<!-- ReadMe links -->
|
||||||
|
|
||||||
|
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||||
|
[cn-donation]: https://cotes.gitee.io/alipay-wechat-donation/
|
||||||
|
|||||||
181
_config.yml
181
_config.yml
@@ -1,28 +1,31 @@
|
|||||||
# The Site Settings
|
# The Site Configuration
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT licensed
|
|
||||||
|
|
||||||
|
# Import the theme
|
||||||
|
theme: jekyll-theme-chirpy
|
||||||
|
|
||||||
|
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
|
||||||
|
# change below value to '/projectname'.
|
||||||
|
baseurl: ''
|
||||||
|
|
||||||
|
# the HTML language tag › https://www.w3.org/International/questions/qa-choosing-language-tags
|
||||||
|
lang: en-US
|
||||||
|
|
||||||
|
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
||||||
|
timezone: Asia/Shanghai
|
||||||
|
|
||||||
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
||||||
#--------------------------
|
# --------------------------
|
||||||
|
|
||||||
title: Chirpy # the main title
|
title: Chirpy # the main title
|
||||||
|
|
||||||
tagline: A text-focused Jekyll theme. # it will display as the sub-title
|
tagline: A text-focused Jekyll theme # it will display as the sub-title
|
||||||
|
|
||||||
description: >- # used by seo meta and the atom feed
|
description: >- # used by seo meta and the atom feed
|
||||||
A minimal, portfolio, sidebar,
|
A minimal, portfolio, sidebar,
|
||||||
bootstrap Jekyll theme with responsive web design
|
bootstrap Jekyll theme with responsive web design
|
||||||
and focuses on text presentation.
|
and focuses on text presentation.
|
||||||
|
|
||||||
# Replace with the website url, e.g. 'https://username.github.io'
|
# fill in the protocol & hostname for your site, e.g., 'https://username.github.io'
|
||||||
url: 'protocol://domain'
|
url: ''
|
||||||
|
|
||||||
author: your_full_name # change to your full name
|
|
||||||
|
|
||||||
avatar: /assets/img/sample/avatar.jpg # support internet resources
|
|
||||||
|
|
||||||
github:
|
github:
|
||||||
username: github_username # change to your github username
|
username: github_username # change to your github username
|
||||||
@@ -31,7 +34,9 @@ twitter:
|
|||||||
username: twitter_username # change to your twitter username
|
username: twitter_username # change to your twitter username
|
||||||
|
|
||||||
social:
|
social:
|
||||||
name: your_full_name # it will shows as the copyright owner in Footer
|
# Change to your full name.
|
||||||
|
# It will be displayed as the default author of the posts and the copyright owner in the Footer
|
||||||
|
name: your_full_name
|
||||||
email: example@doamin.com # change to your email address
|
email: example@doamin.com # change to your email address
|
||||||
links:
|
links:
|
||||||
# The first element serves as the copyright owner's link
|
# The first element serves as the copyright owner's link
|
||||||
@@ -42,16 +47,7 @@ social:
|
|||||||
# - https://www.linkedin.com/in/username
|
# - https://www.linkedin.com/in/username
|
||||||
|
|
||||||
google_site_verification: google_meta_tag_verification # change to your verification string
|
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,
|
|
||||||
# change below value to '/projectname'.
|
|
||||||
baseurl: ''
|
|
||||||
|
|
||||||
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
|
||||||
timezone: Asia/Shanghai
|
|
||||||
|
|
||||||
google_analytics:
|
google_analytics:
|
||||||
id: '' # Fill with your Google Analytics ID
|
id: '' # Fill with your Google Analytics ID
|
||||||
@@ -64,36 +60,44 @@ google_analytics:
|
|||||||
proxy_endpoint: ''
|
proxy_endpoint: ''
|
||||||
cache: false # pv data local cache, good for the users from GFW area.
|
cache: false # pv data local cache, good for the users from GFW area.
|
||||||
|
|
||||||
|
# Prefer color scheme setting.
|
||||||
|
#
|
||||||
|
# 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: # [light|dark]
|
||||||
|
|
||||||
|
# The CDN endpoint for images.
|
||||||
|
# Notice that once it is assigned, the CDN url
|
||||||
|
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
||||||
|
#
|
||||||
|
# e.g. 'https://cdn.com'
|
||||||
|
img_cdn: ''
|
||||||
|
|
||||||
|
# the avatar on sidebar, support local or CORS resources
|
||||||
|
avatar: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/avatar.jpg
|
||||||
|
|
||||||
|
# boolean type, the global switch for ToC in posts.
|
||||||
|
toc: true
|
||||||
|
|
||||||
disqus:
|
disqus:
|
||||||
comments: false # boolean type, the global switch for posts comments.
|
comments: false # boolean type, the global switch for posts comments.
|
||||||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||||
|
|
||||||
|
|
||||||
# Prefer color scheme setting, available values:
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# light - Use the light color scheme
|
|
||||||
#
|
|
||||||
# dark - Use the dark color scheme
|
|
||||||
#
|
|
||||||
theme_mode: dual
|
|
||||||
|
|
||||||
# boolean type, global switch for ToC in posts.
|
|
||||||
toc: true
|
|
||||||
|
|
||||||
paginate: 10
|
paginate: 10
|
||||||
|
|
||||||
markdown: kramdown
|
# ------------ The following options are not recommended to be modified ------------------
|
||||||
|
|
||||||
highlighter: rouge
|
|
||||||
|
|
||||||
kramdown:
|
kramdown:
|
||||||
input: GFM
|
|
||||||
syntax_highlighter: rouge
|
syntax_highlighter: rouge
|
||||||
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
||||||
css_class: 'highlight'
|
css_class: highlight
|
||||||
# default_lang: console
|
# default_lang: console
|
||||||
span:
|
span:
|
||||||
line_numbers: false
|
line_numbers: false
|
||||||
@@ -102,23 +106,24 @@ kramdown:
|
|||||||
start_line: 1
|
start_line: 1
|
||||||
|
|
||||||
# DO NOT change this unless you're a Pro user on Jekyll and Web development,
|
# DO NOT change this unless you're a Pro user on Jekyll and Web development,
|
||||||
# or you think you're smart enough to change other relevant URLs within this template.
|
# Or you think you're smart enough to change other relevant URLs within this template.
|
||||||
permalink: /posts/:title/
|
permalink: /posts/:title/
|
||||||
|
|
||||||
|
collections:
|
||||||
|
tabs:
|
||||||
|
output: true
|
||||||
|
sort_by: order
|
||||||
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: "" # An empty string here means all files in the project
|
path: '' # An empty string here means all files in the project
|
||||||
type: posts
|
type: posts
|
||||||
values:
|
values:
|
||||||
layout: post
|
layout: post
|
||||||
comments: true # Enable comments in posts.
|
comments: true # Enable comments in posts.
|
||||||
toc: true # Display TOC column in posts.
|
toc: true # Display TOC column in posts.
|
||||||
location: Post
|
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Posts
|
|
||||||
url: /
|
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: _drafts
|
path: _drafts
|
||||||
@@ -126,44 +131,14 @@ defaults:
|
|||||||
comments: false
|
comments: false
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: tags
|
path: ''
|
||||||
values:
|
type: tabs # see `site.collections`
|
||||||
tab_active: Tags
|
|
||||||
location: Tag
|
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Home
|
|
||||||
url: /
|
|
||||||
-
|
|
||||||
label: Tags
|
|
||||||
url: /tabs/tags/
|
|
||||||
-
|
|
||||||
scope:
|
|
||||||
path: categories
|
|
||||||
values:
|
|
||||||
tab_active: Categories
|
|
||||||
location: Category
|
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Home
|
|
||||||
url: /
|
|
||||||
-
|
|
||||||
label: Categories
|
|
||||||
url: /tabs/categories/
|
|
||||||
-
|
|
||||||
scope:
|
|
||||||
path: tabs
|
|
||||||
values:
|
values:
|
||||||
layout: page
|
layout: page
|
||||||
|
permalink: /:title/
|
||||||
dynamic_title: true # Hide title in mobile screens.
|
dynamic_title: true # Hide title in mobile screens.
|
||||||
breadcrumb:
|
|
||||||
-
|
|
||||||
label: Home
|
|
||||||
url: /
|
|
||||||
|
|
||||||
|
|
||||||
sass:
|
sass:
|
||||||
sass_dir: /assets/css
|
|
||||||
style: compressed
|
style: compressed
|
||||||
|
|
||||||
compress_html:
|
compress_html:
|
||||||
@@ -173,28 +148,28 @@ compress_html:
|
|||||||
profile: false
|
profile: false
|
||||||
blanklines: false
|
blanklines: false
|
||||||
ignore:
|
ignore:
|
||||||
envs: []
|
envs: [development]
|
||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
- vendor # Avoid Jekyll mistakenly read the vendor directory on Travis-CI's VM .
|
- vendor
|
||||||
- Gemfile.lock
|
|
||||||
- Gemfile
|
- Gemfile
|
||||||
|
- Gemfile.lock
|
||||||
|
- '*.gem'
|
||||||
|
- '*.gemspec'
|
||||||
- tools
|
- tools
|
||||||
- docs
|
- docs
|
||||||
- README.md
|
- README.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
- gulpfile.js
|
||||||
|
- node_modules
|
||||||
|
- package.json
|
||||||
|
- package-lock.json
|
||||||
|
|
||||||
sitemap_exclude: # Sitemap will exclude the following items.
|
jekyll-archives:
|
||||||
fuzzy:
|
enabled: [categories, tags]
|
||||||
- /assets/
|
layouts:
|
||||||
accurate:
|
category: category
|
||||||
- /norobots/
|
tag: tag
|
||||||
- /tabs/
|
permalinks:
|
||||||
- /categories/
|
tag: /tags/:name/
|
||||||
- /tags/
|
category: /categories/:name/
|
||||||
- /posts/
|
|
||||||
- 404.html
|
|
||||||
- feed.xml
|
|
||||||
- sitemap.xml
|
|
||||||
- robots.txt
|
|
||||||
- redirects.json
|
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
# The contact options.
|
# The contact options.
|
||||||
# v2.3
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
-
|
-
|
||||||
type: github
|
type: github
|
||||||
@@ -21,11 +17,14 @@
|
|||||||
|
|
||||||
# Uncomment and complete the url below to enable more contact options
|
# Uncomment and complete the url below to enable more contact options
|
||||||
# -
|
# -
|
||||||
|
# type: mastodon
|
||||||
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
|
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
|
||||||
# url: '' # Fill with your mastodon account page
|
# url: '' # Fill with your mastodon account page
|
||||||
# -
|
# -
|
||||||
|
# type: linkedin
|
||||||
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
|
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
|
||||||
# url: '' # Fill with your Linkedin homepage
|
# url: '' # Fill with your Linkedin homepage
|
||||||
# -
|
# -
|
||||||
|
# type: stack-overflow
|
||||||
# icon: 'fab fa-stack-overflow'
|
# icon: 'fab fa-stack-overflow'
|
||||||
# url: '' # Fill with your stackoverflow homepage
|
# url: '' # Fill with your stackoverflow homepage
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
# The date format
|
# The date format
|
||||||
# v2.1
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
|
|
||||||
tooltip: "%a, %b %e, %Y, %l:%M %p %z"
|
tooltip: "%a, %b %e, %Y, %l:%M %p %z"
|
||||||
|
|
||||||
post:
|
post:
|
||||||
long: "%b %e, %Y"
|
long: "%b %e, %Y"
|
||||||
short: "%b %e"
|
short: "%b %e"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
# The label text of site.
|
# The label text of site.
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
|
|
||||||
panel:
|
panel:
|
||||||
lastmod: "Recent Update"
|
lastmod: Recent Update
|
||||||
trending_tags: "Trending Tags"
|
trending_tags: Trending Tags
|
||||||
toc: "Contents"
|
toc: Contents
|
||||||
|
|
||||||
post:
|
post:
|
||||||
relate_posts: "Further Reading"
|
relate_posts: Further Reading
|
||||||
|
share: Share
|
||||||
button:
|
button:
|
||||||
next: Newer
|
next: Newer
|
||||||
previous: Older
|
previous: Older
|
||||||
|
|
||||||
search_hint: "Search" # text show on search bar
|
search_hint: Search # text show on search bar
|
||||||
|
|
||||||
|
pin_prompt: Pinned # pinned prompt
|
||||||
|
|
||||||
|
read_time_unit: min # see posts' time to read
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
# License data.
|
# License data
|
||||||
#
|
|
||||||
# v2.1
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
|
|
||||||
license:
|
license:
|
||||||
name: CC BY 4.0
|
name: CC BY 4.0
|
||||||
@@ -14,4 +8,4 @@ brief: Some rights reserved.
|
|||||||
|
|
||||||
verbose: >-
|
verbose: >-
|
||||||
Except where otherwise noted, the blog posts on this site are licensed
|
Except where otherwise noted, the blog posts on this site are licensed
|
||||||
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
|
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
# Sharing options at the bottom of the post.
|
# Sharing options at the bottom of the post.
|
||||||
# Icons from <https://fontawesome.com/>
|
# Icons from <https://fontawesome.com/>
|
||||||
#
|
|
||||||
# v2.1
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
label: "Share"
|
|
||||||
|
|
||||||
platforms:
|
platforms:
|
||||||
-
|
-
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
# The tab data.
|
|
||||||
# v2.1
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
name: Home
|
|
||||||
icon: "fas fa-home"
|
|
||||||
-
|
|
||||||
name: Categories
|
|
||||||
icon: "fas fa-stream"
|
|
||||||
path: tabs
|
|
||||||
url: categories
|
|
||||||
-
|
|
||||||
name: "Tags"
|
|
||||||
icon: "fas fa-tags"
|
|
||||||
path: tabs
|
|
||||||
url: tags
|
|
||||||
-
|
|
||||||
name: "Archives"
|
|
||||||
path: tabs
|
|
||||||
url: archives
|
|
||||||
icon: "fas fa-archive"
|
|
||||||
-
|
|
||||||
name: "About"
|
|
||||||
icon: "fas fa-info"
|
|
||||||
path: tabs
|
|
||||||
url: about
|
|
||||||
@@ -1,54 +1,10 @@
|
|||||||
<!--
|
<!--
|
||||||
CSS selector for site.
|
CSS selector for site.
|
||||||
Chirpy v2.3
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT Licensed
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% if page.layout == 'home' %}
|
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
|
||||||
<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.type == '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.type == '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.type == 'archives' %}
|
|
||||||
|
|
||||||
<link rel="preload" href="{{ '/assets/css/archives.css' | relative_url }}" as="style">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/archives.css' | relative_url }}">
|
|
||||||
|
|
||||||
{% 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 }}">
|
|
||||||
|
|
||||||
{% 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 %}
|
|
||||||
|
|
||||||
|
{% if site.toc and page.toc %}
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,28 +1,25 @@
|
|||||||
<!--
|
<!--
|
||||||
The Disqus lazy loading.
|
The Disqus lazy loading.
|
||||||
Powered by: https://osvaldas.info/lazy-loading-disqus-comments
|
Powered by: <https://github.com/osvaldasvalutis/disqusLoader.js>
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="disqus" class="pt-2 pb-2">
|
<div id="disqus" class="pt-2 pb-2">
|
||||||
<p class="font-italic text-center text-muted small">
|
<p class="text-center text-muted small pb-5">
|
||||||
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="{{ site.baseurl }}/assets/js/lib/jquery.disqusloader.min.js"></script>
|
<script src="{{ '/assets/js/lib/jquery.disqusloader.min.js' | relative_url }}"></script>
|
||||||
<script>
|
<script>
|
||||||
var options = {
|
const options = {
|
||||||
scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
|
scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
|
||||||
|
|
||||||
disqusConfig: function() {
|
disqusConfig: function() {
|
||||||
this.page.url = '{{ site.url | append: site.baseurl | append: page.url }}';
|
this.page.title = '{{ page.title }}';
|
||||||
|
this.page.url = '{{ page.url | absolute_url }}';
|
||||||
this.page.identifier = '{{ page.url }}';
|
this.page.identifier = '{{ page.url }}';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.disqusLoader('#disqus', options);
|
$.disqusLoader('#disqus', options);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps
|
The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps
|
||||||
Generated by: https://www.favicon-generator.org/
|
Generated by: https://www.favicon-generator.org/
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2019 Cotes Chung
|
|
||||||
Published under the MIT license
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% capture icon_url %}{{ site.baseurl }}/assets/img/favicons{% endcapture %}
|
{% capture icon_url %}{{ site.baseurl }}/assets/img/favicons{% endcapture %}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
The Footer
|
The Footer
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<footer class="d-flex w-100 justify-content-center">
|
<footer class="d-flex w-100 justify-content-center">
|
||||||
@@ -22,9 +18,10 @@
|
|||||||
<div class="footer-right">
|
<div class="footer-right">
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
Powered by
|
Powered by
|
||||||
<a href="https://jekyllrb.com" target="_blank">Jekyll</a>
|
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
|
||||||
with
|
with
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/">Chirpy</a>
|
<a href="https://github.com/cotes2020/jekyll-theme-chirpy"
|
||||||
|
target="_blank" rel="noopener">Chirpy</a>
|
||||||
theme.
|
theme.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
<!--
|
<!--
|
||||||
The GA snippet
|
The GA snippet
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script 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>
|
<script>
|
||||||
window.dataLayer = window.dataLayer || [];
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
function gtag(){dataLayer.push(arguments);}
|
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>
|
</script>
|
||||||
|
|||||||
@@ -1,15 +1,29 @@
|
|||||||
<!--
|
<!--
|
||||||
The Head
|
The Head
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
|
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||||
|
<meta name="pv-cache-enabled" content="{{ site.google_analytics.pv.enabled }}">
|
||||||
|
|
||||||
|
{% if site.google_analytics.pv.enabled %}
|
||||||
|
{% if site.google_analytics.pv.proxy_endpoint != ''
|
||||||
|
and site.google_analytics.pv.proxy_endpoint %}
|
||||||
|
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if site.google_analytics.pv.cache %}
|
||||||
|
<meta name="pv-cache-data" content="{{ '/assets/js/data/pageviews.json' | relative_url }}">
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% seo title=false %}
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
{%- unless page.layout == "home" -%}
|
{%- unless page.layout == "home" -%}
|
||||||
{{ page.title | append: " | "}}
|
{{ page.title | append: " | "}}
|
||||||
@@ -17,8 +31,6 @@
|
|||||||
{{ site.title }}
|
{{ site.title }}
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
{% seo title=false %}
|
|
||||||
|
|
||||||
{% include favicons.html %}
|
{% include favicons.html %}
|
||||||
|
|
||||||
<!-- Google Fonts -->
|
<!-- Google Fonts -->
|
||||||
@@ -44,10 +56,6 @@
|
|||||||
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
||||||
|
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link rel="preload" as="style"
|
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
|
||||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin>
|
|
||||||
|
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
||||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
||||||
@@ -62,14 +70,11 @@
|
|||||||
|
|
||||||
<!-- JavaScripts -->
|
<!-- JavaScripts -->
|
||||||
|
|
||||||
<link rel="preload" as="script" href="https://cdn.jsdelivr.net/npm/jquery@3.4.1"
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
||||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1"
|
<script defer
|
||||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" async></script>
|
|
||||||
|
|
||||||
{% include js-selector.html %}
|
{% include js-selector.html %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -1,45 +1,56 @@
|
|||||||
<!--
|
<!--
|
||||||
JS selector for site.
|
JS selector for site.
|
||||||
Chirpy v2.3
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT Licensed
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% if page.layout == 'home' %}
|
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||||
|
{% if site.google_analytics.pv.enabled %}
|
||||||
<script src="{{ '/assets/js/home.min.js' | relative_url }}" async></script>
|
<!-- pv-report needs countup.js -->
|
||||||
|
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
||||||
{% elsif page.layout == 'post' %}
|
<script async src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
|
||||||
|
|
||||||
<script src="{{ '/assets/js/post.min.js' | relative_url }}" async></script>
|
|
||||||
|
|
||||||
{% if page.math %}
|
|
||||||
<!-- MathJax -->
|
|
||||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% elsif page.layout == 'page' %}
|
|
||||||
|
|
||||||
{% if page.type == 'categories' %}
|
|
||||||
<script src="{{ '/assets/js/categories.min.js' | relative_url }}" async></script>
|
|
||||||
{% else %}
|
|
||||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if page.layout == 'home'
|
||||||
|
or page.layout == 'post'
|
||||||
|
or page.layout == 'categories' %}
|
||||||
|
{% assign type = page.layout %}
|
||||||
|
{% else %}
|
||||||
|
{% assign type = "page" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign js = type | prepend: '/assets/js/dist/' | append: '.min.js' %}
|
||||||
|
<script defer src="{{ js | relative_url }}"></script>
|
||||||
|
|
||||||
|
{% if page.math %}
|
||||||
|
<!-- MathJax -->
|
||||||
|
<script>
|
||||||
|
// see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options>
|
||||||
|
MathJax = {
|
||||||
|
tex: {
|
||||||
|
inlineMath: [ // start/end delimiter pairs for in-line math
|
||||||
|
['$','$'],
|
||||||
|
['\\(','\\)']
|
||||||
|
],
|
||||||
|
displayMath: [ // start/end delimiter pairs for display math
|
||||||
|
['$$', '$$'],
|
||||||
|
['\\[', '\\]']
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||||
|
<script type="text/javascript" id="MathJax-script" async
|
||||||
|
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if jekyll.environment == 'production' %}
|
{% if jekyll.environment == 'production' %}
|
||||||
|
|
||||||
{% include google-analytics.html %}
|
|
||||||
|
|
||||||
<!-- PWA -->
|
<!-- PWA -->
|
||||||
<script src="{{ '/app.js' | relative_url }}" defer></script>
|
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
||||||
|
|
||||||
|
<!-- GA -->
|
||||||
|
{% if site.google_analytics.id %}
|
||||||
|
{% include google-analytics.html %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<!-- image lazy load: https://github.com/ApoorvSaxena/lozad.js -->
|
<!--
|
||||||
|
image lazy load: https://github.com/ApoorvSaxena/lozad.js
|
||||||
|
-->
|
||||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const imgs = document.querySelectorAll('#post-wrapper img');
|
const imgs = document.querySelectorAll('.post-content img');
|
||||||
const observer = lozad(imgs);
|
const observer = lozad(imgs);
|
||||||
observer.observe();
|
observer.observe();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
29
_includes/mermaid.html
Normal file
29
_includes/mermaid.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<!--
|
||||||
|
mermaid-js loader
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/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>
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
Switch the mode between dark and light.
|
Switch the mode between dark and light.
|
||||||
|
|
||||||
v2.1
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<i class="mode-toggle fas fa-sun" dark-mode-invisible></i>
|
<i class="mode-toggle fas fa-adjust"></i>
|
||||||
<i class="mode-toggle fas fa-moon" light-mode-invisible></i>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@@ -18,8 +12,8 @@
|
|||||||
static get LIGHT_MODE() { return "light"; }
|
static get LIGHT_MODE() { return "light"; }
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (this.mode != null) {
|
if (this.hasMode) {
|
||||||
if (this.mode == ModeToggle.DARK_MODE) {
|
if (this.isDarkMode) {
|
||||||
if (!this.isSysDarkPrefer) {
|
if (!this.isSysDarkPrefer) {
|
||||||
this.setDark();
|
this.setDark();
|
||||||
}
|
}
|
||||||
@@ -34,8 +28,8 @@
|
|||||||
|
|
||||||
/* always follow the system prefers */
|
/* always follow the system prefers */
|
||||||
this.sysDarkPrefers.addListener(function() {
|
this.sysDarkPrefers.addListener(function() {
|
||||||
if (self.mode != null) {
|
if (self.hasMode) {
|
||||||
if (self.mode == ModeToggle.DARK_MODE) {
|
if (self.isDarkMode) {
|
||||||
if (!self.isSysDarkPrefer) {
|
if (!self.isSysDarkPrefer) {
|
||||||
self.setDark();
|
self.setDark();
|
||||||
}
|
}
|
||||||
@@ -48,6 +42,8 @@
|
|||||||
|
|
||||||
self.clearMode();
|
self.clearMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.updateMermaid();
|
||||||
});
|
});
|
||||||
|
|
||||||
} /* constructor() */
|
} /* constructor() */
|
||||||
@@ -74,16 +70,43 @@
|
|||||||
|
|
||||||
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
||||||
|
|
||||||
get isLightkMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
||||||
|
|
||||||
get hasMode() { return this.mode != null; }
|
get hasMode() { return this.mode != null; }
|
||||||
|
|
||||||
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
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() {
|
flipMode() {
|
||||||
if (this.hasMode) {
|
if (this.hasMode) {
|
||||||
if (this.isSysDarkPrefer) {
|
if (this.isSysDarkPrefer) {
|
||||||
if (this.isLightkMode) {
|
if (this.isLightMode) {
|
||||||
this.clearMode();
|
this.clearMode();
|
||||||
} else {
|
} else {
|
||||||
this.setLight();
|
this.setLight();
|
||||||
@@ -105,6 +128,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.updateMermaid();
|
||||||
|
|
||||||
} /* flipMode() */
|
} /* flipMode() */
|
||||||
|
|
||||||
} /* ModeToggle */
|
} /* ModeToggle */
|
||||||
@@ -112,7 +137,9 @@
|
|||||||
let toggle = new ModeToggle();
|
let toggle = new ModeToggle();
|
||||||
|
|
||||||
$(".mode-toggle").click(function() {
|
$(".mode-toggle").click(function() {
|
||||||
|
|
||||||
toggle.flipMode();
|
toggle.flipMode();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{% comment %}
|
{% comment %}
|
||||||
Remove the line number of the code snippet.
|
Remove the line number of the code snippet.
|
||||||
v2.2
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
Published under the MIT License
|
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% assign content = include.content %}
|
{% assign content = include.content %}
|
||||||
|
|||||||
@@ -1,70 +1,57 @@
|
|||||||
<!--
|
<!--
|
||||||
The Pannel on right side (Desktop views)
|
The Pannel on right side (Desktop views)
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
||||||
|
|
||||||
<div class="access">
|
<div class="access">
|
||||||
|
|
||||||
{% if site.data.updates %}
|
{% include update-list.html %}
|
||||||
|
|
||||||
{% include update-list.html %}
|
{% if update_list.size > 0 %}
|
||||||
|
|
||||||
{% if update_list.size > 0 %}
|
|
||||||
|
|
||||||
<div id="access-lastmod" class="post">
|
<div id="access-lastmod" class="post">
|
||||||
<h3 data-toc-skip>
|
<span>{{- site.data.label.panel.lastmod | default: 'Recent Update' -}}</span>
|
||||||
{{- site.data.label.panel.lastmod -}}
|
|
||||||
</h3>
|
|
||||||
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
||||||
|
|
||||||
{% for item in update_list %}
|
{% for item in update_list %}
|
||||||
{% assign post_url = item | split: "::" | last | url_encode | prepend: "/posts/" | append: "/" %}
|
{% assign index = item | split: "::" | last | plus: 0 %}
|
||||||
{% assign post = site.posts | where: "url", post_url | first %}
|
{% assign post = site.posts[index] %}
|
||||||
|
{% assign url = post.url | relative_url %}
|
||||||
{% if post %}
|
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
||||||
{% assign url = post.url | relative_url %}
|
|
||||||
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- #access-lastmod -->
|
</div> <!-- #access-lastmod -->
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %} <!-- site.data.updates -->
|
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
|
|
||||||
{% if trending_tags.size > 0 %}
|
{% if trending_tags.size > 0 %}
|
||||||
<div id="access-tags">
|
<div id="access-tags">
|
||||||
<h3 data-toc-skip>
|
<span>{{- site.data.label.panel.trending_tags | default: 'Trending Tags' -}}</span>
|
||||||
{{- site.data.label.panel.trending_tags -}}
|
|
||||||
</h3>
|
|
||||||
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
||||||
|
|
||||||
{% for tag in trending_tags %}
|
{% for tag_name in trending_tags %}
|
||||||
{% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
|
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div> <!-- .access -->
|
</div> <!-- .access -->
|
||||||
|
|
||||||
{% if page.layout == 'post' and site.toc and page.toc %}
|
{% if include.toc %}
|
||||||
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
<!-- BS-toc.js will be loaded at medium priority -->
|
||||||
<h3 data-toc-skip class="pl-3 pt-2 mb-2">
|
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
|
||||||
{{- site.data.label.panel.toc -}}
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
||||||
</h3>
|
<span class="pl-3 pt-2 mb-2">
|
||||||
<nav id="toc" data-toggle="toc"></nav>
|
{{- site.data.label.panel.toc | default: 'Contents' -}}
|
||||||
</div>
|
</span>
|
||||||
|
<nav id="toc" data-toggle="toc"></nav>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div> <!-- #panel-wrapper -->
|
</div> <!-- #panel-wrapper -->
|
||||||
|
|||||||
@@ -1,31 +1,30 @@
|
|||||||
<!--
|
<!--
|
||||||
Navigation buttons at the bottom of the post.
|
Navigation buttons at the bottom of the post.
|
||||||
|
|
||||||
v2.1
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div class="post-navigation d-flex justify-content-between">
|
<div class="post-navigation d-flex justify-content-between">
|
||||||
{% if page.previous.url %}
|
{% if page.previous.url %}
|
||||||
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary">
|
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
||||||
|
prompt="{{ site.data.label.post.button.previous | default: 'previous' }}">
|
||||||
<p>{{ page.previous.title }}</p>
|
<p>{{ page.previous.title }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="btn btn-outline-primary disabled">
|
<span class="btn btn-outline-primary disabled"
|
||||||
|
prompt="{{ site.data.label.post.button.previous | default: 'previous' }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.next.url %}
|
{% if page.next.url %}
|
||||||
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary">
|
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
||||||
|
prompt="{{ site.data.label.post.button.next | default: 'next' }}">
|
||||||
<p>{{ page.next.title }}</p>
|
<p>{{ page.next.title }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="btn btn-outline-primary disabled">
|
<span class="btn btn-outline-primary disabled"
|
||||||
|
prompt="{{ site.data.label.post.button.next | default: 'next' }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,26 +1,19 @@
|
|||||||
<!--
|
<!--
|
||||||
The paginator for post list on HomgPage.
|
The paginator for post list on HomgPage.
|
||||||
|
|
||||||
v2.1
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ul class="pagination mt-4 mb-0 pl-lg-2">
|
<ul class="pagination mt-4 mb-0 pl-lg-2">
|
||||||
<!-- left arrow -->
|
<!-- left arrow -->
|
||||||
{% if paginator.previous_page %}
|
{% if paginator.previous_page %}
|
||||||
<li class="page-item">
|
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
||||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}{{ paginator.previous_page_path }}">
|
{% else %}
|
||||||
|
{% assign prev_url = "#" %}
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
|
||||||
|
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
|
||||||
<i class="fas fa-angle-left"></i>
|
<i class="fas fa-angle-left"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
|
||||||
<li class="page-item disabled">
|
|
||||||
<a class="page-link btn-box-shadow" href="#"><i class="fas fa-angle-left"></i></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
<!-- endof left arrow -->
|
|
||||||
|
|
||||||
<!-- page numbers -->
|
<!-- page numbers -->
|
||||||
{% assign left_ellipsis = false %}
|
{% assign left_ellipsis = false %}
|
||||||
@@ -51,38 +44,37 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if show %}
|
{% if show %}
|
||||||
<!-- show number -->
|
<!-- show number -->
|
||||||
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
||||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
|
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<!-- hide number -->
|
||||||
|
{% if i < pre and left_ellipsis == false %}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<span class="page-link btn-box-shadow">...</span>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% assign left_ellipsis = true %}
|
||||||
<!-- hide number -->
|
{% elsif i > next and right_ellipsis == false %}
|
||||||
{% if i < pre and left_ellipsis == false %}
|
<li class="page-item disabled">
|
||||||
<li class="page-item disabled">
|
<span class="page-link btn-box-shadow">...</span>
|
||||||
<span class="page-link btn-box-shadow">...</span>
|
</li>
|
||||||
</li>
|
{% assign right_ellipsis = true %}
|
||||||
{% assign left_ellipsis = true %}
|
|
||||||
{% elsif i > next and right_ellipsis == false %}
|
|
||||||
<li class="page-item disabled">
|
|
||||||
<span class="page-link btn-box-shadow">...</span>
|
|
||||||
</li>
|
|
||||||
{% assign right_ellipsis = true %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<!-- right arrow -->
|
<!-- right arrow -->
|
||||||
{% if paginator.next_page %}
|
{% if paginator.next_page_path %}
|
||||||
<li class="page-item">
|
{% assign next_url = paginator.next_page_path | relative_url %}
|
||||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}{{ paginator.next_page_path }}">
|
{% else %}
|
||||||
|
{% assign next_url = "#" %}
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
|
||||||
|
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
|
||||||
<i class="fas fa-angle-right"></i>
|
<i class="fas fa-angle-right"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
|
||||||
<li class="page-item disabled">
|
|
||||||
<a class="page-link btn-box-shadow" href="#"><i class="fas fa-angle-right"></i></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</ul> <!-- .pagination -->
|
</ul> <!-- .pagination -->
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
<!--
|
<!--
|
||||||
Post sharing snippet
|
Post sharing snippet
|
||||||
|
|
||||||
v2.1
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2019 Cotes Chung
|
|
||||||
Published under the MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div class="share-wrapper">
|
<div class="share-wrapper">
|
||||||
<span class="share-label text-muted mr-1">{{ site.data.share.label }}</span>
|
<span class="share-label text-muted mr-1">{{ site.data.label.post.share | default: 'Share' }}</span>
|
||||||
<span class="share-icons">
|
<span class="share-icons">
|
||||||
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
||||||
{% assign url = page.url | relative_url | prepend: site.url %}
|
{% assign url = page.url | absolute_url %}
|
||||||
|
|
||||||
{% for share in site.data.share.platforms %}
|
{% for share in site.data.share.platforms %}
|
||||||
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
||||||
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
||||||
title="{{ share.type }}" target="_blank">
|
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
||||||
<i class="fa-fw {{ share.icon }}"></i>
|
<i class="fa-fw {{ share.icon }}"></i>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -25,4 +20,4 @@
|
|||||||
data-toggle="tooltip" data-placement="top" title="Copy link"></i>
|
data-toggle="tooltip" data-placement="top" title="Copy link"></i>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
19
_includes/read-time.html
Normal file
19
_includes/read-time.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!--
|
||||||
|
Calculate the post's reading time, and display the word count in tooltip
|
||||||
|
-->
|
||||||
|
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
||||||
|
|
||||||
|
<!-- words per minute -->
|
||||||
|
{% assign wpm = 180 %}
|
||||||
|
{% assign min_time = 1 %}
|
||||||
|
|
||||||
|
{% assign read_time = words | divided_by: wpm %}
|
||||||
|
|
||||||
|
{% unless read_time > 0 %}
|
||||||
|
{% assign read_time = min_time %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
<!-- return element -->
|
||||||
|
<span class="readtime" data-toggle="tooltip" data-placement="bottom" title="{{ words }} words">
|
||||||
|
{{- read_time -}}{{" "}}{{- site.data.label.read_time_unit | default: "min" -}}
|
||||||
|
</span>
|
||||||
@@ -5,23 +5,62 @@
|
|||||||
{% assign _content = include.content %}
|
{% 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>' %}
|
{% if _content contains '<table>' %}
|
||||||
{% assign _content = _content | replace: '<table>', '<div class="table-wrapper"><table>' %}
|
{% assign _content = _content
|
||||||
{% assign _content = _content | replace: '</table>', '</table></div>' %}
|
| replace: '<table>', '<div class="table-wrapper"><table>'
|
||||||
{% assign _content = _content | replace: '</table></div></code>', '</table></code>' %}
|
| replace: '</table>', '</table></div>'
|
||||||
|
| replace: '</table></div></code>', '</table></code>'
|
||||||
|
%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Fixed kramdown code highlight rendering:
|
Fixed kramdown code highlight rendering:
|
||||||
https://github.com/penibelst/jekyll-compress-html/issues/101
|
https://github.com/penibelst/jekyll-compress-html/issues/101
|
||||||
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
||||||
-->
|
-->
|
||||||
{% if _content contains '<pre class="highlight">' %}
|
{% if _content contains '<pre class="highlight">' %}
|
||||||
{% assign _content = _content | replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code' %}
|
{% assign _content = _content
|
||||||
{% assign _content = _content | replace: '</code></pre></div>', '</code></div>' %}
|
| replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code'
|
||||||
|
| replace: '</code></pre></div>', '</code></div>'
|
||||||
|
%}
|
||||||
{% endif %}
|
{% 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 %}
|
||||||
|
|
||||||
|
{% if _content contains '<img src="' %}
|
||||||
|
|
||||||
|
{% if site.img_cdn != '' %}
|
||||||
|
{% assign img_path_replacement = '<img src="' | append: site.img_cdn | append: '/' %}
|
||||||
|
{% else %}
|
||||||
|
{% assign img_path_replacement = '<img src="' | append: site.baseurl | append: '/' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign _content = _content | replace: '<img src="/', img_path_replacement %}
|
||||||
|
|
||||||
|
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||||
|
{% assign lozad = true %}
|
||||||
|
{% assign img_placehodler
|
||||||
|
= 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' %}
|
||||||
|
|
||||||
|
{% assign lozad_replacement = '<img src="'
|
||||||
|
| append: img_placehodler
|
||||||
|
| append: '" data-src="' %}
|
||||||
|
|
||||||
|
{% assign _content = _content | replace: '<img src="', lozad_replacement %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- return -->
|
||||||
{{ _content }}
|
{{ _content }}
|
||||||
|
|
||||||
|
{% if lozad %}
|
||||||
|
{% include lozad.html %}
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
Recommend the other 3 posts according to the tags and categories of the current post,
|
Recommend the other 3 posts according to the tags and categories of the current post,
|
||||||
if the number is not enough, use the other latest posts to supplement.
|
if the number is not enough, use the other latest posts to supplement.
|
||||||
|
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2019 Cotes Chung
|
|
||||||
Published under the MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- The total size of related posts -->
|
<!-- The total size of related posts -->
|
||||||
@@ -85,7 +80,8 @@
|
|||||||
|
|
||||||
{% if index_list.size > 0 %}
|
{% if index_list.size > 0 %}
|
||||||
<div id="related-posts" class="mt-5 mb-2 mb-sm-4">
|
<div id="related-posts" class="mt-5 mb-2 mb-sm-4">
|
||||||
<h3 class="pt-2 mt-1 mb-4 ml-1" data-toc-skip>{{ site.data.label.post.relate_posts }}</h3>
|
<h3 class="pt-2 mt-1 mb-4 ml-1"
|
||||||
|
data-toc-skip>{{ site.data.label.post.relate_posts | default: 'Further Reading' }}</h3>
|
||||||
<div class="card-deck mb-4">
|
<div class="card-deck mb-4">
|
||||||
{% for entry in index_list %}
|
{% for entry in index_list %}
|
||||||
{% assign index = entry | plus: 0 %}
|
{% assign index = entry | plus: 0 %}
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
<!--
|
<!--
|
||||||
Jekyll Simple Search loader
|
Jekyll Simple Search loader
|
||||||
v2.0
|
See: <https://github.com/christian-fei/Simple-Jekyll-Search>
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% capture result_elem %}
|
{% capture result_elem %}
|
||||||
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
|
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
|
||||||
<a href="{{ site.url }}{url}">{title}</a>
|
<a href="{{ site.url }}{url}">{title}</a>
|
||||||
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
||||||
<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>{categories}</div>
|
{categories}
|
||||||
<div><i class="fa fa-tag fa-fw"></i>{tags}</div>
|
{tags}
|
||||||
</div>
|
</div>
|
||||||
<p>{snippet}</p>
|
<p>{snippet}</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,8 +22,25 @@
|
|||||||
SimpleJekyllSearch({
|
SimpleJekyllSearch({
|
||||||
searchInput: document.getElementById('search-input'),
|
searchInput: document.getElementById('search-input'),
|
||||||
resultsContainer: document.getElementById('search-results'),
|
resultsContainer: document.getElementById('search-results'),
|
||||||
json: '{{ site.baseurl }}/assets/js/data/search.json',
|
json: '{{ '/assets/js/data/search.json' | relative_url }}',
|
||||||
searchResultTemplate: '{{ result_elem | strip_newlines }}',
|
searchResultTemplate: '{{ result_elem | strip_newlines }}',
|
||||||
noResultsText: '{{ not_found }}'
|
noResultsText: '{{ not_found }}',
|
||||||
|
templateMiddleware: function(prop, value, template) {
|
||||||
|
if (prop === 'categories') {
|
||||||
|
if (value === '') {
|
||||||
|
return `${value}`;
|
||||||
|
} else {
|
||||||
|
return `<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prop === 'tags') {
|
||||||
|
if (value === '') {
|
||||||
|
return `${value}`;
|
||||||
|
} else {
|
||||||
|
return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,23 +1,19 @@
|
|||||||
<!--
|
<!--
|
||||||
The Search results
|
The Search results
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
|
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
|
||||||
<div class="col-12 col-xl-11 post-content">
|
<div class="col-12 col-sm-11 post-content">
|
||||||
<div id="search-hints">
|
<div id="search-hints">
|
||||||
<h4 class="text-muted mb-4">{{ site.data.label.panel.trending_tags }}</h4>
|
<h4 class="text-muted mb-4">{{ site.data.label.panel.trending_tags | default: 'Trending Tags' }}</h4>
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
|
|
||||||
{% for tag in trending_tags %}
|
{% 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>
|
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,90 +1,91 @@
|
|||||||
<!--
|
<!--
|
||||||
The Side Bar
|
The Side Bar
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
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">
|
<div class="profile-wrapper text-center">
|
||||||
<a href="{{ site.baseurl }}/" alt="avatar">
|
<div id="avatar">
|
||||||
{% assign avatar_url = site.avatar %}
|
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
|
||||||
{% capture start %}{{ site.avatar | slice: 0 }}{% endcapture %}
|
{% capture avatar_url %}
|
||||||
{% if start == '/' %}
|
{%- if site.avatar contains '://' -%}
|
||||||
{% assign avatar_url = avatar_url | prepend: site.baseurl %}
|
{{ site.avatar }}
|
||||||
{% endif %}
|
{%- elsif site.img_cdn != '' and site.img_cdn -%}
|
||||||
|
{{ site.avatar | prepend: site.img_cdn }}
|
||||||
|
{%- else -%}
|
||||||
|
{{ site.avatar | relative_url }}
|
||||||
|
{%- endif -%}
|
||||||
|
{% endcapture %}
|
||||||
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-text mt-3">
|
<div class="site-title mt-3">
|
||||||
<div class="site-title">
|
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
|
||||||
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
|
|
||||||
</div>
|
|
||||||
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="nav flex-column">
|
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
|
||||||
{% assign page_urls = page.url | split: "/" %}
|
|
||||||
|
|
||||||
{% for item in site.data.tabs %}
|
</div><!-- .profile-wrapper -->
|
||||||
{% assign ref = site.baseurl | append: "/" %}
|
|
||||||
|
|
||||||
{% if item.path %}
|
<ul class="w-100">
|
||||||
{% assign ref = ref | append: item.path | append: "/" %}
|
<!-- home -->
|
||||||
{% if item.url %}
|
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
||||||
{% assign ref = ref | append: item.url | append: "/" %}
|
<a href="{{ '/' | relative_url }}" class="nav-link">
|
||||||
{% endif %}
|
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
{% endif %}
|
<span>{{ "HOME" }}</span>
|
||||||
|
</a>
|
||||||
<li class="nav-item d-flex justify-content-center
|
</li>
|
||||||
{% if item.url == page_urls.last
|
<!-- the real tabs -->
|
||||||
or item.name == page.tab_active
|
{% for tab in site.tabs %}
|
||||||
or item.name == "Home" and page.layout == "home" %}active{% endif %}">
|
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
|
||||||
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
|
<a href="{{ tab.url | relative_url }}" class="nav-link">
|
||||||
<i class="fa-fw {{ item.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
<span>{{ item.name | upcase }}</span>
|
<span>{{ tab.title | upcase }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li> <!-- .nav-item -->
|
</li> <!-- .nav-item -->
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</ul> <!-- ul.nav.flex-column -->
|
</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" %}
|
{% if url %}
|
||||||
<span id="mode-toggle-wrapper">
|
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
||||||
{% include mode-toggle.html %}
|
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
|
||||||
</span>
|
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
||||||
<span class="icon-border"></span>
|
<i class="{{ entry.icon }}"></i>
|
||||||
{% endif %}
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for entry in site.data.contact %}
|
{% endfor %}
|
||||||
{% 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:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))
|
|
||||||
{%- elsif entry.type == 'rss' -%}
|
|
||||||
{{ "/feed.xml" | relative_url }}
|
|
||||||
{%- else -%}
|
|
||||||
{{ entry.url }}
|
|
||||||
{%- endif -%}
|
|
||||||
{% endcapture %}
|
|
||||||
|
|
||||||
{% if url != '' %}
|
{% unless site.theme_mode %}
|
||||||
<a href="{{ url }}" {% unless entry.noblank %}target="_blank"{% endunless %}>
|
{% if site.data.contact.size > 0 %}
|
||||||
<i class="{{ entry.icon }}"></i>
|
<span class="icon-border order-2"></span>
|
||||||
</a>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
<span id="mode-toggle-wrapper" class="order-1">
|
||||||
|
{% include mode-toggle.html %}
|
||||||
|
</span>
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
</div> <!-- .sidebar-bottom -->
|
||||||
|
|
||||||
|
</div><!-- #sidebar -->
|
||||||
|
|||||||
@@ -1,27 +1,31 @@
|
|||||||
<!--
|
<!--
|
||||||
Date format snippet
|
Date format snippet
|
||||||
|
See: /assets/js/_utils/timeage.js
|
||||||
v2.4.1
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
{% assign tooltip_df = site.data.date_format.tooltip | default: '%a, %b %e, %Y, %l:%M %p %z' %}
|
||||||
|
{% assign post_long_df = site.data.date_format.post.long | default: '%b %e, %Y' %}
|
||||||
|
{% assign post_short_df = site.data.date_format.post.short | default: '%b %e' %}
|
||||||
|
|
||||||
<span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
|
<span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
|
||||||
{% if include.tooltip %}
|
{% if include.tooltip %}
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
data-placement="bottom"
|
data-placement="bottom"
|
||||||
title="{{ include.date | date: site.data.date_format.tooltip }}"
|
title="{{ include.date | date: tooltip_df }}"
|
||||||
{% endif %}>
|
{% endif %}
|
||||||
|
|
||||||
|
{% if include.prefix %}prefix="{{ include.prefix }} "{% endif%}
|
||||||
|
{% if include.prep %}prep="{{ include.prep }}"{% endif %} >
|
||||||
|
|
||||||
{% assign this_year = site.time | date: "%Y" %}
|
{% assign this_year = site.time | date: "%Y" %}
|
||||||
{% assign post_year = include.date | date: "%Y" %}
|
{% assign post_year = include.date | date: "%Y" %}
|
||||||
|
|
||||||
{% if post_year == this_year %}
|
{% if post_year == this_year %}
|
||||||
{{ include.date | date: site.data.date_format.post.short }}
|
{{ include.date | date: post_short_df }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ include.date | date: site.data.date_format.post.long }}
|
{{ include.date | date: post_long_df }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,50 +1,69 @@
|
|||||||
<!--
|
<!--
|
||||||
The Top Bar
|
The Top Bar
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2017-2019 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="topbar-wrapper" class="row justify-content-center topbar-down">
|
<div id="topbar-wrapper" class="row justify-content-center topbar-down">
|
||||||
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
|
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
|
||||||
<span id="breadcrumb">
|
<span id="breadcrumb">
|
||||||
{% for item in page.breadcrumb %}
|
|
||||||
{% if item.url %}
|
{% assign paths = page.url | split: '/' %}
|
||||||
|
|
||||||
|
{% if paths.size == 0 %}
|
||||||
|
<!-- index page -->
|
||||||
|
<span>{{ 'Posts' }}</span>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% for item in paths %}
|
||||||
|
|
||||||
|
{% if forloop.first %}
|
||||||
|
{% unless page.layout == 'post' %}
|
||||||
|
<span>
|
||||||
|
<a href="{{ '/' | relative_url }}">{{ 'Home' }}</a>
|
||||||
|
</span>
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
{% elsif forloop.last %}
|
||||||
|
<span>{{ page.title }}</span>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ site.baseurl }}{{ item.url | remove: '.html'}}">
|
{% assign url = item %}
|
||||||
{{ item.label }}
|
{% if item == 'posts' and page.layout == 'post' %}
|
||||||
|
{% assign url = '/' %}
|
||||||
|
{% endif %}
|
||||||
|
<a href="{{ url | relative_url }}">
|
||||||
|
{{ item | capitalize }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
|
||||||
<span>{{ item.label }}</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% unless page.layout == "home" %}
|
{% endif %}
|
||||||
<span>{{ page.title }}</span>
|
|
||||||
{% endunless %}
|
|
||||||
|
|
||||||
</span><!-- endof #breadcrumb -->
|
</span><!-- endof #breadcrumb -->
|
||||||
|
|
||||||
<i id="sidebar-trigger" class="fas fa-bars fa-fw"></i>
|
<i id="sidebar-trigger" class="fas fa-bars fa-fw"></i>
|
||||||
|
|
||||||
<div id="topbar-title">
|
<div id="topbar-title">
|
||||||
{% if page.location %}
|
{% if page.layout == 'home' %}
|
||||||
{{- page.location -}}
|
{{- site.title -}}
|
||||||
{% elsif page.layout == "home" %}
|
{% elsif page.dynamic_title %}
|
||||||
{{- site.title -}}
|
{{- page.title -}}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{- page.title -}}
|
{{- page.layout | capitalize -}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<i id="search-trigger" class="fas fa-search fa-fw"></i>
|
<i id="search-trigger" class="fas fa-search fa-fw"></i>
|
||||||
<span id="search-wrapper" class="align-items-center">
|
<span id="search-wrapper" class="align-items-center">
|
||||||
<i class="fas fa-search fa-fw"></i>
|
<i class="fas fa-search fa-fw"></i>
|
||||||
<input class="form-control" id="search-input" type="search" placeholder="{{ site.data.label.search_hint }}...">
|
<input class="form-control" id="search-input" type="search"
|
||||||
|
aria-label="search" placeholder="{{ site.data.label.search_hint | default: 'Search' }}...">
|
||||||
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
|
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
|
||||||
</span>
|
</span>
|
||||||
<span id="search-cancel" >Cancel</span>
|
<span id="search-cancel" >Cancel</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,31 +1,36 @@
|
|||||||
{% comment %}
|
{% comment %}
|
||||||
The trending tags list
|
The trending tags list
|
||||||
v2.0
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2019 Cotes Chung
|
|
||||||
MIT Licensed
|
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% assign MAX = 10 %}
|
{% assign MAX = 10 %}
|
||||||
|
|
||||||
{% capture tags_array %}
|
{% assign size_list = "" | split: "" %}
|
||||||
{% for tag in site.tags %}
|
{% assign tag_list = "" | split: "" %}
|
||||||
{{ tag[1] | size }}::{{ tag[0] | replace: ' ', '-' }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endcapture %}
|
|
||||||
|
|
||||||
{% assign all_tags = tags_array | split: " " | sort | reverse %}
|
{% for tag in site.tags %}
|
||||||
{% assign count = 0 %}
|
{% assign size = tag | last | size %}
|
||||||
|
{% assign size_list = size_list | push: size %}
|
||||||
|
|
||||||
|
{% assign tag_str = tag | first | append: "::" | append: size %}
|
||||||
|
{% assign tag_list = tag_list | push: tag_str %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign size_list = size_list | sort | reverse %}
|
||||||
|
|
||||||
|
{% assign tag_list = tag_list | sort_natural %}
|
||||||
|
|
||||||
{% assign trending_tags = "" | split: "" %}
|
{% assign trending_tags = "" | split: "" %}
|
||||||
|
|
||||||
{% for iter in all_tags %}
|
{% for size in size_list limit: MAX %}
|
||||||
{% assign count = count | plus: 1 %}
|
{% for tag_str in tag_list %}
|
||||||
{% assign tag = iter | split: "::" | last %}
|
{% assign tag = tag_str | split: "::" %}
|
||||||
|
{% assign tag_name = tag | first %}
|
||||||
{% assign trending_tags = trending_tags | push: tag %}
|
{% assign tag_size = tag | last | plus: 0 %}
|
||||||
|
{% if tag_size == size %}
|
||||||
{% if count >= MAX %}
|
{% unless trending_tags contains tag_name %}
|
||||||
{% break %}
|
{% assign trending_tags = trending_tags | push: tag_name %}
|
||||||
{% endif %}
|
{% break %}
|
||||||
|
{% endunless %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -1,20 +1,18 @@
|
|||||||
{% comment %}
|
{% comment %}
|
||||||
Get the last 5 posts from lastmod list.
|
Get the last 5 posts from lastmod list.
|
||||||
v2.2
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% assign MAX_SIZE = 5 %}
|
{% assign MAX_SIZE = 5 %}
|
||||||
|
|
||||||
{% assign all_list = "" | split: "" %}
|
{% assign all_list = "" | split: "" %}
|
||||||
|
|
||||||
{% for entry in site.data.updates %}
|
{% for post in site.posts %}
|
||||||
{% capture elem %}
|
{% if post.last_modified_at %}
|
||||||
{{- entry.lastmod -}}::{{- entry.filename -}}
|
{% capture elem %}
|
||||||
{% endcapture %}
|
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
||||||
{% assign all_list = all_list | push: elem %}
|
{% endcapture %}
|
||||||
|
{% assign all_list = all_list | push: elem %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% assign all_list = all_list | sort | reverse %}
|
{% assign all_list = all_list | sort | reverse %}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: Archives
|
layout: page
|
||||||
type: archives
|
|
||||||
# The Archives of posts.
|
# 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">
|
<div id="archives" class="pl-xl-2">
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
||||||
@@ -37,4 +33,4 @@ type: archives
|
|||||||
{% assign last_month = "" %}
|
{% assign last_month = "" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -1,13 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: Categories
|
layout: page
|
||||||
type: categories
|
|
||||||
# All the Categories of posts
|
# All the Categories of posts
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
{% assign HEAD_PREFIX = "h_" %}
|
{% assign HEAD_PREFIX = "h_" %}
|
||||||
{% assign LIST_PREFIX = "l_" %}
|
{% assign LIST_PREFIX = "l_" %}
|
||||||
|
|
||||||
@@ -45,7 +41,7 @@ type: categories
|
|||||||
{% else %}
|
{% else %}
|
||||||
<i class="far fa-folder fa-fw"></i>
|
<i class="far fa-folder fa-fw"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ site.baseurl }}/categories/{{ category_name | replace: ' ', '-' | downcase | url_encode }}/"
|
<a href="{{ site.baseurl }}/categories/{{ category_name | slugify | url_encode }}/"
|
||||||
class="ml-1 mr-2">
|
class="ml-1 mr-2">
|
||||||
{{ category_name }}
|
{{ category_name }}
|
||||||
</a>
|
</a>
|
||||||
@@ -64,8 +60,9 @@ type: categories
|
|||||||
|
|
||||||
<!-- arrow -->
|
<!-- arrow -->
|
||||||
{% if sub_categories_size > 0%}
|
{% if sub_categories_size > 0%}
|
||||||
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse" aria-expanded="true"
|
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse"
|
||||||
class="category-trigger hide-border-bottom">
|
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>
|
<i class="fas fa-fw fa-angle-down"></i>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -83,7 +80,7 @@ type: categories
|
|||||||
{% for sub_category in sub_categories %}
|
{% for sub_category in sub_categories %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<i class="far fa-folder fa-fw"></i>
|
<i class="far fa-folder fa-fw"></i>
|
||||||
<a href="{{ site.baseurl }}/categories/{{ sub_category | replace: ' ', '-' | downcase | url_encode }}/"
|
<a href="{{ site.baseurl }}/categories/{{ sub_category | slugify | url_encode }}/"
|
||||||
class="ml-1 mr-2">{{ sub_category }}</a>
|
class="ml-1 mr-2">{{ sub_category }}</a>
|
||||||
{% assign posts_size = site.categories[sub_category] | size %}
|
{% assign posts_size = site.categories[sub_category] | size %}
|
||||||
<span class="text-muted small font-weight-light">{{ posts_size }}
|
<span class="text-muted small font-weight-light">{{ posts_size }}
|
||||||
@@ -1,25 +1,24 @@
|
|||||||
---
|
---
|
||||||
layout: page
|
layout: page
|
||||||
# The Category layout
|
# The Category layout
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# MIT Licensed
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div id="page-category">
|
<div id="page-category">
|
||||||
<h1 class="pl-lg-2">
|
<h1 class="pl-lg-2">
|
||||||
<i class="far fa-folder-open fa-fw text-muted"></i>
|
<i class="far fa-folder-open fa-fw text-muted"></i>
|
||||||
{{ page.title }}
|
{{ page.title }}
|
||||||
<span class="lead text-muted pl-2">{{ site.categories[page.category] | size }}</span>
|
<span class="lead text-muted pl-2">{{ page.posts | size }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<ul class="post-content pl-0">
|
<ul class="post-content pl-0">
|
||||||
{% for post in site.categories[page.category] %}
|
{% assign post_long_df = site.data.date_format.post.long | default: '%b %e, %Y' %}
|
||||||
|
|
||||||
|
{% for post in page.posts %}
|
||||||
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
||||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
<span class="dash flex-grow-1"></span>
|
<span class="dash flex-grow-1"></span>
|
||||||
<span class="text-muted small">{{ post.date | date: site.data.date_format.post.long }}</span>
|
<span class="text-muted small">{{ post.date | date: post_long_df }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,35 +1,23 @@
|
|||||||
---
|
---
|
||||||
layout: compress
|
layout: compress
|
||||||
# Default layout
|
# Default layout
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
{% if site.lang %}
|
|
||||||
{% assign lang = site.lang | split: "_" | first %}
|
|
||||||
{% else %}
|
|
||||||
{% assign lang = 'en' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% capture prefer_mode %}
|
{% capture prefer_mode %}
|
||||||
{% if site.theme_mode != "dual" %}
|
{% if site.theme_mode %}
|
||||||
mode="{{ site.theme_mode }}"
|
mode="{{ site.theme_mode }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<html lang="{{ lang }}" {{ prefer_mode }} >
|
<html lang="{{ site.lang | default: "en-US" }}" {{ prefer_mode }}>
|
||||||
|
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
|
|
||||||
<body data-spy="scroll" data-target="#toc">
|
<body data-spy="scroll" data-target="#toc">
|
||||||
|
|
||||||
<div id="sidebar" class="d-flex flex-column">
|
{% include sidebar.html %}
|
||||||
{% include sidebar.html %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include topbar.html %}
|
{% include topbar.html %}
|
||||||
|
|
||||||
@@ -46,9 +34,13 @@ layout: compress
|
|||||||
|
|
||||||
</div> <!-- #main-wrapper -->
|
</div> <!-- #main-wrapper -->
|
||||||
|
|
||||||
|
{% if page.mermaid %}
|
||||||
|
{% include mermaid.html %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div id="mask"></div>
|
<div id="mask"></div>
|
||||||
|
|
||||||
<a id="back-to-top" href="#" class="btn btn-lg btn-box-shadow" role="button">
|
<a id="back-to-top" href="#" aria-label="back-to-top" class="btn btn-lg btn-box-shadow" role="button">
|
||||||
<i class="fas fa-angle-up"></i>
|
<i class="fas fa-angle-up"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: page
|
layout: page
|
||||||
# The Home page layout
|
# The Home page layout
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -49,13 +45,10 @@ layout: page
|
|||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
|
|
||||||
<div class="post-preview">
|
<div class="post-preview">
|
||||||
<div class="d-flex justify-content-between pr-xl-2">
|
<h1>
|
||||||
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
{% if post.pin == true %}
|
</h1>
|
||||||
<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>
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<p>
|
<p>
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
@@ -63,19 +56,35 @@ layout: page
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-meta text-muted">
|
<div class="post-meta text-muted d-flex justify-content-between">
|
||||||
<!-- posted date -->
|
|
||||||
<i class="far fa-clock fa-fw"></i>
|
|
||||||
{% include timeago.html date=post.date tooltip=true %}
|
|
||||||
|
|
||||||
<!-- page views -->
|
<div>
|
||||||
{% if site.google_analytics.pv.enabled %}
|
<!-- posted date -->
|
||||||
<i class="far fa-eye fa-fw"></i>
|
<i class="far fa-calendar fa-fw"></i>
|
||||||
<span id="pv_{{-post.title-}}" class="pageviews">
|
{% include timeago.html date=post.date tooltip=true %}
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
|
||||||
</span>
|
<!-- 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 | default: 'Pinned' }}</span>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
</div> <!-- .post-review -->
|
</div> <!-- .post-review -->
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
# The page layout
|
# The page layout
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
# The posts' layout
|
# The posts' layout
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -18,65 +14,41 @@ layout: default
|
|||||||
<div class="post-meta text-muted d-flex flex-column">
|
<div class="post-meta text-muted d-flex flex-column">
|
||||||
<!-- Published date and author -->
|
<!-- Published date and author -->
|
||||||
<div>
|
<div>
|
||||||
Posted
|
<span class="semi-bold">
|
||||||
{% include timeago.html date=page.date tooltip=true %}
|
{{ page.author | default: site.social.name }}
|
||||||
by
|
|
||||||
<span class="author">
|
|
||||||
{% if page.author %}
|
|
||||||
{{ page.author }}
|
|
||||||
{% else %}
|
|
||||||
{{ site.author }}
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
</span>
|
||||||
|
{% include timeago.html date=page.date prep="on" tooltip=true %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- lastmod -->
|
<div>
|
||||||
{%- capture filename -%}
|
<!-- lastmod -->
|
||||||
{{ page.url | split: "/" | last }}
|
{% if page.last_modified_at %}
|
||||||
{%- endcapture -%}
|
<span>
|
||||||
|
{% include timeago.html date=page.last_modified_at
|
||||||
{% for item in site.data.updates %}
|
class="lastmod" prefix="Updated" tooltip=true %}
|
||||||
{% assign encode_filename = item.filename | url_encode %}
|
</span>
|
||||||
{% if filename == encode_filename %}
|
|
||||||
{% assign lastmod = item.lastmod %}
|
|
||||||
{% break %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% if lastmod %}
|
<!-- read time -->
|
||||||
<div>
|
{% include read-time.html content=content %}
|
||||||
Updated
|
|
||||||
{% include timeago.html date=lastmod class="lastmod" tooltip=true %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- page views -->
|
<!-- page views -->
|
||||||
{% if site.google_analytics.pv.enabled %}
|
{% if site.google_analytics.pv.enabled %}
|
||||||
<div>
|
|
||||||
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span>
|
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span>
|
||||||
views
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div> <!-- .post-meta -->
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
|
||||||
{%- capture img_placehodler -%}
|
{% if page.image.src %}
|
||||||
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
<img src="{{ page.image.src }}" class="preview-img" alt="{{ page.image.alt | default: "Preview Image" }}">
|
||||||
{% endcapture%}
|
|
||||||
|
|
||||||
{% if page.image %}
|
|
||||||
<img src="{{ img_placehodler }}" data-src="{{ page.image }}" class="post-preview-img">
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
{{ content }}
|
||||||
{% if content contains '<img src=' %}
|
|
||||||
{% assign replacement = '<img src="' | append: img_placehodler | append: '" data-src=' %}
|
|
||||||
{{ content | replace: '<img src=', replacement }}
|
|
||||||
{% else %}
|
|
||||||
{{ content }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-tail-wrapper text-muted">
|
<div class="post-tail-wrapper text-muted">
|
||||||
@@ -86,7 +58,7 @@ layout: default
|
|||||||
<div class="post-meta mb-3">
|
<div class="post-meta mb-3">
|
||||||
<i class="far fa-folder-open fa-fw mr-1"></i>
|
<i class="far fa-folder-open fa-fw mr-1"></i>
|
||||||
{% for category in page.categories %}
|
{% 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 -%}
|
{%- unless forloop.last -%}, {%- endunless -%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -97,7 +69,7 @@ layout: default
|
|||||||
<div class="post-tags">
|
<div class="post-tags">
|
||||||
<i class="fa fa-tags fa-fw mr-1"></i>
|
<i class="fa fa-tags fa-fw mr-1"></i>
|
||||||
{% for tag in page.tags %}
|
{% 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" >
|
class="post-tag no-text-decoration" >
|
||||||
{{- tag -}}
|
{{- tag -}}
|
||||||
</a>
|
</a>
|
||||||
@@ -126,7 +98,15 @@ layout: default
|
|||||||
|
|
||||||
</div> <!-- #post-wrapper -->
|
</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 -->
|
</div> <!-- .row -->
|
||||||
|
|
||||||
@@ -147,5 +127,3 @@ layout: default
|
|||||||
</div> <!-- .col-* -->
|
</div> <!-- .col-* -->
|
||||||
|
|
||||||
</div> <!-- .row -->
|
</div> <!-- .row -->
|
||||||
|
|
||||||
{% include lozad.html %}
|
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
---
|
---
|
||||||
layout: page
|
layout: page
|
||||||
# The layout for Tag page
|
# The layout for Tag page
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2017-2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
<div id="page-tag">
|
<div id="page-tag">
|
||||||
<h1 class="pl-lg-2">
|
<h1 class="pl-lg-2">
|
||||||
<i class="fa fa-tag fa-fw text-muted"></i>
|
<i class="fa fa-tag fa-fw text-muted"></i>
|
||||||
{{ page.title }}
|
{{ page.title }}
|
||||||
<span class="lead text-muted pl-2">{{ site.tags[page.tag] | size }}</span>
|
<span class="lead text-muted pl-2">{{ page.posts | size }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
<ul class="post-content pl-0">
|
<ul class="post-content pl-0">
|
||||||
{% for post in site.tags[page.tag] %}
|
{% assign post_long_df = site.data.date_format.post.long | default: '%b %e, %Y' %}
|
||||||
|
|
||||||
|
{% for post in page.posts %}
|
||||||
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
||||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
<span class="dash flex-grow-1"></span>
|
<span class="dash flex-grow-1"></span>
|
||||||
<span class="text-muted small">{{ post.date | date: site.data.date_format.post.long }}</span>
|
<span class="text-muted small">{{ post.date | date: post_long_df }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
21
_layouts/tags.html
Normal file
21
_layouts/tags.html
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
layout: page
|
||||||
|
# All the Tags of posts.
|
||||||
|
---
|
||||||
|
|
||||||
|
<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>
|
||||||
14
_plugins/posts-lastmod-hook.rb
Normal file
14
_plugins/posts-lastmod-hook.rb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
#
|
||||||
|
# Check for changed posts
|
||||||
|
|
||||||
|
Jekyll::Hooks.register :posts, :post_init do |post|
|
||||||
|
|
||||||
|
commit_num = `git rev-list --count HEAD "#{ post.path }"`
|
||||||
|
|
||||||
|
if commit_num.to_i > 1
|
||||||
|
lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"`
|
||||||
|
post.data['last_modified_at'] = lastmod_date
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -5,25 +5,25 @@ date: 2019-08-08 11:33:00 +0800
|
|||||||
categories: [Blogging, Demo]
|
categories: [Blogging, Demo]
|
||||||
tags: [typography]
|
tags: [typography]
|
||||||
math: true
|
math: true
|
||||||
image: /assets/img/sample/devices-mockup.png
|
mermaid: true
|
||||||
|
image:
|
||||||
|
src: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png
|
||||||
---
|
---
|
||||||
|
|
||||||
This post is to show Markdown syntax rendering on [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork), you can also use it as an example of writing. Now, let's start looking at text and typography.
|
This post is to show Markdown syntax rendering on [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork), you can also use it as an example of writing. Now, let's start looking at text and typography.
|
||||||
|
|
||||||
|
|
||||||
## Titles
|
## Titles
|
||||||
|
|
||||||
---
|
---
|
||||||
|
# H1 - heading
|
||||||
|
|
||||||
# H1
|
<h2 data-toc-skip>H2 - heading</h2>
|
||||||
|
|
||||||
<h2 data-toc-skip>H2</h2>
|
<h3 data-toc-skip>H3 - heading</h3>
|
||||||
|
|
||||||
<h3 data-toc-skip>H3</h3>
|
|
||||||
|
|
||||||
<h4>H4</h4>
|
|
||||||
|
|
||||||
|
<h4>H4 - heading</h4>
|
||||||
---
|
---
|
||||||
|
<br>
|
||||||
|
|
||||||
## Paragraph
|
## Paragraph
|
||||||
|
|
||||||
@@ -39,21 +39,38 @@ Beside the lake, beneath the trees,
|
|||||||
|
|
||||||
Fluttering and dancing in the breeze.
|
Fluttering and dancing in the breeze.
|
||||||
|
|
||||||
## List
|
## Lists
|
||||||
|
|
||||||
### Ordered list
|
### Ordered list
|
||||||
|
|
||||||
1. first item
|
1. Firstly
|
||||||
2. second item
|
2. Secondly
|
||||||
3. third item
|
3. Thirdly
|
||||||
|
|
||||||
### Unordered list
|
### Unordered list
|
||||||
|
|
||||||
- item 1
|
- Chapter
|
||||||
- sub item 1
|
- Setcion
|
||||||
- sub item 2
|
- 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
|
## Block Quote
|
||||||
|
|
||||||
@@ -61,53 +78,68 @@ Fluttering and dancing in the breeze.
|
|||||||
|
|
||||||
## Tables
|
## Tables
|
||||||
|
|
||||||
| Company | contact | Country |
|
| Company | Contact | Country |
|
||||||
|:-----------------------------|:-----------------|--------:|
|
|:-----------------------------|:-----------------|--------:|
|
||||||
| Alfreds Futterkiste | Maria Anders | Germany |
|
| Alfreds Futterkiste | Maria Anders | Germany |
|
||||||
| Island Trading | Helen Bennett | UK |
|
| Island Trading | Helen Bennett | UK |
|
||||||
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
|
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
|
||||||
|
|
||||||
## Link
|
## Links
|
||||||
|
|
||||||
<http://127.0.0.1:4000>
|
<http://127.0.0.1:4000>
|
||||||
|
|
||||||
|
|
||||||
## Footnote
|
## 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
|
## Images
|
||||||
|
|
||||||
By default, the image is centered and the image caption can be displayed at the bottom:
|
- Default (with caption)
|
||||||
|
|
||||||

|

|
||||||
_Full screen width and center alignment_
|
_Full screen width and center alignment_
|
||||||
|
|
||||||
You can change the size of the picture:
|
<br>
|
||||||
|
|
||||||
{: width="400"}
|
- Specify width
|
||||||
|
|
||||||
|
{: width="400"}
|
||||||
_400px image width_
|
_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
|
||||||
|
|
||||||
{: width="350" class="normal"}
|
|
||||||
|
|
||||||
- Float to the left
|
{: width="350" .normal}
|
||||||
|
|
||||||
{: width="240" class="left"}
|
<br>
|
||||||
|
|
||||||
|
- Float to left
|
||||||
|
|
||||||
|
{: 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."
|
"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>
|
||||||
|
|
||||||
{: width="240" class="right"}
|
- Float to right
|
||||||
|
|
||||||
|
{: 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."
|
"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
|
## Mathematics
|
||||||
|
|
||||||
@@ -115,11 +147,17 @@ The mathematics powered by [**MathJax**](https://www.mathjax.org/):
|
|||||||
|
|
||||||
$$ \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} $$
|
$$ \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} $$
|
||||||
|
|
||||||
When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
|
When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are
|
||||||
|
|
||||||
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
||||||
|
|
||||||
## Code Snippet
|
|
||||||
|
## Inline code
|
||||||
|
|
||||||
|
This is an example of `Inline Code`.
|
||||||
|
|
||||||
|
|
||||||
|
## Code block
|
||||||
|
|
||||||
### Common
|
### Common
|
||||||
|
|
||||||
@@ -132,14 +170,6 @@ This is a common code snippet, without syntax highlight and line number.
|
|||||||
#### Console
|
#### Console
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ date
|
|
||||||
Sun Nov 3 15:11:12 CST 2019
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### Terminal
|
|
||||||
|
|
||||||
```terminal
|
|
||||||
$ env |grep SHELL
|
$ env |grep SHELL
|
||||||
SHELL=/usr/local/bin/bash
|
SHELL=/usr/local/bin/bash
|
||||||
PYENV_SHELL=bash
|
PYENV_SHELL=bash
|
||||||
@@ -173,38 +203,18 @@ fi;
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
#### HTML
|
#### Java
|
||||||
|
|
||||||
```html
|
```java
|
||||||
<div class="sidenav">
|
private void writeObject(java.io.ObjectOutputStream s)
|
||||||
<a href="#contact">Contact</a>
|
throws java.io.IOException {
|
||||||
<button class="dropdown-btn">Dropdown
|
// Write out any hidden serialization magic
|
||||||
<i class="fa fa-caret-down"></i>
|
s.defaultWriteObject();
|
||||||
</button>
|
for (E e: map.keySet()) s.writeObject(e);
|
||||||
<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>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**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
|
## Reverse Footnote
|
||||||
|
|
||||||
[^footnote]: The footnote source.
|
[^footnote]: The footnote source
|
||||||
|
[^fn-nth-2]: The 2nd footnote source
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ tags: [writing]
|
|||||||
|
|
||||||
## Naming and Path
|
## 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
|
## Front Matter
|
||||||
|
|
||||||
@@ -31,67 +31,13 @@ In order to accurately record the release date of a post, you should not only se
|
|||||||
|
|
||||||
### Categories and Tags
|
### Categories and Tags
|
||||||
|
|
||||||
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity.
|
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity. For instance:
|
||||||
|
|
||||||
The list of posts belonging to the same *category*/*tag* is recorded on a separate page. At the same time, the number of these *category*/*tag* type pages is equal to the number of `categories` / `tags` elements for all posts, which means that the two number must be exactly the same.
|
|
||||||
|
|
||||||
For instance, let's say there is a post with front matter:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
categories: [Animal, Insect]
|
categories: [Animal, Insect]
|
||||||
tags: bee
|
tags: [bee]
|
||||||
```
|
```
|
||||||
|
|
||||||
Then we should have two *category* type pages placed in folder `categories` of root and one *tag* type page placed in folder `tags` of root:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
.
|
|
||||||
├── categories
|
|
||||||
│ ├── animal.html # a category type page
|
|
||||||
│ └── insect.html
|
|
||||||
├── tags
|
|
||||||
│ └── bee.html # a tag type page
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
and the content of a *category* type page is
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
layout: category
|
|
||||||
title: CATEGORY_NAME # e.g. Insect
|
|
||||||
category: CATEGORY_NAME # e.g. Insect
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
the content of a *tag* type page is
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
layout: tag
|
|
||||||
title: TAG_NAME # e.g. bee
|
|
||||||
tag: TAG_NAME # e.g. bee
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
With the increasing number of posts, the number of categories and tags will increase several times! If we still manually create these *category*/*tag* type files, it will obviously be a super time-consuming job, and it is very likely to miss some of them, i.e., when you click on the missing `category` or `tag` link from a post or somewhere, the browser will complain to you "404 Not Found". The good news is we got a lovely script tool `_scripts/sh/create_pages.sh` to finish the boring tasks. Basically we will use it through `run.sh`, `build.sh` or `deploy.sh` that placed in `tools/` instead of running it separately. Check out its use case [here]({{ "/posts/getting-started/#deployment" | relative_url }}).
|
|
||||||
|
|
||||||
## Last modified date
|
|
||||||
|
|
||||||
The last modified date of a post is obtained according to the post's latest git commit date, and the modified date of all posts are designed to be stored in the file `_data/updates.yml`. Then contents of that file may be as follows:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
-
|
|
||||||
filename: getting-started # the post filename without date and extension
|
|
||||||
lastmod: 2020-04-13 00:38:56 +0800 # the post last modified date
|
|
||||||
-
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
You can choose to create this file manually, But the better approach is to let it be automatically generated by a script tool, and `_scripts/sh/dump_lastmod.sh` was born for this! Similar to the other script (`create_pages.sh`) mentioned above, it is also be called from the other superior tools, so it doesn't have to be used separately.
|
|
||||||
|
|
||||||
When some posts have been modified since their published date and also the file `_data/updates.yml` was created correctly, a list with the label **Recent Updates** will be displayed in the right panel of the desktop view, which records the five most recently modified posts.
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the value of variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the value of variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
||||||
@@ -102,7 +48,6 @@ toc: false
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Comments
|
## Comments
|
||||||
|
|
||||||
Similar to TOC, the [Disqus](https://disqus.com/) comments is loaded by default in each post, and the global switch is defined by variable `comments` in file `_config.yml` . If you want to close the comment for specific post, add the following to the **Front Matter** of the post:
|
Similar to TOC, the [Disqus](https://disqus.com/) comments is loaded by default in each post, and the global switch is defined by variable `comments` in file `_config.yml` . If you want to close the comment for specific post, add the following to the **Front Matter** of the post:
|
||||||
@@ -113,7 +58,6 @@ comments: false
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Mathematics
|
## Mathematics
|
||||||
|
|
||||||
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:
|
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:
|
||||||
@@ -124,16 +68,97 @@ math: true
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
## Preview Image
|
## Mermaid
|
||||||
|
|
||||||
If you want to add an image to the top of the post contents, specify the url for the image by:
|
[**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 and alt attribute for the image:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
image: /path/to/image-file
|
image:
|
||||||
|
src: /path/to/image/file
|
||||||
|
alt: image alternative text
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Image caption
|
||||||
|
|
||||||
|
Add italics to the next line of an image,then it will become the caption and appear at the bottom of the image:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|

|
||||||
|
_Image Caption_
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image size
|
||||||
|
|
||||||
|
You can specify the width (and height) of a image with `width`:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: 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
|
||||||
|
{: .normal}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Float to the left**
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: .left}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Float to the right**
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: .right}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Limitation**: Once you specify the position of an image, it is forbidden to add the image caption.
|
||||||
|
|
||||||
|
### CDN URL
|
||||||
|
|
||||||
|
If you host the images on the CDN, you can save the time of repeatedly writing the CDN url by assigning the variable `img_cdn` of `_config.yml` file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
img_cdn: https://cdn.com
|
||||||
|
```
|
||||||
|
|
||||||
|
Once `img_cdn` is assigned, the CDN url will be added to the path of all images (images of site avatar and posts) starting with `/`.
|
||||||
|
|
||||||
|
For instance, when using images:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img src="https://cdn.com/path/to/flower.png" alt="The flower">
|
||||||
|
```
|
||||||
|
|
||||||
## Pinned Posts
|
## 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:
|
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:
|
||||||
@@ -146,7 +171,7 @@ pin: true
|
|||||||
|
|
||||||
## Code Block
|
## 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.
|
This is a common code snippet, without syntax highlight and line number.
|
||||||
@@ -154,7 +179,7 @@ This is a common code snippet, without syntax highlight and line number.
|
|||||||
|
|
||||||
## Specific Language
|
## 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 !
|
> **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 !
|
||||||
|
|
||||||
|
|||||||
@@ -7,123 +7,130 @@ tags: [getting started]
|
|||||||
pin: true
|
pin: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub, rename the repository to `USERNAME.github.io` (where `USERNAME` is your GitHub username), and then open terminal and clone the fork to local by:
|
There are two ways to get the theme:
|
||||||
|
|
||||||
```terminal
|
- **Install from RubyGems** - Easy to update, isolate irrelevant project files so you can focus on writing.
|
||||||
$ git clone https://github.com/USERNAME/USERNAME.github.io.git -b master --single-branch
|
- **Fork on GitHub** - Convenient for custom development, but difficult to update, only suitable for web developers.
|
||||||
|
|
||||||
|
### Installing the Theme Gem
|
||||||
|
|
||||||
|
Add this line to your Jekyll site's `Gemfile`:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
gem "jekyll-theme-chirpy"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up the local envrionment
|
And add this line to your Jekyll site's `_config.yml`:
|
||||||
|
|
||||||
If you would like to run or build the project on your local machine, please follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems` and `Bundler`.
|
```yaml
|
||||||
|
theme: jekyll-theme-chirpy
|
||||||
Before running or building for the first time, please complete the installation of the Jekyll plugins. Go to the root directory of project and run:
|
|
||||||
|
|
||||||
```terminal
|
|
||||||
$ bundle install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`bundle` will automatically install all the dependencies specified by `Gemfile`.
|
And then execute:
|
||||||
|
|
||||||
In order to generate some extra files (_categories_, _tags_ and _last modified list_), we need to use some tool scripts. And they require dependency package [yq](https://github.com/mikefarah/yq#install) to be installed. What's more, if your machine is running Debian or macOS, you also need to install [GNU coreutils](https://www.gnu.org/software/coreutils/).
|
|
||||||
|
|
||||||
- on Debian:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ sudo apt-get install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
- on macOS:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ brew install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
### Setting up Docker environment (optional)
|
|
||||||
|
|
||||||
If you're a loyal fan of [**Docker**](https://www.docker.com/) or just too lazy to install the packages mentioned in [_Setting up the local envrionment_](#setting-up-the-local-envrionment), please make sure you have **Docker Engine** installed and running, and then get Docker image `jekyll/jekyll` from Docker Hub by the following command:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker pull jekyll/jekyll:latest
|
$ bundle
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
Finally, copy the required files from the theme's gem (for detailed files, see [starter project][starter]) to your Jekyll site.
|
||||||
|
|
||||||
Running [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) requires some extra files, which cannot be generated by Jekyll native commands, so please strictly follow the methods mentioned below to run or deploy your website.
|
> **Hint**: To locate the installed theme’s gem, execute:
|
||||||
|
>
|
||||||
|
> ```console
|
||||||
|
> $ bundle info --path jekyll-theme-chirpy
|
||||||
|
> ```
|
||||||
|
|
||||||
### Initialization
|
Or you can [**use the starter template**][use-starter] to create a Jekyll site to save time copying files from theme's gem. We have prepared everything for you there!
|
||||||
|
|
||||||
Go to the root directory of the project and start initialization:
|
### Fork on GitHub
|
||||||
|
|
||||||
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and then clone your fork to local. (Please note that the default branch code is in development. If you want the blog to be stable, please switch to the [latest tag](https://github.com/cotes2020/jekyll-theme-chirpy/tags) and start writing.)
|
||||||
|
|
||||||
|
Install gem dependencies by:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle
|
||||||
|
```
|
||||||
|
|
||||||
|
And then execute:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: If you not intend to deploy it on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
> **Note**: If you don't plan to deploy your site on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
||||||
|
|
||||||
What it does is:
|
What it does is:
|
||||||
|
|
||||||
1. Remove some files or directories from your repository:
|
1. Remove some files or directories from your repository:
|
||||||
|
|
||||||
- `.travis.yml`
|
- `.travis.yml`
|
||||||
- files under `_posts`
|
- files under `_posts`
|
||||||
- folder `docs`
|
- folder `docs`
|
||||||
|
|
||||||
2. If you use the `--no-gh` option, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in folder `.github`.
|
2. If you use the `--no-gh` option, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in folder `.github`.
|
||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Automatically create a commit to save the changes.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
|
Update the variables of `_config.yml` as needed. Some of them are typical options:
|
||||||
|
|
||||||
- `url`
|
- `url`
|
||||||
- `avatar`
|
- `avatar`
|
||||||
- `timezone`
|
- `timezone`
|
||||||
- `theme_mode`
|
- `lang`
|
||||||
|
|
||||||
### Run Locally
|
### Running Local Server
|
||||||
|
|
||||||
You may want to preview the site contents before publishing, so just run it by:
|
You may want to preview the site contents before publishing, so just run it by:
|
||||||
|
|
||||||
```terminal
|
```console
|
||||||
$ bash tools/run.sh
|
$ bundle exec jekyll s
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open a browser and visit to <http://localhost:4000>.
|
Or run the site on Docker with the following command:
|
||||||
|
|
||||||
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
|
|
||||||
|
|
||||||
### Run on Docker
|
|
||||||
|
|
||||||
Run the site on Docker with the following command:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ docker run --rm -it \
|
$ docker run -it --rm \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
-p 4000:4000 jekyll/jekyll \
|
-p 4000:4000 jekyll/jekyll \
|
||||||
bash tools/run.sh --docker
|
jekyll serve
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that on Docker containers, you'll lose the real-time refresh feature.
|
Open a browser and visit to _<http://localhost:4000>_.
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [_project site_](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash. For example, `/project`.
|
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash, e.g, `/project-name`.
|
||||||
|
|
||||||
Assuming you have already gone through the [initialization](#initialization), you can now choose ONE of the following methods to deploy your website.
|
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||||
|
|
||||||
#### Deploy on GitHub Pages
|
#### Deploy on GitHub Pages
|
||||||
|
|
||||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using tool scripts to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the Pages service.
|
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the GH Pages service.
|
||||||
|
|
||||||
1. Push any commit to `origin/master` to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
Quickly check the files needed for GitHub Actions build:
|
||||||
|
|
||||||
2. Browse to your repository on GitHub and choose the branch `gh-pages` as the [publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) throught _Settings_ → _Options_ → _GitHub Pages_:
|
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [workflow file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
|
||||||
{: width="650" class="normal"}
|
- Ensure your Jekyll site has file `tools/test.sh` and `tools/deploy.sh`. Otherwise, copy them from this repo to your Jekyll site.
|
||||||
|
|
||||||
|
And then rename your repoistory to `<GH-USERNAME>.github.io` on GitHub.
|
||||||
|
|
||||||
|
Now publish your Jekyll site by:
|
||||||
|
|
||||||
|
1. Push any commit to remote to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
||||||
|
|
||||||
|
2. Browse to your repo's landing page on GitHub and select the branch `gh-pages` as the [publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) throught _Settings_ → _Options_ → _GitHub Pages_:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
@@ -134,18 +141,21 @@ On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Acti
|
|||||||
Go to the root of the source project, build your site by:
|
Go to the root of the source project, build your site by:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/build.sh
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: The output path can be specified with the option `-d`.
|
Or build the site with Docker by:
|
||||||
|
|
||||||
Or, build the site with Docker by:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ docker run --rm -it \
|
$ docker run -it --rm \
|
||||||
|
--env JEKYLL_ENV=production \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
jekyll/jekyll \
|
jekyll/jekyll \
|
||||||
bash tools/build.sh --docker
|
jekyll build
|
||||||
```
|
```
|
||||||
|
|
||||||
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to your web server.
|
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to your web server.
|
||||||
|
|
||||||
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
|
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||||
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
|
|||||||
@@ -11,17 +11,29 @@ In [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/), the image fi
|
|||||||
|
|
||||||
With a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
|
With a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
|
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
|
||||||
|
|
||||||
{: width="600"}
|
{: width="600"}
|
||||||
|
|
||||||
Download the generated package, unzip and delete the following two from the extracted files:
|
Download the generated package, unzip and delete the following two from the extracted files:
|
||||||
|
|
||||||
- browserconfig.xml
|
- browserconfig.xml
|
||||||
- manifest.json
|
- manifest.json
|
||||||
|
|
||||||
Now, copy the rest image files (`.PNG` and `.ICO`) to cover the original one in folder `assets/img/favicons/`.
|
|
||||||
|
|
||||||
Lastly, don't forget to rebuild your site so that the icon becomes your custom edition.
|
Now, copy the remaining image files (`.PNG` and `.ICO`) from the extracted `.zip` file to cover the original files in the folder `assets/img/favicons/`.
|
||||||
|
|
||||||
|
The following table helps you understand the changes to the icon file:
|
||||||
|
|
||||||
|
> ✓ means keep, ✗ means delete.
|
||||||
|
|
||||||
|
| File(s) | From Favicon & App Icon Generator | From Chirpy |
|
||||||
|
|---------------------|:---------------------------------:|:-----------:|
|
||||||
|
| `*.PNG` | ✓ | ✗ |
|
||||||
|
| `*.ICO` | ✓ | ✗ |
|
||||||
|
| `browserconfig.xml` | ✗ | ✓ |
|
||||||
|
| `manifest.json` | ✗ | ✓ |
|
||||||
|
|
||||||
|
|
||||||
|
The next time you build the site, the icon will be replaced with a customized edition.
|
||||||
|
|||||||
244
_posts/2021-01-03-enable-google-pv.md
Normal file
244
_posts/2021-01-03-enable-google-pv.md
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
---
|
||||||
|
title: Enable Google Page Views
|
||||||
|
author: Dinesh Prasanth Moluguwan Krishnamoorthy
|
||||||
|
date: 2021-01-03 18:32:00 -0500
|
||||||
|
categories: [Blogging, Tutorial]
|
||||||
|
tags: [google analytics, pageviews]
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
This post is to enable Page Views on the [**Chirpy**][chirpy-homepage] theme based blog that you just built. This requires technical knowledge and it's recommended to keep the `google_analytics.pv` disabled unless you have a good reason. If your website has low traffic, the page views count would discourage you to write more blogs. With that said, let's start with the setup.
|
||||||
|
|
||||||
|
## Set up Google Analytics
|
||||||
|
|
||||||
|
### Create GA account and property
|
||||||
|
|
||||||
|
First, you need to setup your account on Google analytics. While your create your account, you must create your first **Property** as well.
|
||||||
|
|
||||||
|
1. Head to <https://analytics.google.com/> and click on **Start Measuring**
|
||||||
|
2. Enter your desired _Account Name_ and choose the desired checkboxes
|
||||||
|
3. Enter your desired _Property Name_. This is the name of the tracker project that appears on your Google Analytics dashboard
|
||||||
|
4. Enter the required information _About your business_
|
||||||
|
5. Hit _Create_ and accept any license popup to setup your Google Analytics account and create your property
|
||||||
|
|
||||||
|
### Create Data Stream
|
||||||
|
|
||||||
|
With your property created, you now need to set up Data Stream to track your blog traffic. After you signup, the prompt should automatically take you to creating your first **Data Stream**. If not, follow these steps:
|
||||||
|
|
||||||
|
1. Go to **Admin** on the left column
|
||||||
|
2. Select the desired property from the drop down on the second column
|
||||||
|
3. Click on **Data Streams**
|
||||||
|
4. Add a stream and click on **Web**
|
||||||
|
5. Enter your blog's URL
|
||||||
|
|
||||||
|
It should look like this:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Now, click on the new data stream and grab the **Measurement ID**. It should look something like `G-V6XXXXXXXX`. Copy this to your `_config.yml` file
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
google_analytics:
|
||||||
|
id: 'G-V6XXXXXXX' # Fill with your Google Analytics ID
|
||||||
|
pv:
|
||||||
|
# The Google Analytics pageviews switch.
|
||||||
|
enabled: false
|
||||||
|
# the next options only valid when `google_analytics.pv` is enabled.
|
||||||
|
proxy_url: ''
|
||||||
|
proxy_endpoint: ''
|
||||||
|
cache: false # pv data local cache, good for the users from GFW area.
|
||||||
|
```
|
||||||
|
|
||||||
|
When you push these changes to your blog, you should start seeing the traffic on your Google Analytics. Play around with Google Analytics dashboard to get familiar with the options available as it takes like 5 mins to pickup your changes. You should now be able to monitor your traffic in realtime.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Setup Page Views
|
||||||
|
|
||||||
|
There is a detailed [tutorial](https://developers.google.com/analytics/solutions/google-analytics-super-proxy) available to set up Google Analytics superProxy. But, if you are interested to just quickly get your Chirpy-based blog display page views, follow along. These steps were tested on a Linux machine. If you are running Windows, you can use Git bash terminal to run Unix-like commands.
|
||||||
|
|
||||||
|
### Setup Google App Engine
|
||||||
|
|
||||||
|
1. Visit <https://console.cloud.google.com/appengine>
|
||||||
|
|
||||||
|
2. Click on **Create Application**
|
||||||
|
|
||||||
|
3. Click on **Create Project**
|
||||||
|
|
||||||
|
4. Enter the name and choose the data center close to you
|
||||||
|
|
||||||
|
5. Select **Python** language and **Standard** environment
|
||||||
|
|
||||||
|
6. Enable billing account. Yeah, you have to link your credit card. But, you won't be billed unless you exceed your free quota. For a simple blog, free quota is more than sufficient.
|
||||||
|
|
||||||
|
7. Go to your App Engine dashboard on your browser and select **API & Services** from the left navigation menu
|
||||||
|
|
||||||
|
8. Click on **Enable APIs and Services** button on the top
|
||||||
|
|
||||||
|
9. Enable the following APIs: _Google Analytics API_
|
||||||
|
|
||||||
|
10. On the left, Click on _OAuth Consent Screen_ and accept **Configure Consent Screen**. Select **External** since your blog is probably hosted for the public. Click on **Publish** under _Publishing Status_
|
||||||
|
|
||||||
|
11. Click on **Credentials** on the left and create a new **OAuth Client IDs** credential. Make sure to add a entry under `Authorized redirect URIs` that matches: `https://<project-id>.<region>.r.appspot.com/admin/auth`
|
||||||
|
|
||||||
|
12. Note down the **Your Client ID** and **Your Client Secret**. You'll need this in the next section.
|
||||||
|
|
||||||
|
13. Download and install the cloud SDK for your platform: <https://cloud.google.com/sdk/docs/quickstart>
|
||||||
|
|
||||||
|
14. Run the following commands:
|
||||||
|
|
||||||
|
```console
|
||||||
|
[root@bc96abf71ef8 /]# gcloud init
|
||||||
|
|
||||||
|
~snip~
|
||||||
|
|
||||||
|
Go to the following link in your browser:
|
||||||
|
|
||||||
|
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=XYZ.apps.googleusercontent.com&redirect_uri=ABCDEFG
|
||||||
|
|
||||||
|
Enter verification code: <VERIFICATION CODE THAT YOU GET AFTER YOU VISIT AND AUTHENTICATE FROM THE ABOVE LINK>
|
||||||
|
|
||||||
|
You are logged in as: [blah_blah@gmail.com].
|
||||||
|
|
||||||
|
Pick cloud project to use:
|
||||||
|
[1] chirpy-test-300716
|
||||||
|
[2] Create a new project
|
||||||
|
Please enter numeric choice or text value (must exactly match list
|
||||||
|
item): 1
|
||||||
|
|
||||||
|
|
||||||
|
[root@bc96abf71ef8 /]# gcloud info
|
||||||
|
# Your selected project info should be displayed here
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setup Google Analytics superProxy
|
||||||
|
|
||||||
|
1. Clone the **Google Analytics superProxy** project on Github: <https://github.com/googleanalytics/google-analytics-super-proxy> to your local.
|
||||||
|
|
||||||
|
2. Remove the first 2 lines in the [`src/app.yaml`](https://github.com/googleanalytics/google-analytics-super-proxy/blob/master/src/app.yaml#L1-L2) file:
|
||||||
|
```diff
|
||||||
|
- application: your-project-id
|
||||||
|
- version: 1
|
||||||
|
```
|
||||||
|
|
||||||
|
3. In `src/config.py`, add the `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` that you gathered from you App Engine Dashboard.
|
||||||
|
|
||||||
|
4. Enter any random key for `XSRF_KEY`, your `config.py` should look similar to this
|
||||||
|
|
||||||
|
```python
|
||||||
|
#!/usr/bin/python2.7
|
||||||
|
|
||||||
|
__author__ = 'pete.frisella@gmail.com (Pete Frisella)'
|
||||||
|
|
||||||
|
# OAuth 2.0 Client Settings
|
||||||
|
AUTH_CONFIG = {
|
||||||
|
'OAUTH_CLIENT_ID': 'YOUR_CLIENT_ID',
|
||||||
|
'OAUTH_CLIENT_SECRET': 'YOUR_CLIENT_SECRET',
|
||||||
|
'OAUTH_REDIRECT_URI': '%s%s' % (
|
||||||
|
'https://chirpy-test-XXXXXX.ue.r.appspot.com',
|
||||||
|
'/admin/auth'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
# XSRF Settings
|
||||||
|
XSRF_KEY = 'OnceUponATimeThereLivedALegend'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tip:** You can configure a custom domain instead of `https://PROJECT_ID.REGION_ID.r.appspot.com`. But, for the sake of keeping it simple, we will be using the Google provided default URL.
|
||||||
|
|
||||||
|
5. From inside the src/ directory, deploy the app
|
||||||
|
|
||||||
|
```console
|
||||||
|
[root@bc96abf71ef8 src]# gcloud app deploy
|
||||||
|
Services to deploy:
|
||||||
|
|
||||||
|
descriptor: [/tmp/google-analytics-super-proxy/src/app.yaml]
|
||||||
|
source: [/tmp/google-analytics-super-proxy/src]
|
||||||
|
target project: [chirpy-test-XXXX]
|
||||||
|
target service: [default]
|
||||||
|
target version: [VESRION_NUM]
|
||||||
|
target url: [https://chirpy-test-XXXX.ue.r.appspot.com]
|
||||||
|
|
||||||
|
|
||||||
|
Do you want to continue (Y/n)? Y
|
||||||
|
|
||||||
|
Beginning deployment of service [default]...
|
||||||
|
╔════════════════════════════════════════════════════════════╗
|
||||||
|
╠═ Uploading 1 file to Google Cloud Storage ═╣
|
||||||
|
╚════════════════════════════════════════════════════════════╝
|
||||||
|
File upload done.
|
||||||
|
Updating service [default]...done.
|
||||||
|
Setting traffic split for service [default]...done.
|
||||||
|
Deployed service [default] to [https://chirpy-test-XXXX.ue.r.appspot.com]
|
||||||
|
|
||||||
|
You can stream logs from the command line by running:
|
||||||
|
$ gcloud app logs tail -s default
|
||||||
|
|
||||||
|
To view your application in the web browser run:
|
||||||
|
$ gcloud app browse
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Visit the deployed service. Add a `/admin` to the end of the URL.
|
||||||
|
|
||||||
|
7. Click on **Authorize Users** and make sure to add yourself as a managed user.
|
||||||
|
|
||||||
|
8. If you get any errors, please Google it. The errors are self-explanatory and should be easy to fix.
|
||||||
|
|
||||||
|
If everything went good, you'll get this screen:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Create Google Analytics Query
|
||||||
|
|
||||||
|
Head to `https://PROJECT_ID.REGION_ID.r.appspot.com/admin` and create a query after verifying the account. **GA Core Reporting API** query request can be created in [Query Explorer](https://ga-dev-tools.appspot.com/query-explorer/).
|
||||||
|
|
||||||
|
The query parameters are as follows:
|
||||||
|
|
||||||
|
- **start-date**: fill in the first day of blog posting
|
||||||
|
- **end-date**: fill in `today` (this is a parameter supported by GA Report, which means that it will always end according to the current query date)
|
||||||
|
- **metrics**: select `ga:pageviews`
|
||||||
|
- **dimensions**: select `ga:pagePath`
|
||||||
|
|
||||||
|
In order to reduce the returned results and reduce the network bandwidth, we add custom filtering rules [^ga-filters]:
|
||||||
|
|
||||||
|
- **filters**: fill in `ga:pagePath=~^/posts/.*/$;ga:pagePath!@=`.
|
||||||
|
|
||||||
|
Among them, `;` means using _logical AND_ to concatenate two rules.
|
||||||
|
|
||||||
|
If the `site.baseurl` is specified, change the first filtering rule to `ga:pagePath=~^/BASE_URL/posts/.*/$`, where `BASE_URL` is the value of `site.baseurl`.
|
||||||
|
|
||||||
|
After <kbd>Run Query</kbd>, copy the generated contents of **API Query URI** at the bottom of the page, and fill in the **Encoded URI for the query** of SuperProxy on GAE.
|
||||||
|
|
||||||
|
After the query is saved on GAE, a **Public Endpoint** (public access address) will be generated, and we will get the query result in JSON format when accessing it. Finally, click <kbd>Enable Endpoint</kbd> in **Public Request Endpoint** to make the query effective, and click <kbd>Start Scheduling</kbd> in **Scheduling** to start the scheduled task.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Configure Chirpy to Display Page View
|
||||||
|
|
||||||
|
Once all the hard part is done, it is very easy to enable the Page View on Chirpy theme. Your superProxy dashboard should look something like below and you can grab the required values.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Update the `_config.yml` file of [**Chirpy**][chirpy-homepage] project with the values from your dashboard, to look similar to the following:
|
||||||
|
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
google_analytics:
|
||||||
|
id: 'G-XXXXXXXXXX' # Fill with your Google Analytics ID
|
||||||
|
pv:
|
||||||
|
# The Google Analytics pageviews switch.
|
||||||
|
enabled: true
|
||||||
|
# the next options only valid when `google_analytics.pv` is enabled.
|
||||||
|
proxy_url: 'https://PROJECT_ID.REGION_ID.r.appspot.com'
|
||||||
|
proxy_endpoint: 'https://PROJECT_ID.REGION_ID.r.appspot.com/query?id=<ID FROM SUPER PROXY>'
|
||||||
|
cache: false # pv data local cache, good for the users from GFW area.
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, you should see the Page View enabled on your blog.
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
[^ga-filters]: [Google Analytics Core Reporting API: Filters](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters)
|
||||||
|
|
||||||
|
[chirpy-homepage]: https://github.com/cotes2020/jekyll-theme-chirpy/
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Mainly scss modules, only imported to `assets/css/main.scss`
|
* Mainly scss modules, only imported to `assets/css/main.scss`
|
||||||
*
|
|
||||||
* v2.1
|
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2020 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* ---------- scss placeholder --------- */
|
/* ---------- scss placeholder --------- */
|
||||||
@@ -17,6 +12,7 @@
|
|||||||
%table-cell {
|
%table-cell {
|
||||||
padding: 0.4rem 1rem;
|
padding: 0.4rem 1rem;
|
||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
%link-hover {
|
%link-hover {
|
||||||
@@ -38,6 +34,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%heading {
|
%heading {
|
||||||
|
color: var(--heading-color);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
||||||
}
|
}
|
||||||
@@ -64,7 +61,6 @@
|
|||||||
color: $color;
|
color: $color;
|
||||||
transition: color 0.35s ease-in-out;
|
transition: color 0.35s ease-in-out;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
margin: 0 0.25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin icon-round($diameter) {
|
@mixin icon-round($diameter) {
|
||||||
@@ -96,7 +92,18 @@
|
|||||||
color: $color;
|
color: $color;
|
||||||
font-size: $font-size;
|
font-size: $font-size;
|
||||||
font-weight: $font-weight;
|
font-weight: $font-weight;
|
||||||
font-family: 'Roboto Condensed', 'Microsoft Yahei', sans-serif;
|
}
|
||||||
|
|
||||||
|
@mixin panel-label {
|
||||||
|
@include label(inherit);
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
line-height: 1.2;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin align-center {
|
@mixin align-center {
|
||||||
@@ -1,13 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* The syntax highlight.
|
* The syntax highlight.
|
||||||
* v2.0
|
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2018-2019 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@import "_colors/light-syntax";
|
@import "colors/light-syntax";
|
||||||
@import "_colors/dark-syntax";
|
@import "colors/dark-syntax";
|
||||||
|
|
||||||
html:not([mode]),
|
html:not([mode]),
|
||||||
html[mode=light] {
|
html[mode=light] {
|
||||||
@@ -36,11 +32,11 @@ html[mode=dark] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
%code-snippet-radius {
|
%code-snippet-radius {
|
||||||
border-radius: 5px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
%code-snippet-padding {
|
%code-snippet-padding {
|
||||||
padding: 0.8rem 1rem;
|
padding: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
$code-font-size: 0.85rem;
|
$code-font-size: 0.85rem;
|
||||||
@@ -56,6 +52,7 @@ div > pre {
|
|||||||
@extend %code-snippet-radius;
|
@extend %code-snippet-radius;
|
||||||
|
|
||||||
color: var(--highlighter-rouge-color);
|
color: var(--highlighter-rouge-color);
|
||||||
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +66,8 @@ div > pre {
|
|||||||
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
.lineno {
|
.lineno {
|
||||||
margin: 0.8rem 0;
|
margin-left: 0.2rem;
|
||||||
padding: 0 0.5rem;
|
padding-right: 0.5rem;
|
||||||
min-width: 2.2rem;
|
min-width: 2.2rem;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color: var(--highlight-lineno-color);
|
color: var(--highlight-lineno-color);
|
||||||
@@ -111,7 +108,6 @@ code {
|
|||||||
&.highlighter-rouge {
|
&.highlighter-rouge {
|
||||||
font-size: $code-font-size;
|
font-size: $code-font-size;
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
margin: 0 0.15rem;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inline-code-bg);
|
background-color: var(--inline-code-bg);
|
||||||
}
|
}
|
||||||
@@ -131,8 +127,16 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
padding-left: 1rem;
|
padding: 1.5rem 1.5rem 1.5rem 1rem;
|
||||||
padding-right: 1rem;
|
|
||||||
|
// Prevent some browser extends from
|
||||||
|
// changing the URL string of code block.
|
||||||
|
a {
|
||||||
|
color: inherit !important;
|
||||||
|
border-bottom: none !important;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide line numbers for default, console, and terminal code snippets */
|
/* Hide line numbers for default, console, and terminal code snippets */
|
||||||
@@ -149,3 +153,26 @@ div {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div[class^='language-']::before {
|
||||||
|
content: attr(lang);
|
||||||
|
position: absolute;
|
||||||
|
right: 2rem;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1650px) {
|
||||||
|
div[class^='language-']::before {
|
||||||
|
right: 3.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Mainly scss variables
|
* Mainly scss variables
|
||||||
*
|
|
||||||
* v2.1
|
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2020 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* --- ↓ width and height ---- */
|
/* --- ↓ width and height ---- */
|
||||||
|
|
||||||
$tab-height: 3.3rem;
|
$tab-height: 3.2rem;
|
||||||
$tab-cursor-height: 1.6rem;
|
$tab-cursor-height: 1.6rem;
|
||||||
|
|
||||||
$sidebar-width-small: 210px;
|
$sidebar-width-small: 210px;
|
||||||
@@ -1,29 +1,25 @@
|
|||||||
/*!
|
/*
|
||||||
* The syntax dark mode styles.
|
* The syntax dark mode styles.
|
||||||
* v2.0
|
*/
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2018-2019 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
@mixin dark-syntax {
|
@mixin dark-syntax {
|
||||||
/* ----- My styles ------ */
|
/* ----- My styles ------ */
|
||||||
--highlight-bg-color: #272822;
|
--highlight-bg-color: #252525;
|
||||||
--highlighter-rouge-color: #de6b18;
|
--highlighter-rouge-color: #de6b18;
|
||||||
--highlight-lineno-color: #6c6c6d;
|
--highlight-lineno-color: #6c6c6d;
|
||||||
--highlight-lineno-border-color: #3c4042;
|
--highlight-lineno-border-color: #303435;
|
||||||
--inline-code-bg: var(--highlight-bg-color);
|
--inline-code-bg: #272822;
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
.gp { color: #818c96; }
|
.gp { color: #818c96; }
|
||||||
}
|
}
|
||||||
|
|
||||||
pre { color: #818c96; } /* override Bootstrap */
|
pre { color: #bfbfbf; } /* override Bootstrap */
|
||||||
kbd { background-color: black; }
|
kbd { background-color: black; }
|
||||||
|
|
||||||
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
||||||
.highlight pre { background-color: #272822; }
|
.highlight pre { background-color: var(--highlight-bg-color); }
|
||||||
.highlight .hll { background-color: #272822; }
|
.highlight .hll { background-color: var(--highlight-bg-color); }
|
||||||
.highlight .c { color: #75715e; } /* Comment */
|
.highlight .c { color: #75715e; } /* Comment */
|
||||||
.highlight .err { color: #960050; background-color: #1e0010; } /* Error */
|
.highlight .err { color: #960050; background-color: #1e0010; } /* Error */
|
||||||
.highlight .k { color: #66d9ef; } /* Keyword */
|
.highlight .k { color: #66d9ef; } /* Keyword */
|
||||||
@@ -35,7 +31,7 @@
|
|||||||
.highlight .cp { color: #75715e; } /* Comment.Preproc */
|
.highlight .cp { color: #75715e; } /* Comment.Preproc */
|
||||||
.highlight .c1 { color: #75715e; } /* Comment.Single */
|
.highlight .c1 { color: #75715e; } /* Comment.Single */
|
||||||
.highlight .cs { color: #75715e; } /* Comment.Special */
|
.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 .gs { font-weight: bold; } /* Generic.Strong */
|
||||||
.highlight .kc { color: #66d9ef; } /* Keyword.Constant */
|
.highlight .kc { color: #66d9ef; } /* Keyword.Constant */
|
||||||
.highlight .kd { color: #66d9ef; } /* Keyword.Declaration */
|
.highlight .kd { color: #66d9ef; } /* Keyword.Declaration */
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
/*!
|
/*
|
||||||
* The main dark mode styles
|
* The main dark mode styles
|
||||||
* v2.0
|
*/
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2018-2019 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
@mixin dark-scheme {
|
@mixin dark-scheme {
|
||||||
/* framework */
|
/* framework */
|
||||||
@@ -19,6 +15,7 @@
|
|||||||
|
|
||||||
/* common color */
|
/* common color */
|
||||||
--text-color: rgb(175, 176, 177);
|
--text-color: rgb(175, 176, 177);
|
||||||
|
--heading-color: #cccccc;
|
||||||
--text-muted-color: rgb(107, 116, 124);
|
--text-muted-color: rgb(107, 116, 124);
|
||||||
--link-color: rgb(138, 180, 248);
|
--link-color: rgb(138, 180, 248);
|
||||||
--link-underline-color: rgb(82, 108, 150);
|
--link-underline-color: rgb(82, 108, 150);
|
||||||
@@ -32,6 +29,8 @@
|
|||||||
--btn-box-shadow: var(--main-wrapper-bg);
|
--btn-box-shadow: var(--main-wrapper-bg);
|
||||||
--card-header-bg: rgb(51, 50, 50);
|
--card-header-bg: rgb(51, 50, 50);
|
||||||
--label-color: rgb(108, 117, 125);
|
--label-color: rgb(108, 117, 125);
|
||||||
|
--checkbox-color: rgb(118 120 121);
|
||||||
|
--checkbox-checked-color: var(--link-color);
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
--nav-cursor-color: rgb(183, 182, 182);
|
--nav-cursor-color: rgb(183, 182, 182);
|
||||||
@@ -49,6 +48,8 @@
|
|||||||
--btn-text-color: var(--text-color);
|
--btn-text-color: var(--text-color);
|
||||||
--btn-paginator-border-color: var(--btn-border-color);
|
--btn-paginator-border-color: var(--btn-border-color);
|
||||||
--btn-paginator-shadow: var(--main-wrapper-bg);
|
--btn-paginator-shadow: var(--main-wrapper-bg);
|
||||||
|
--pin-bg: rgb(34 35 37);
|
||||||
|
--pin-color: inherit;
|
||||||
|
|
||||||
/* Posts */
|
/* Posts */
|
||||||
--toc-highlight: rgb(116, 178, 243);
|
--toc-highlight: rgb(116, 178, 243);
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
/*!
|
/*
|
||||||
* The syntax light mode code snippet colors.
|
* The syntax light mode code snippet colors.
|
||||||
* v2.1
|
*/
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2020 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
@mixin light-syntax {
|
@mixin light-syntax {
|
||||||
/* see: <https://raw.githubusercontent.com/jwarby/pygments-css/master/github.css> */
|
/* see: <https://raw.githubusercontent.com/jwarby/pygments-css/master/github.css> */
|
||||||
@@ -72,7 +68,7 @@
|
|||||||
|
|
||||||
/* --- custom light colors --- */
|
/* --- custom light colors --- */
|
||||||
--highlight-bg-color: #f7f7f7;
|
--highlight-bg-color: #f7f7f7;
|
||||||
--highlighter-rouge-color: #353a3d;
|
--highlighter-rouge-color: #505050;
|
||||||
--highlight-lineno-color: #c2c6cc;
|
--highlight-lineno-color: #c2c6cc;
|
||||||
--highlight-lineno-border-color: #e9ecef;
|
--highlight-lineno-border-color: #e9ecef;
|
||||||
--inline-code-bg: #f3f3f3;
|
--inline-code-bg: #f3f3f3;
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
/*!
|
/*
|
||||||
* The syntax light mode typography colors
|
* The syntax light mode typography colors
|
||||||
* v2.1
|
*/
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2020 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
@mixin light-scheme {
|
@mixin light-scheme {
|
||||||
/* Common */
|
/* Common */
|
||||||
@@ -13,7 +9,8 @@
|
|||||||
--main-wrapper-bg: white;
|
--main-wrapper-bg: white;
|
||||||
--main-border-color: #f3f3f3;
|
--main-border-color: #f3f3f3;
|
||||||
--btn-border-color: #e9ecef;
|
--btn-border-color: #e9ecef;
|
||||||
--text-color: #333333;
|
--text-color: #4a4a4a;
|
||||||
|
--heading-color: black;
|
||||||
--blockquote-border-color: #eee;
|
--blockquote-border-color: #eee;
|
||||||
--blockquote-text-color: #9a9a9a;
|
--blockquote-text-color: #9a9a9a;
|
||||||
--link-color: #2a408e;
|
--link-color: #2a408e;
|
||||||
@@ -23,8 +20,10 @@
|
|||||||
--tb-border-color: #eaeaea;
|
--tb-border-color: #eaeaea;
|
||||||
--button-bg: #fff;
|
--button-bg: #fff;
|
||||||
--btn-backtotop-color: #686868;
|
--btn-backtotop-color: #686868;
|
||||||
--btn-backtotop-border-color: #f1f1f1; //--main-border-color,
|
--btn-backtotop-border-color: #f1f1f1;
|
||||||
--btn-box-shadow: #eaeaea;
|
--btn-box-shadow: #eaeaea;
|
||||||
|
--checkbox-color: #c5c5c5;
|
||||||
|
--checkbox-checked-color: #07a8f7;
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
--sidebar-bg: radial-gradient(
|
--sidebar-bg: radial-gradient(
|
||||||
@@ -50,12 +49,14 @@
|
|||||||
--btn-text-color: #f8f8f8;
|
--btn-text-color: #f8f8f8;
|
||||||
--btn-paginator-border-color: #f1f1f1;
|
--btn-paginator-border-color: #f1f1f1;
|
||||||
--btn-paginator-shadow: #4b92d2;
|
--btn-paginator-shadow: #4b92d2;
|
||||||
|
--pin-bg: #f5f5f5;
|
||||||
|
--pin-color: #999fa4;
|
||||||
|
|
||||||
/* Posts */
|
/* Posts */
|
||||||
--btn-share-hover-color: var(--link-color);
|
--btn-share-hover-color: var(--link-color);
|
||||||
--card-border-color: #f1f1f1;
|
--card-border-color: #f1f1f1;
|
||||||
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
||||||
--label-color: #808080;
|
--label-color: #616161;
|
||||||
--relate-post-date: rgba(30, 55, 70, 0.4);
|
--relate-post-date: rgba(30, 55, 70, 0.4);
|
||||||
--tag-bg: rgba(0, 0, 0, 0.075);
|
--tag-bg: rgba(0, 0, 0, 0.075);
|
||||||
--tag-border: #dee2e6;
|
--tag-border: #dee2e6;
|
||||||
23
_sass/jekyll-theme-chirpy.scss
Normal file
23
_sass/jekyll-theme-chirpy.scss
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*!
|
||||||
|
* The styles for Jekyll theme Chirpy
|
||||||
|
*
|
||||||
|
* Chirpy v3.3.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||||
|
* © 2019 Cotes Chung
|
||||||
|
* MIT Licensed
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import
|
||||||
|
"colors/light-typography",
|
||||||
|
"colors/dark-typography",
|
||||||
|
|
||||||
|
"addon/module",
|
||||||
|
"addon/variables",
|
||||||
|
"addon/syntax",
|
||||||
|
"addon/commons",
|
||||||
|
|
||||||
|
"layout/home",
|
||||||
|
"layout/post",
|
||||||
|
"layout/tags",
|
||||||
|
"layout/archives",
|
||||||
|
"layout/categories",
|
||||||
|
"layout/category-tag";
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
---
|
/*
|
||||||
# Style for Archives
|
Style for Archives
|
||||||
# v2.0
|
*/
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
|
||||||
|
|
||||||
%date-timeline {
|
%date-timeline {
|
||||||
content: "";
|
content: "";
|
||||||
@@ -19,43 +12,15 @@
|
|||||||
background-color: var(--timeline-color);
|
background-color: var(--timeline-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
%date-font {
|
|
||||||
font-family: 'Roboto Condensed', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
#archives {
|
#archives {
|
||||||
letter-spacing: 0.03rem;
|
letter-spacing: 0.03rem;
|
||||||
li {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
line-height: 3rem;
|
|
||||||
&:nth-child(odd) {
|
|
||||||
background-color: var(--main-wrapper-bg, #fff);
|
|
||||||
background-image: linear-gradient(
|
|
||||||
to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
|
||||||
}
|
|
||||||
>div {
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span.lead {
|
span.lead {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
@extend %date-font;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 8px;
|
left: 8px;
|
||||||
|
|
||||||
&:not(:first-child) {
|
&::after { /* Year dot */
|
||||||
position: relative;
|
|
||||||
left: 4px;
|
|
||||||
&::after {
|
|
||||||
left: 67px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
/* Year dot */
|
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -72,16 +37,72 @@
|
|||||||
box-shadow: 0 0 2px 0 #c2c6cc;
|
box-shadow: 0 0 2px 0 #c2c6cc;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
position: relative;
|
||||||
|
left: 4px;
|
||||||
|
&::after {
|
||||||
|
left: 67px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // #archives span.lead
|
} // #archives span.lead
|
||||||
|
|
||||||
|
ul {
|
||||||
|
li {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
line-height: 3rem;
|
||||||
|
|
||||||
|
div {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
a {
|
||||||
|
/* post title in Archvies */
|
||||||
|
margin-left: 2.5rem;
|
||||||
|
position: relative;
|
||||||
|
top: 0.1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(odd) {
|
||||||
|
background-color: var(--main-wrapper-bg, #fff);
|
||||||
|
background-image: linear-gradient(to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
@extend %date-timeline;
|
||||||
|
|
||||||
|
height: 2.8rem;
|
||||||
|
top: -1.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child::before {
|
||||||
|
@extend %date-timeline;
|
||||||
|
|
||||||
|
height: 3.06rem;
|
||||||
|
top: -1.61rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:last-child) > li:last-child::after {
|
||||||
|
height: 3.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child > li:last-child::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
} // #archives ul
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
&.month {
|
&.month {
|
||||||
width: 1.4rem;
|
width: 1.4rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@extend %date-font;
|
|
||||||
~a::before {
|
~ a::before {
|
||||||
/* A dot for Month and Day */
|
/* A dot for Month and Day */
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -110,36 +131,8 @@
|
|||||||
}
|
}
|
||||||
} // #archives .date
|
} // #archives .date
|
||||||
|
|
||||||
ul {
|
|
||||||
>li {
|
|
||||||
>div>a {
|
|
||||||
/* post title in Archvies */
|
|
||||||
margin-left: 2.5rem;
|
|
||||||
position: relative;
|
|
||||||
top: .1rem;
|
|
||||||
}
|
|
||||||
&::after {
|
|
||||||
@extend %date-timeline;
|
|
||||||
height: 2.8rem;
|
|
||||||
top: -1.3rem;
|
|
||||||
}
|
|
||||||
&:first-child::before {
|
|
||||||
@extend %date-timeline;
|
|
||||||
height: 3.06rem;
|
|
||||||
top: -1.61rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:not(:last-child)>li:last-child::after {
|
|
||||||
height: 3.4rem;
|
|
||||||
}
|
|
||||||
&:last-child>li:last-child::after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
} // #archives ul
|
|
||||||
|
|
||||||
} // #archives
|
} // #archives
|
||||||
|
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
#archives {
|
#archives {
|
||||||
margin-top: -1rem;
|
margin-top: -1rem;
|
||||||
@@ -1,13 +1,6 @@
|
|||||||
---
|
/*
|
||||||
# Style for Tab Categories
|
Style for Tab Categories
|
||||||
# v2.0
|
*/
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
|
||||||
|
|
||||||
%category-icon-color {
|
%category-icon-color {
|
||||||
color: gray;
|
color: gray;
|
||||||
@@ -18,11 +11,19 @@
|
|||||||
.card-header {
|
.card-header {
|
||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
&.far,
|
||||||
|
&.fas {
|
||||||
|
font-size: 86%; // fontawesome icons
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
>i {
|
> i {
|
||||||
@extend %category-icon-color;
|
@extend %category-icon-color;
|
||||||
}
|
}
|
||||||
&:first-child {
|
&:first-child {
|
||||||
@@ -32,16 +33,10 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header>span>i:first-child {
|
.card-header > span > i:first-child {
|
||||||
@extend %category-icon-color;
|
@extend %category-icon-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
|
||||||
&.far, &.fas {
|
|
||||||
font-size: 86%; // fontawesome icons
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // .categories
|
} // .categories
|
||||||
|
|
||||||
.category-trigger {
|
.category-trigger {
|
||||||
@@ -49,10 +44,10 @@
|
|||||||
height: 1.7rem;
|
height: 1.7rem;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #6c757d!important;
|
color: #6c757d !important;
|
||||||
>i.fas {
|
> i.fas {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: .7rem;
|
height: 0.7rem;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
transition: 300ms ease all;
|
transition: 300ms ease all;
|
||||||
}
|
}
|
||||||
@@ -68,4 +63,4 @@
|
|||||||
-ms-transform: rotate(-90deg); /* IE 9 */
|
-ms-transform: rotate(-90deg); /* IE 9 */
|
||||||
-webkit-transform: rotate(-90deg); /* Safari 3-8 */
|
-webkit-transform: rotate(-90deg); /* Safari 3-8 */
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
---
|
/*
|
||||||
# Style for page Category and Tag
|
Style for page Category and Tag
|
||||||
# v2.0
|
*/
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
|
.dash {
|
||||||
|
margin: 0 .5rem .6rem .5rem;
|
||||||
|
border-bottom: 2px dotted var(--dash-color);
|
||||||
|
}
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
#page-category,
|
||||||
|
#page-tag {
|
||||||
#page-category, #page-tag {
|
ul > li {
|
||||||
ul>li {
|
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
padding: .6rem 0;
|
padding: 0.6rem 0;
|
||||||
|
|
||||||
&::before { // dot
|
&::before { // dot
|
||||||
background: #999;
|
background: #999;
|
||||||
width: 5px;
|
width: 5px;
|
||||||
@@ -21,53 +21,52 @@
|
|||||||
display: block;
|
display: block;
|
||||||
content: "";
|
content: "";
|
||||||
position: relative;
|
position: relative;
|
||||||
top: .6rem;
|
top: 0.6rem;
|
||||||
margin-right: .5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
>a { /* post's title */
|
|
||||||
font-size: 1.1rem;
|
> a { /* post's title */
|
||||||
@extend %no-bottom-border;
|
@extend %no-bottom-border;
|
||||||
|
|
||||||
|
font-size: 1.1rem;
|
||||||
}
|
}
|
||||||
>span:last-child {
|
|
||||||
|
> span:last-child {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
} /* post's date */
|
||||||
/* post's date */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-tag h1>i { // tag icon
|
#page-tag h1 > i { // tag icon
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-category h1>i {
|
#page-category h1 > i {
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
#page-category,
|
||||||
#page-category &,
|
#page-tag,
|
||||||
#page-tag &,
|
#access-lastmod {
|
||||||
#access-lastmod & {
|
a:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
|
|
||||||
margin-bottom: -1px; // Avoid jumping
|
margin-bottom: -1px; // Avoid jumping
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dash {
|
|
||||||
margin: 0 .5rem .6rem .5rem;
|
|
||||||
border-bottom: 2px dotted var(--dash-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
#page-category, #page-tag {
|
#page-category,
|
||||||
ul>li {
|
#page-tag {
|
||||||
|
ul > li {
|
||||||
&::before {
|
&::before {
|
||||||
margin: 0 .5rem;
|
margin: 0 .5rem;
|
||||||
}
|
}
|
||||||
>a {
|
> a {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,57 +1,6 @@
|
|||||||
---
|
/*
|
||||||
# Style for Homepage
|
Style for Homepage
|
||||||
# v2.0
|
*/
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
|
||||||
|
|
||||||
#post-list {
|
|
||||||
margin-top: 1rem;
|
|
||||||
padding-right: .5rem;
|
|
||||||
|
|
||||||
.post-preview {
|
|
||||||
padding-top: 1.5rem;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
border-bottom: 1px solid var(--main-border-color);
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 1.4rem;
|
|
||||||
margin: 0;
|
|
||||||
~i { // pinned icon
|
|
||||||
font-size: .86rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-meta {
|
|
||||||
i {
|
|
||||||
font-size: .73rem;
|
|
||||||
&:not(:first-child) { // post-meta icons on the homepage
|
|
||||||
margin-left: 1.5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-content {
|
|
||||||
margin-top: .6rem;
|
|
||||||
margin-bottom: .6rem;
|
|
||||||
color: var(--post-list-text-color);
|
|
||||||
>p {
|
|
||||||
/* Make preview shorter on the homepage */
|
|
||||||
margin: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // .post-preview
|
|
||||||
|
|
||||||
} // #post-list
|
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
@@ -77,7 +26,7 @@
|
|||||||
font-family: 'Lato', sans-serif;
|
font-family: 'Lato', sans-serif;
|
||||||
background-color: var(--button-bg);
|
background-color: var(--button-bg);
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--btn-paginator-hover-color)
|
background-color: var(--btn-paginator-hover-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.active {
|
&.active {
|
||||||
@@ -107,11 +56,62 @@
|
|||||||
|
|
||||||
} // .pagination
|
} // .pagination
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
#post-list {
|
||||||
#post-list .post-meta>span i:not(:first-child) {
|
margin-top: 1rem;
|
||||||
margin-left: 1rem;
|
padding-right: 0.5rem;
|
||||||
}
|
|
||||||
}
|
.post-preview {
|
||||||
|
padding-top: 1.5rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
border-bottom: 1px solid var(--main-border-color);
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
@extend %link-hover;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-meta {
|
||||||
|
i {
|
||||||
|
font-size: 0.73rem;
|
||||||
|
}
|
||||||
|
span:not(:last-child) {
|
||||||
|
margin-right: 1.2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-content {
|
||||||
|
margin-top: 0.6rem;
|
||||||
|
margin-bottom: 0.6rem;
|
||||||
|
color: var(--post-list-text-color);
|
||||||
|
> p {
|
||||||
|
/* Make preview shorter on the homepage */
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin {
|
||||||
|
> i {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
padding-left: 3px;
|
||||||
|
color: var(--pin-color);
|
||||||
|
}
|
||||||
|
> span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // .post-preview
|
||||||
|
|
||||||
|
} // #post-list
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 830px) {
|
||||||
@@ -125,10 +125,25 @@
|
|||||||
|
|
||||||
#post-list {
|
#post-list {
|
||||||
margin-top: 1.5rem;
|
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 {
|
.pagination {
|
||||||
font-size: .85rem;
|
font-size: 0.85rem;
|
||||||
.page-item .page-link {
|
.page-item .page-link {
|
||||||
width: 2.2rem;
|
width: 2.2rem;
|
||||||
height: 2.2rem;
|
height: 2.2rem;
|
||||||
@@ -142,4 +157,4 @@
|
|||||||
#post-list {
|
#post-list {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,10 @@
|
|||||||
---
|
/*
|
||||||
# Post-specific style
|
Post-specific style
|
||||||
# v2.0
|
*/
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
|
||||||
{% include_relative _addon/syntax.scss %}
|
|
||||||
|
|
||||||
$prompt-older: "{{ site.data.label.post.button.previous }}";
|
|
||||||
$prompt-newer: "{{ site.data.label.post.button.next }}";
|
|
||||||
|
|
||||||
@mixin btn-sharing-color($light-color, $important: false) {
|
@mixin btn-sharing-color($light-color, $important: false) {
|
||||||
@if $important {
|
@if $important {
|
||||||
color: var(--btn-share-color, $light-color)!important;
|
color: var(--btn-share-color, $light-color) !important;
|
||||||
} @else {
|
} @else {
|
||||||
color: var(--btn-share-color, $light-color);
|
color: var(--btn-share-color, $light-color);
|
||||||
}
|
}
|
||||||
@@ -27,25 +16,39 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
border-color: var(--btn-border-color);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeago::before {
|
||||||
|
content: attr(prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
#post-wrapper .post-meta {
|
||||||
|
> div:nth-child(2) {
|
||||||
|
> span:not(:first-child)::before {
|
||||||
|
@include dot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pv::after {
|
||||||
|
content: " views";
|
||||||
|
}
|
||||||
|
|
||||||
|
.readtime::after {
|
||||||
|
content: " read";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
> ol, > ul, > dl {
|
.preview-img {
|
||||||
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 {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 2.5rem;
|
|
||||||
@include align-center;
|
@include align-center;
|
||||||
|
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 2.5rem !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,57 +68,59 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
@include btn-post-nav;
|
@include btn-post-nav;
|
||||||
|
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #2a408e;
|
background: #2a408e;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-color: #2a408e;
|
border-color: #2a408e;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
@include btn-post-nav;
|
@include btn-post-nav;
|
||||||
|
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background: none;
|
background: none;
|
||||||
color: gray;
|
color: gray;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: none;
|
border-color: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.btn-outline-primary.disabled:focus {
|
&.btn-outline-primary.disabled:focus {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
color: var(--text-muted-color);
|
||||||
|
font-size: 0.65rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
content: attr(prompt);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
left: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
right: 0.5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
margin-top: .3rem;
|
margin-top: 0.3rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
a, span {
|
|
||||||
&::before {
|
|
||||||
color: var(--text-muted-color);
|
|
||||||
font-size: .65rem;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
&:first-child {
|
|
||||||
border-top-right-radius: 0;
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
left: .5px;
|
|
||||||
&::before {
|
|
||||||
content: $prompt-older
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:last-child {
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
right: .5px;
|
|
||||||
&::before {
|
|
||||||
content: $prompt-newer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // .post-navigation
|
} // .post-navigation
|
||||||
|
|
||||||
@keyframes fade-up {
|
@keyframes fade-up {
|
||||||
@@ -132,48 +137,46 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#toc-wrapper {
|
#toc-wrapper {
|
||||||
margin-top: 7rem;
|
|
||||||
border-left: 1px solid rgba(158, 158, 158, 0.17);
|
border-left: 1px solid rgba(158, 158, 158, 0.17);
|
||||||
position: -webkit-sticky;
|
position: -webkit-sticky;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 4rem;
|
top: 4rem;
|
||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
animation: fade-up .8s;
|
animation: fade-up 0.8s;
|
||||||
&.topbar-down {
|
&.topbar-down {
|
||||||
top: 6rem;
|
top: 6rem;
|
||||||
}
|
}
|
||||||
>h3 {
|
> span {
|
||||||
@include label(inherit, 600);
|
@include panel-label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#toc li>a {
|
#toc li > a {
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
padding-top: .5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: .5rem;
|
padding-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --- Related Posts --- */
|
||||||
/*--- Related Posts ---*/
|
|
||||||
|
|
||||||
#related-posts {
|
#related-posts {
|
||||||
>h3 {
|
> h3 {
|
||||||
@include label(1.1rem, 600);
|
@include label(1.1rem, 600);
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
border: 1px solid var(--card-border-color);
|
border-color: var(--card-border-color);
|
||||||
background-color: var(--card-bg);
|
background-color: var(--card-bg);
|
||||||
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
||||||
-webkit-transition: all .3s ease-in-out;
|
-webkit-transition: all 0.3s ease-in-out;
|
||||||
-moz-transition: all .3s ease-in-out;
|
-moz-transition: all 0.3s ease-in-out;
|
||||||
transition: all .3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
h3 {
|
h3 {
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
-webkit-transform: translate3d(0, -3px, 0);
|
-webkit-transform: translate3d(0, -3px, 0);
|
||||||
transform: translate3d(0, -3px, 0);
|
transform: translate3d(0, -3px, 0);
|
||||||
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
box-shadow: 0 10px 15px -4px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,8 +185,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: .9rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: 0.5rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
@@ -198,7 +201,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
ul {
|
ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding-inline-start: 1.5rem;
|
padding-inline-start: 1.5rem;
|
||||||
>li::before {
|
> li::before {
|
||||||
background: #c2c9d4;
|
background: #c2c9d4;
|
||||||
width: 5px;
|
width: 5px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
@@ -224,34 +227,35 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
}
|
}
|
||||||
|
|
||||||
%btn-share-hovor {
|
%btn-share-hovor {
|
||||||
color: var(--btn-share-hover-color)!important;
|
color: var(--btn-share-hover-color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-wrapper {
|
.share-wrapper {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
.share-icons {
|
.share-icons {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
a {
|
a {
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: .25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
>i {
|
> i {
|
||||||
@extend %btn-share-hovor;
|
@extend %btn-share-hovor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>i {
|
> i {
|
||||||
padding-top: .35rem;
|
padding-top: 0.35rem;
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %btn-share-hovor;
|
@extend %btn-share-hovor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.fab {
|
.fab {
|
||||||
&.fa-twitter {
|
&.fa-twitter {
|
||||||
@include btn-sharing-color(rgba(29, 161, 242, 1.00));
|
@include btn-sharing-color(rgba(29, 161, 242, 1));
|
||||||
}
|
}
|
||||||
&.fa-facebook-square {
|
&.fa-facebook-square {
|
||||||
@include btn-sharing-color(rgb(66, 95, 156));
|
@include btn-sharing-color(rgb(66, 95, 156));
|
||||||
@@ -272,9 +276,9 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
|
|
||||||
} // .share-wrapper
|
} // .share-wrapper
|
||||||
|
|
||||||
|
|
||||||
.share-label {
|
.share-label {
|
||||||
@include label(inherit, 400, inherit);
|
@include label(inherit, 400, inherit);
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: ":";
|
content: ":";
|
||||||
}
|
}
|
||||||
@@ -282,64 +286,61 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
|
|
||||||
.license-wrapper {
|
.license-wrapper {
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
>a {
|
> a {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i {
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
span:last-child {
|
span:last-child {
|
||||||
font-size: .85rem;
|
font-size: 0.85rem;
|
||||||
}
|
}
|
||||||
} // .license-wrapper
|
} // .license-wrapper
|
||||||
|
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
.post-tail-bottom {
|
.post-tail-bottom {
|
||||||
-ms-flex-wrap: wrap-reverse!important;
|
-ms-flex-wrap: wrap-reverse !important;
|
||||||
flex-wrap: wrap-reverse!important;
|
flex-wrap: wrap-reverse !important;
|
||||||
>div:first-child {
|
>div:first-child {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post-content > div[class^='language-'] {
|
||||||
|
@include ml-mr(-1.25rem);
|
||||||
|
|
||||||
|
border-radius: 0;
|
||||||
|
&::before { // the lang badge
|
||||||
|
right: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 768px) {
|
@media all and (max-width: 768px) {
|
||||||
.post img {
|
.post-content > p > img {
|
||||||
max-width: calc(100% + 1rem);
|
max-width: calc(100% + 1rem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 768px) {
|
@media all and (min-width: 768px) {
|
||||||
.post {
|
#post-wrapper {
|
||||||
.post-meta {
|
.post-meta {
|
||||||
>div:not(:first-child)::before {
|
>div:not(:first-child)::before {
|
||||||
content: "\2022";
|
@include dot(0.5rem, 0.2rem);
|
||||||
color: rgba(158, 158, 158, 0.8);
|
|
||||||
font-weight: bold;
|
|
||||||
padding-left: .5rem;
|
|
||||||
padding-right: .3rem;
|
|
||||||
}
|
}
|
||||||
&.flex-column {
|
&.flex-column {
|
||||||
-webkit-box-orient: horizontal!important;
|
-webkit-box-orient: horizontal !important;
|
||||||
-webkit-box-direction: normal!important;
|
-webkit-box-direction: normal !important;
|
||||||
-ms-flex-direction: row!important;
|
-ms-flex-direction: row !important;
|
||||||
flex-direction: row!important;
|
flex-direction: row !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // .post
|
} // .post
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 768px) and (max-width: 830px) {
|
|
||||||
.post img {
|
|
||||||
max-width: calc(100% + 2rem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 830px) {
|
||||||
.post-navigation {
|
.post-navigation {
|
||||||
@@ -1,18 +1,11 @@
|
|||||||
---
|
/*
|
||||||
# Styles for Tab Tags
|
Styles for Tab Tags
|
||||||
# v2.0
|
*/
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
border-radius: 0.7em;
|
border-radius: 0.7em;
|
||||||
padding: 6px 8px 7px;
|
padding: 6px 8px 7px;
|
||||||
margin-right: .8rem;
|
margin-right: 0.8rem;
|
||||||
line-height: 3rem;
|
line-height: 3rem;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
border: 1px solid var(--tag-border) !important;
|
border: 1px solid var(--tag-border) !important;
|
||||||
@@ -22,4 +15,4 @@
|
|||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
font-family: 'Oswald', sans-serif;
|
font-family: 'Oswald', sans-serif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Create HTML pages for Categories and Tags in posts.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# Call from the '_posts' sibling directory.
|
|
||||||
#
|
|
||||||
# v2.2
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# Published under MIT License
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
TYPE_CATEGORY=0
|
|
||||||
TYPE_TAG=1
|
|
||||||
|
|
||||||
category_count=0
|
|
||||||
tag_count=0
|
|
||||||
|
|
||||||
_read_yaml() {
|
|
||||||
local _endline="$(grep -n "\-\-\-" "$1" | cut -d: -f 1 | sed -n '2p')"
|
|
||||||
head -"$_endline" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
read_categories() {
|
|
||||||
local _yaml="$(_read_yaml "$1")"
|
|
||||||
local _categories="$(echo "$_yaml" | yq r - "categories.*")"
|
|
||||||
local _category="$(echo "$_yaml" | yq r - "category")"
|
|
||||||
|
|
||||||
if [[ -n $_categories ]]; then
|
|
||||||
echo "$_categories"
|
|
||||||
elif [[ -n $_category ]]; then
|
|
||||||
echo "$_category"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
read_tags() {
|
|
||||||
local _yaml="$(_read_yaml "$1")"
|
|
||||||
local _tags="$(echo "$_yaml" | yq r - "tags.*")"
|
|
||||||
local _tag="$(echo "$_yaml" | yq r - "tag")"
|
|
||||||
|
|
||||||
if [[ -n $_tags ]]; then
|
|
||||||
echo "$_tags"
|
|
||||||
elif [[ -n $_tag ]]; then
|
|
||||||
echo "$_tag"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
init() {
|
|
||||||
|
|
||||||
if [[ -d categories ]]; then
|
|
||||||
rm -rf categories
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -d tags ]]; then
|
|
||||||
rm -rf tags
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d _posts ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir categories tags
|
|
||||||
}
|
|
||||||
|
|
||||||
create_category() {
|
|
||||||
if [[ -n $1 ]]; then
|
|
||||||
local _name=$1
|
|
||||||
local _filepath="categories/$(echo "$_name" | sed 's/ /-/g' | awk '{print tolower($0)}').html"
|
|
||||||
|
|
||||||
if [[ ! -f $_filepath ]]; then
|
|
||||||
echo "---" > "$_filepath"
|
|
||||||
echo "layout: category" >> "$_filepath"
|
|
||||||
echo "title: $_name" >> "$_filepath"
|
|
||||||
echo "category: $_name" >> "$_filepath"
|
|
||||||
echo "---" >> "$_filepath"
|
|
||||||
|
|
||||||
((category_count = category_count + 1))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
create_tag() {
|
|
||||||
if [[ -n $1 ]]; then
|
|
||||||
local _name=$1
|
|
||||||
local _filepath="tags/$(echo "$_name" | sed "s/ /-/g;s/'//g" | awk '{print tolower($0)}').html"
|
|
||||||
|
|
||||||
if [[ ! -f $_filepath ]]; then
|
|
||||||
|
|
||||||
echo "---" > "$_filepath"
|
|
||||||
echo "layout: tag" >> "$_filepath"
|
|
||||||
echo "title: $_name" >> "$_filepath"
|
|
||||||
echo "tag: $_name" >> "$_filepath"
|
|
||||||
echo "---" >> "$_filepath"
|
|
||||||
|
|
||||||
((tag_count = tag_count + 1))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
#########################################
|
|
||||||
# Create HTML pages for Categories/Tags.
|
|
||||||
# Arguments:
|
|
||||||
# $1 - an array string
|
|
||||||
# $2 - type specified option
|
|
||||||
#########################################
|
|
||||||
create_pages() {
|
|
||||||
if [[ -n $1 ]]; then
|
|
||||||
# split string to array
|
|
||||||
IFS_BAK=$IFS
|
|
||||||
IFS=$'\n'
|
|
||||||
local _string=$1
|
|
||||||
|
|
||||||
case $2 in
|
|
||||||
|
|
||||||
$TYPE_CATEGORY)
|
|
||||||
for i in $_string; do
|
|
||||||
create_category "$i"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
$TYPE_TAG)
|
|
||||||
for i in $_string; do
|
|
||||||
create_tag "$i"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
*) ;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
IFS=$IFS_BAK
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
|
|
||||||
init
|
|
||||||
|
|
||||||
for _file in $(find "_posts" -type f \( -iname \*.md -o -iname \*.markdown \)); do
|
|
||||||
local _categories=$(read_categories "$_file")
|
|
||||||
local _tags=$(read_tags "$_file")
|
|
||||||
|
|
||||||
create_pages "$_categories" $TYPE_CATEGORY
|
|
||||||
create_pages "$_tags" $TYPE_TAG
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $category_count -gt 0 ]]; then
|
|
||||||
echo "[INFO] Succeed! $category_count category-pages created."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $tag_count -gt 0 ]]; then
|
|
||||||
echo "[INFO] Succeed! $tag_count tag-pages created."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Find out the posts that have been modified and record
|
|
||||||
# its lastmod information to file '_data/updates.yml'
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# Call from the '_posts' sibling directory.
|
|
||||||
#
|
|
||||||
# v2.2
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# Published under MIT License
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
POST_DIR=_posts
|
|
||||||
OUTPUT_DIR=_data
|
|
||||||
OUTPUT_FILE=updates.yml
|
|
||||||
|
|
||||||
_init() {
|
|
||||||
|
|
||||||
if [[ ! -d "$OUTPUT_DIR" ]]; then
|
|
||||||
mkdir "$OUTPUT_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$OUTPUT_DIR/$OUTPUT_FILE" ]]; then
|
|
||||||
rm -f "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d $POST_DIR ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_has_changed() {
|
|
||||||
local _log_count="$(git log --pretty=%ad "$1" | wc -l | sed 's/ *//')"
|
|
||||||
_log_count=$((_log_count + 0))
|
|
||||||
|
|
||||||
if [[ $_log_count > 1 ]]; then
|
|
||||||
return 0 # true
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 1 # false
|
|
||||||
}
|
|
||||||
|
|
||||||
###################################
|
|
||||||
# Storage the posts' lastmod.
|
|
||||||
#
|
|
||||||
# Args:
|
|
||||||
# - $1 the post's filename
|
|
||||||
# - $2 the post's filepath
|
|
||||||
# Output:
|
|
||||||
# the file '_data/updates.yml'
|
|
||||||
###################################
|
|
||||||
_dump() {
|
|
||||||
local _lasmod="$(git log -1 --pretty=%ad --date=iso "$2")"
|
|
||||||
|
|
||||||
if [[ ! -f "$OUTPUT_DIR/$OUTPUT_FILE" ]]; then
|
|
||||||
touch "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "-" >> "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
echo " filename: '$1'" >> "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
echo " lastmod: '$_lasmod'" >> "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
|
||||||
|
|
||||||
_init
|
|
||||||
|
|
||||||
local _count=0
|
|
||||||
|
|
||||||
for _file in $(find ${POST_DIR} -type f \( -iname \*.md -o -iname \*.markdown \)); do
|
|
||||||
_filename="$(basename "$_file" | sed 's/-\-\+/-/;s/[[:digit:]]\([[:digit:]]*-\)//g;s/\..*//')" # remove date and extension
|
|
||||||
|
|
||||||
if _has_changed "$_file"; then
|
|
||||||
_dump "$_filename" "$_file"
|
|
||||||
((_count = _count + 1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $_count > 0 ]]; then
|
|
||||||
echo "[INFO] Success to update lastmod for $_count post(s)."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Files sync monitor
|
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
# $1 -> the origin file with absolute path.
|
|
||||||
# $2 -> the origin sync directory
|
|
||||||
# $3 -> the destination sync directory
|
|
||||||
|
|
||||||
# Omit the system temp file
|
|
||||||
if [[ ! -f $1 ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
src_dir="$(dirname "$(realpath "$1")")"
|
|
||||||
|
|
||||||
dir_prefix="$(realpath "$2")/"
|
|
||||||
|
|
||||||
related_dir="${src_dir:${#dir_prefix}}"
|
|
||||||
|
|
||||||
dest="$(realpath "$3")/${related_dir}"
|
|
||||||
|
|
||||||
if [[ ! -d $dest ]]; then
|
|
||||||
mkdir -p "$dest"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f $1 ]]; then
|
|
||||||
cp "$1" "$dest"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $related_dir == "_posts" ]]; then
|
|
||||||
bash "$3"/_scripts/sh/create_pages.sh
|
|
||||||
bash "$3"/_scripts/sh/dump_lastmod.sh
|
|
||||||
fi
|
|
||||||
8
_tabs/about.md
Normal file
8
_tabs/about.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: About
|
||||||
|
icon: fas fa-info
|
||||||
|
order: 4
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
> **Note**: Add Markdown syntax content to file `_tabs/about.md` and it will show up on this page.
|
||||||
7
_tabs/archives.md
Normal file
7
_tabs/archives.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
layout: archives
|
||||||
|
title: Archives
|
||||||
|
icon: fas fa-archive
|
||||||
|
order: 3
|
||||||
|
---
|
||||||
|
|
||||||
6
_tabs/categories.md
Normal file
6
_tabs/categories.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
layout: categories
|
||||||
|
title: Categories
|
||||||
|
icon: fas fa-stream
|
||||||
|
order: 1
|
||||||
|
---
|
||||||
6
_tabs/tags.md
Normal file
6
_tabs/tags.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
layout: tags
|
||||||
|
title: Tags
|
||||||
|
icon: fas fa-tags
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
6
app.js
6
app.js
@@ -1,12 +1,8 @@
|
|||||||
---
|
---
|
||||||
layout: compress
|
layout: compress
|
||||||
# Chirpy v2.2
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
---
|
---
|
||||||
|
|
||||||
/* Registering Service Worker */
|
/* Registering Service Worker */
|
||||||
if('serviceWorker' in navigator) {
|
if('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}');
|
navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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');
|
|
||||||
4
assets/css/lib/bootstrap-toc.min.css
vendored
4
assets/css/lib/bootstrap-toc.min.css
vendored
@@ -1,4 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Bootstrap Table of Contents v1.0.1 (http://afeld.github.io/bootstrap-toc/)
|
|
||||||
* Copyright 2015 Aidan Feldman
|
|
||||||
* Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */nav[data-toggle=toc] .nav>li>a{display:block;padding:4px 20px;font-size:13px;font-weight:500;color:#767676}nav[data-toggle=toc] .nav>li>a:focus,nav[data-toggle=toc] .nav>li>a:hover{padding-left:19px;color:#563d7c;text-decoration:none;background-color:transparent;border-left:1px solid #563d7c}nav[data-toggle=toc] .nav-link.active,nav[data-toggle=toc] .nav-link.active:focus,nav[data-toggle=toc] .nav-link.active:hover{padding-left:18px;font-weight:700;color:#563d7c;background-color:transparent;border-left:2px solid #563d7c}nav[data-toggle=toc] .nav-link+ul{display:none;padding-bottom:10px}nav[data-toggle=toc] .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:12px;font-weight:400}nav[data-toggle=toc] .nav .nav>li>a:focus,nav[data-toggle=toc] .nav .nav>li>a:hover{padding-left:29px}nav[data-toggle=toc] .nav .nav>li>.active,nav[data-toggle=toc] .nav .nav>li>.active:focus,nav[data-toggle=toc] .nav .nav>li>.active:hover{padding-left:28px;font-weight:500}nav[data-toggle=toc] .nav-link.active+ul{display:block}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
# The default style for layout Page
|
|
||||||
# v2.2
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
|
||||||
|
|
||||||
{% include_relative _addon/main.scss %}
|
|
||||||
{% include_relative _addon/syntax.scss %}
|
|
||||||
7
assets/css/style.scss
Normal file
7
assets/css/style.scss
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
---
|
||||||
|
|
||||||
|
// see: /_sass/addon/commons.scss
|
||||||
|
$tab-count: {{ site.tabs | size | plus: 1 }}; // plus 1 for home tab
|
||||||
|
|
||||||
|
@import "jekyll-theme-chirpy";
|
||||||
@@ -2,10 +2,6 @@
|
|||||||
layout: compress
|
layout: compress
|
||||||
|
|
||||||
# A part of the Favicons
|
# A part of the Favicons
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
---
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<browserconfig>
|
<browserconfig>
|
||||||
@@ -17,4 +13,4 @@ layout: compress
|
|||||||
<TileColor>#ffffff</TileColor>
|
<TileColor>#ffffff</TileColor>
|
||||||
</tile>
|
</tile>
|
||||||
</msapplication>
|
</msapplication>
|
||||||
</browserconfig>
|
</browserconfig>
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
layout: compress
|
layout: compress
|
||||||
#
|
#
|
||||||
# A part of the Favicons
|
# A part of the Favicons
|
||||||
# Chirpy v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT License
|
|
||||||
---
|
---
|
||||||
|
|
||||||
{% assign icon_url = "/assets/img/favicons" | relative_url %}
|
{% assign icon_url = "/assets/img/favicons" | relative_url %}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
@@ -1,21 +0,0 @@
|
|||||||
/*!
|
|
||||||
Aggregation of common JS.
|
|
||||||
Chirpy@2.3
|
|
||||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
© 2020 Cotes Chung
|
|
||||||
MIT License
|
|
||||||
*/
|
|
||||||
|
|
||||||
{% include_relative _commons/back-to-top.js %}
|
|
||||||
|
|
||||||
{% include_relative _commons/search-display.js %}
|
|
||||||
|
|
||||||
{% include_relative _commons/sidebar.js %}
|
|
||||||
|
|
||||||
{% include_relative _commons/topbar-switch.js %}
|
|
||||||
|
|
||||||
{% include_relative _commons/topbar-title.js %}
|
|
||||||
|
|
||||||
{% include_relative _commons/copy-link.js %}
|
|
||||||
|
|
||||||
{% include_relative _utils/tooltip-loader.js %}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user