mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 06:06:54 +00:00
Compare commits
174 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeb2d57b60 | ||
|
|
2406ce1dc8 | ||
|
|
bec9246823 | ||
|
|
adaefc02e9 | ||
|
|
ee7266ff0d | ||
|
|
cad62feb91 | ||
|
|
b85cb39388 | ||
|
|
4360e2938c | ||
|
|
ecf31ff308 | ||
|
|
37344ef0df | ||
|
|
9e2a4fc8c9 | ||
|
|
fc71289dc8 | ||
|
|
c8fd0d728d | ||
|
|
ef2aa525d5 | ||
|
|
1fe0b2958b | ||
|
|
e466a643d5 | ||
|
|
f7ec9cd24a | ||
|
|
3342abc9e6 | ||
|
|
d47ec035d3 | ||
|
|
a403ffee42 | ||
|
|
d315bf57e7 | ||
|
|
75176522e3 | ||
|
|
ebb3dc940c | ||
|
|
c02c9c6a04 | ||
|
|
3a4316b29b | ||
|
|
f4b2dfe8b4 | ||
|
|
09e8eb4274 | ||
|
|
5ca0966c41 | ||
|
|
d919f833f1 | ||
|
|
df81012e28 | ||
|
|
09742d40dd | ||
|
|
259d0deabc | ||
|
|
cf6c8e9b3a | ||
|
|
c64e587335 | ||
|
|
415f11ecb8 | ||
|
|
5dc830d11e | ||
|
|
7579644e8d | ||
|
|
4cff83268b | ||
|
|
1487ae5284 | ||
|
|
697c584b48 | ||
|
|
089a19bc9e | ||
|
|
007d242e87 | ||
|
|
6447ffaf59 | ||
|
|
790cf30376 | ||
|
|
45adf4aac2 | ||
|
|
b1377ac694 | ||
|
|
cf8dae9454 | ||
|
|
9f5e579596 | ||
|
|
99e468cae5 | ||
|
|
4fde37e879 | ||
|
|
19debc4add | ||
|
|
afcf0bde22 | ||
|
|
36f55f091d | ||
|
|
e2003f2b03 | ||
|
|
563e8085e8 | ||
|
|
902546cf4d | ||
|
|
e06d237eae | ||
|
|
6220d09ffb | ||
|
|
3c91dc1f6f | ||
|
|
6a65f3a7f7 | ||
|
|
57feaa660e | ||
|
|
db9cfc270b | ||
|
|
3caacbee61 | ||
|
|
b518c9d3bc | ||
|
|
1c758cf4a2 | ||
|
|
df3a703988 | ||
|
|
12407bbfc0 | ||
|
|
55fce7574c | ||
|
|
833b6c9d5c | ||
|
|
a34b77969f | ||
|
|
707466b1df | ||
|
|
602e98448d | ||
|
|
0bf7a8f1d9 | ||
|
|
a7361717a6 | ||
|
|
e880448ba5 | ||
|
|
c28b6ce7d1 | ||
|
|
b7cc22983f | ||
|
|
a1551cd740 | ||
|
|
35c4d480ed | ||
|
|
b5c26fed08 | ||
|
|
2dc2175723 | ||
|
|
2f79b8d408 | ||
|
|
cbe6c3fb7b | ||
|
|
bb1188a01a | ||
|
|
406ed520cb | ||
|
|
1d7a134dd5 | ||
|
|
421db9dc92 | ||
|
|
a5b8e7862b | ||
|
|
30d3249782 | ||
|
|
fa15aebbca | ||
|
|
565ad9229c | ||
|
|
3d6304efd8 | ||
|
|
80fd684577 | ||
|
|
80980465d7 | ||
|
|
2858a082a3 | ||
|
|
9b0b7d7772 | ||
|
|
952b1f493b | ||
|
|
a887f1d57d | ||
|
|
945e8d1953 | ||
|
|
a400dc9501 | ||
|
|
6a4169fc03 | ||
|
|
95b4b453e6 | ||
|
|
de14c00570 | ||
|
|
f4d4065b1c | ||
|
|
52f854a2da | ||
|
|
38f20e8119 | ||
|
|
1728d697e6 | ||
|
|
d9863d6a02 | ||
|
|
b460d03c3b | ||
|
|
a053c454e4 | ||
|
|
77c2009658 | ||
|
|
9844b964a8 | ||
|
|
063b2a6651 | ||
|
|
e5df04dd59 | ||
|
|
9e9278ce30 | ||
|
|
30dfc6fb7e | ||
|
|
1ce350e33e | ||
|
|
50c88f7205 | ||
|
|
387fc67102 | ||
|
|
414715fc47 | ||
|
|
1bb54096f4 | ||
|
|
abb548fcee | ||
|
|
ed93fbdfde | ||
|
|
4ad0a76789 | ||
|
|
89b76dc2a0 | ||
|
|
395b24736a | ||
|
|
fa0155de6f | ||
|
|
0bffb276fe | ||
|
|
2417db656c | ||
|
|
e5bf234835 | ||
|
|
2dfdb66e0a | ||
|
|
da9881a47f | ||
|
|
c68a937e01 | ||
|
|
4001ef7cba | ||
|
|
1b16b152df | ||
|
|
e607e5fe86 | ||
|
|
d761d340a8 | ||
|
|
f411ba33d8 | ||
|
|
f722757f6f | ||
|
|
beabb36d7f | ||
|
|
42ff0f2282 | ||
|
|
34631a0c30 | ||
|
|
53b0329e5a | ||
|
|
2877896b9e | ||
|
|
7ef88c8b8f | ||
|
|
2acf14ecf0 | ||
|
|
603705f20e | ||
|
|
0267ad8d40 | ||
|
|
c0b8c089c2 | ||
|
|
a603aac8e8 | ||
|
|
91ed3d4649 | ||
|
|
20454e5a57 | ||
|
|
aadda0347c | ||
|
|
5e9a7b319e | ||
|
|
2537283beb | ||
|
|
7dc7a7efc8 | ||
|
|
39b09b97c0 | ||
|
|
8d164c2e6e | ||
|
|
1a94b1889f | ||
|
|
6d07d4738b | ||
|
|
6e0afcf9e8 | ||
|
|
952927762a | ||
|
|
3c3598e8b1 | ||
|
|
9d9bca5e3b | ||
|
|
03248f5bff | ||
|
|
e2c288a925 | ||
|
|
b80d95dcdd | ||
|
|
72ba1f7849 | ||
|
|
46d80cbf9a | ||
|
|
0213331a16 | ||
|
|
780af9ac5f | ||
|
|
b513c0764d | ||
|
|
57e8c6e594 | ||
|
|
49dc866bd8 |
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
# How to Contribute
|
# How to Contribute
|
||||||
|
|
||||||
I want to thank you for sparing a time to improve this project! Here are some guidelines for contributing:
|
I want to thank you for sparing time to improve this project! Here are some guidelines for contributing:
|
||||||
|
|
||||||
To ensure that the blog design is not confused, this project does not accept suggestions for design changes, such as color scheme, fonts, typography, etc. If your request is about an enhancement, it is recommended to first submit a [`Feature Request`](https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?labels=enhancement&template=feature_request.md) issue to discuss whether your idea fits the project.
|
To ensure that the blog design is not confused, this project does not accept suggestions for design changes, such as color scheme, fonts, typography, etc. If your request is about an enhancement, it is recommended to first submit a [`Feature Request`](https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?labels=enhancement&template=feature_request.md) issue to discuss whether your idea fits the project.
|
||||||
|
|
||||||
@@ -13,4 +13,4 @@ Generally, contribute to the project by:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
:tada: Your volunteering will make the open source world more beautiful, thanks again! :tada:
|
:tada: Your volunteering will make the open-source world more beautiful, thanks again! :tada:
|
||||||
|
|||||||
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
@@ -1,3 +1,2 @@
|
|||||||
custom:
|
ko_fi: coteschung
|
||||||
- https://www.buymeacoffee.com/coteschung
|
custom: https://cotes.gitee.io/alipay-wechat-donation
|
||||||
- https://cotes.gitee.io/alipay-wechat-donation
|
|
||||||
|
|||||||
18
.github/ISSUE_TEMPLATE/bug_report.md
vendored
18
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -6,12 +6,15 @@ about: Create a report to help us improve
|
|||||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
<!-- 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]" -->
|
|
||||||
- [ ] I have read the [tutorials](https://chirpy.cotes.info/categories/tutorial/) and know the correct effect of the functional design.
|
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
||||||
- [ ] There are no similar reports on existing issues (including closed ones).
|
|
||||||
- [ ] I found the bug on the latest code of `master` branch.
|
- [ ] I have read the [tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
|
||||||
|
- [ ] There are no similar reports on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
|
||||||
|
- [ ] I found the bug on the latest code of the `master` branch.
|
||||||
|
|
||||||
## Describe the bug
|
## Describe the bug
|
||||||
|
|
||||||
<!-- A clear and concise description of what the bug is. -->
|
<!-- A clear and concise description of what the bug is. -->
|
||||||
|
|
||||||
### To Reproduce
|
### To Reproduce
|
||||||
@@ -25,25 +28,31 @@ Steps to reproduce the behavior:
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
### 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. -->
|
||||||
|
|
||||||
### Screenshots
|
### Screenshots
|
||||||
|
|
||||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||||
|
|
||||||
### 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 "` -->
|
||||||
|
- Theme version: <!-- by running: `gem list | grep jekyll-theme-chirpy` -->
|
||||||
|
|
||||||
### Desktop
|
### Desktop
|
||||||
|
|
||||||
<!-- If necessary, uncomment and fill in the following list:
|
<!-- 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 (64-bit)]
|
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Smartphone
|
### Smartphone
|
||||||
|
|
||||||
<!-- If necessary, uncomment and fill in the following list:
|
<!-- 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]
|
||||||
@@ -51,4 +60,5 @@ Steps to reproduce the behavior:
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
### Additional context
|
### Additional context
|
||||||
|
|
||||||
<!-- Add any other context about the problem here. -->
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|||||||
9
.github/ISSUE_TEMPLATE/feature_request.md
vendored
9
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -7,24 +7,29 @@ labels: enhancement
|
|||||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
<!-- 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 changing the "[ ]" to "[x]" -->
|
||||||
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
|
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
|
||||||
- [ ] There are no similar request on existing issues (including closed ones).
|
- [ ] There is no similar request on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
|
||||||
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
|
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
|
||||||
- [ ] I was in the `master` branch of the latest code.
|
- [ ] I was in the `master` branch of the latest code.
|
||||||
|
|
||||||
|
|
||||||
## Is your feature request related to a problem? Please describe
|
## Is your feature request related to a problem? Please describe
|
||||||
|
|
||||||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||||
|
|
||||||
|
|
||||||
## Describe the solution you'd like
|
## Describe the solution you'd like
|
||||||
|
|
||||||
<!-- A clear and concise description of what you want to happen. -->
|
<!-- A clear and concise description of what you want to happen. -->
|
||||||
|
|
||||||
|
|
||||||
## Describe alternatives you've considered
|
## Describe alternatives you've considered
|
||||||
|
|
||||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||||
|
|
||||||
|
|
||||||
## Additional context
|
## Additional context
|
||||||
|
|
||||||
<!-- Add any other context or screenshots about the feature request here. -->
|
<!-- Add any other context or screenshots about the feature request here. -->
|
||||||
|
|||||||
13
.github/ISSUE_TEMPLATE/question.md
vendored
13
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Question
|
name: Question
|
||||||
about: Ask what ever you want
|
about: Ask whatever you want
|
||||||
labels: question
|
labels: question
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -8,12 +8,13 @@ labels: question
|
|||||||
|
|
||||||
## 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 changing the "[ ]" to "[x]" -->
|
||||||
|
|
||||||
- [ ] I have read the [tutorials](https://chirpy.cotes.info/categories/tutorial/) and know the correct effect of the functional design.
|
- [ ] I have read the [newlest tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
|
||||||
- [ ] There are no similar question on existing issues (including closed ones).
|
- [ ] There is no similar question on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
|
||||||
- [ ] I searched the Internet for related problems, but still couldn't solve it.
|
- [ ] I have tried to find the answer on [Jekyll Forum](https://talk.jekyllrb.com/) and [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll).
|
||||||
- [ ] My question is based on the latest code of `master` branch.
|
- [ ] My question is based on the latest code of the `master` branch.
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
<!-- Please describe your question in detail. -->
|
<!-- Please describe your question in detail. -->
|
||||||
|
|||||||
18
.github/PULL_REQUEST_TEMPLATE.md
vendored
18
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
||||||
-->
|
|
||||||
|
|
||||||
e.g. Fixes #(issue)
|
e.g. Fixes #(issue)
|
||||||
|
-->
|
||||||
|
|
||||||
## Type of change
|
## Type of change
|
||||||
|
|
||||||
@@ -22,23 +22,21 @@ 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/test.sh --build` (at the root of the project) locally and passed
|
- [ ] I have run `bash ./tools/deploy.sh --dry-run` (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
|
||||||
|
|
||||||
- Browser type & version:
|
- Browser type & version:
|
||||||
- Operating system:
|
- Operating system:
|
||||||
- Bundler version:
|
- Ruby version: <!-- by running: `ruby -v` -->
|
||||||
- Ruby version:
|
- Bundler version: <!-- by running: `bundle -v`-->
|
||||||
- Jekyll version:
|
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
|
||||||
|
|
||||||
### Checklist
|
### Checklist
|
||||||
|
|
||||||
<!-- Select checkboxes by change the "[ ]" to "[x]" -->
|
<!-- Select checkboxes by change the "[ ]" to "[x]" -->
|
||||||
- [ ] My code follows the [Google style guidelines](https://google.github.io/styleguide/)
|
- [ ] I have performed a self-review of my code
|
||||||
- [ ] I have performed a self-review of my own code
|
- [ ] I have commented on my code, particularly in hard-to-understand areas
|
||||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
||||||
- [ ] 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
|
|
||||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
|
||||||
|
|||||||
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@@ -36,12 +36,5 @@ jobs:
|
|||||||
ruby-version: 2.7
|
ruby-version: 2.7
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
|
||||||
- name: Build Site
|
|
||||||
env:
|
|
||||||
JEKYLL_ENV: production
|
|
||||||
run: |
|
|
||||||
bundle exec jekyll b
|
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: |
|
run: bash tools/deploy.sh --dry-run
|
||||||
bash tools/test.sh
|
|
||||||
|
|||||||
26
.github/workflows/pages-deploy.yml.hook
vendored
26
.github/workflows/pages-deploy.yml.hook
vendored
@@ -25,29 +25,5 @@ jobs:
|
|||||||
ruby-version: 2.7
|
ruby-version: 2.7
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
|
||||||
- name: Check baseurl
|
|
||||||
run: |
|
|
||||||
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
|
||||||
if [[ -n $baseurl ]]; then
|
|
||||||
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build Site
|
|
||||||
env:
|
|
||||||
JEKYLL_ENV: production
|
|
||||||
run: |
|
|
||||||
bundle exec jekyll b -d "_site$BASE_URL"
|
|
||||||
|
|
||||||
- name: Test Site
|
|
||||||
run: |
|
|
||||||
bash tools/test.sh
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: bash tools/deploy.sh
|
||||||
if [[ -n $BASE_URL ]]; then
|
|
||||||
mv _site$BASE_URL _site-rename
|
|
||||||
rm -rf _site
|
|
||||||
mv _site-rename _site
|
|
||||||
fi
|
|
||||||
|
|
||||||
bash tools/deploy.sh
|
|
||||||
|
|||||||
19
.travis.yml
19
.travis.yml
@@ -3,48 +3,41 @@ dist: bionic
|
|||||||
|
|
||||||
language: minimal
|
language: minimal
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- /^release\/(\d)+(\.(\d)+){1}$/
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
- name: Deploy
|
||||||
- name: CD
|
|
||||||
language: ruby
|
language: ruby
|
||||||
rvm: 2.7.0
|
rvm: 2.7.0
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
# required to avoid SSL error (for htmlproofer)
|
# required to avoid SSL error (for htmlproofer)
|
||||||
- libcurl4-openssl-dev
|
- libcurl4-openssl-dev
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $TRAVIS_BUILD_DIR/vendor/bundle
|
- $TRAVIS_BUILD_DIR/vendor/bundle
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# match the Gemfile.lock, travis' bundler is 2.1.2
|
# match the Gemfile.lock, travis' bundler is 2.1.2
|
||||||
- gem install bundler:2.2.4
|
- gem install bundler:2.2.4
|
||||||
- bundle config path 'vendor/bundle'
|
- bundle config path 'vendor/bundle'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# overriding to drop the travis `--development` flag
|
# overriding to drop the travis `--development` flag
|
||||||
- bundle install --jobs=3 --retry=3
|
- bundle install --jobs=3 --retry=3
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- eval "$BUILD_CMD"
|
- eval "$BUILD_CMD"
|
||||||
|
|
||||||
git:
|
git:
|
||||||
depth: false # for posts' lastmod
|
depth: false # for posts' lastmod
|
||||||
|
|
||||||
- name: Flush Starter
|
- name: Flush Starter
|
||||||
script:
|
script: eval "$FLUSH_STARTER"
|
||||||
- eval "$FLUSH_STARTER"
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
|
- git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
|
||||||
|
|
||||||
branches:
|
|
||||||
only: /.*-stable$/
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
recipients:
|
recipients:
|
||||||
|
|||||||
3
Gemfile
3
Gemfile
@@ -17,3 +17,6 @@ end
|
|||||||
|
|
||||||
# Performance-booster for watching directories on Windows
|
# Performance-booster for watching directories on Windows
|
||||||
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
|
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
|
||||||
|
|
||||||
|
# Jekyll <= 4.2.0 compatibility with Ruby 3.0
|
||||||
|
gem "webrick", "~> 1.7"
|
||||||
|
|||||||
197
README.md
197
README.md
@@ -1,39 +1,27 @@
|
|||||||
<div align="right">
|
<div align="right">
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy#readme">EN</a> |
|
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md">中文 (简体)</a>
|
EN / [中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>Chirpy Jekyll Theme</h1>
|
|
||||||
<p>
|
# Chirpy Jekyll Theme
|
||||||
<a href="https://rubygems.org/gems/jekyll-theme-chirpy">
|
|
||||||
<img alt="Gem Version" src="https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen"></img>
|
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
|
||||||
</a>
|
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush">
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||||
<img alt="Build Status" src="https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?branch=master&event=push"></img>
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
</a>
|
[](https://www.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade)
|
||||||
<a href="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)
|
||||||
<img alt="Codacy Badge" src="https://api.codacy.com/project/badge/Grade/8220b926db514f13afc3f02b7f884f4b"></img>
|
[](https://996.icu)
|
||||||
</a>
|
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE">
|
[**Live Demo →**](https://cotes2020.github.io/chirpy-demo)
|
||||||
<img alt="GitHub license" src="https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg"></img>
|
|
||||||
</a>
|
[](https://cotes2020.github.io/chirpy-demo)
|
||||||
<a href="https://996.icu">
|
|
||||||
<img alt="996.icu" src="https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg"></img>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation. Designed to help you easily record and share your knowledge.
|
|
||||||
|
|
||||||
[Live Demo »](https://chirpy.cotes.info)
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://chirpy.cotes.info">
|
|
||||||
<img alt="Devices Mockup" src="https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png"></img>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Localized Layout
|
- Localized Layout
|
||||||
@@ -55,58 +43,24 @@ A minimal, sidebar, responsive web design Jekyll theme that focuses on text pres
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`. Please note that the version of `Ruby` must meet the requirements of the theme on [RubyGems.org](https://rubygems.org/gems/jekyll-theme-chirpy).
|
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
There are two ways to get the theme:
|
### Creating a New Site
|
||||||
|
|
||||||
- **[Install from RubyGems](#install-from-rubygems)** - Easy to update, isolate irrelevant project files so you can focus on writing.
|
There are two ways to create a new repository for this theme:
|
||||||
- **[Fork on GitHub](#fork-on-github)** - Convenient for custom development, but difficult to update, only suitable for web developers.
|
|
||||||
|
|
||||||
### Install from RubyGems
|
- [**Using the Chirpy Starter**](#option-1-using-the-chirpy-starter) - Easy to upgrade, isolates irrelevant project files so you can focus on writing.
|
||||||
|
- [**Forking on GitHub**](#option-2-forking-on-github) - Convenient for custom development, but difficult to upgrade. Unless you are familiar with Jekyll and are determined to tweak or contribute to this project, this approach is not recommended.
|
||||||
|
|
||||||
Add this line to your Jekyll site's `Gemfile`:
|
#### Option 1. Using the Chirpy Starter
|
||||||
|
|
||||||
```ruby
|
Create a new repository from the [**Chirpy Starter**][use-starter] and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
|
||||||
gem "jekyll-theme-chirpy"
|
|
||||||
```
|
|
||||||
|
|
||||||
And add this line to your Jekyll site's `_config.yml`:
|
#### Option 2. Forking on GitHub
|
||||||
|
|
||||||
```yaml
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and rename it to `<GH_USERNAME>.github.io`. Please note that the default branch code is in development. If you want the site to be stable, please switch to the [latest tag][latest-tag] and start writing.
|
||||||
theme: jekyll-theme-chirpy
|
|
||||||
```
|
|
||||||
|
|
||||||
And then execute:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bundle
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, go to the installed local theme path:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ cd "$(bundle info --path jekyll-theme-chirpy)"
|
|
||||||
```
|
|
||||||
|
|
||||||
And then copy the critical files (for details, see [starter project][starter]) from the theme's gem to your Jekyll site.
|
|
||||||
|
|
||||||
> ⚠️ **Watch out for duplicate files!**
|
|
||||||
>
|
|
||||||
> If your Jekyll site is created by the `jekyll new` command, there will be `index.markdown` and `about.markdown` in the root directory of your site. Please be sure to remove them, otherwise they will overwrite the `index.html` and `_tabs/about.html` from this project, resulting in blank or messy pages.
|
|
||||||
|
|
||||||
As an alternative, which we recommend, you can create a Jekyll site [**using the starter template**][use-starter] to save time copying files from the theme's gem. We've prepared everything you need there!
|
|
||||||
|
|
||||||
### 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:
|
And then execute:
|
||||||
|
|
||||||
@@ -114,18 +68,29 @@ And then execute:
|
|||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> **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.
|
> **Note**: If you don't want to deploy your site on GitHub Pages, append option `--no-gh` at the end of the above command.
|
||||||
|
|
||||||
What it does is:
|
The above command will:
|
||||||
|
|
||||||
|
1. Removes 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 the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise, set up the GitHub Action workflow by removing the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Removes item `Gemfile.lock` from `.gitignore`.
|
||||||
|
|
||||||
|
4. Creates a new commit to save the changes automatically.
|
||||||
|
|
||||||
|
### Installing Dependencies
|
||||||
|
|
||||||
|
Before running for the first time, go to the root directory of your site, and install dependencies as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -140,9 +105,9 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
|
|||||||
|
|
||||||
### Customing Stylesheet
|
### Customing Stylesheet
|
||||||
|
|
||||||
If you need to customize stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
||||||
|
|
||||||
Starting from `v4.1.0`, if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
Starting from [`v4.1.0`][chirpy-4.1.0], if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
||||||
|
|
||||||
### Running Local Server
|
### Running Local Server
|
||||||
|
|
||||||
@@ -154,55 +119,62 @@ $ bundle exec jekyll s
|
|||||||
|
|
||||||
Or run the site on Docker with the following command:
|
Or run the site on Docker with the following command:
|
||||||
|
|
||||||
```terminal
|
```console
|
||||||
$ docker run -it --rm \
|
$ docker run -it --rm \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
-p 4000:4000 jekyll/jekyll \
|
-p 4000:4000 jekyll/jekyll \
|
||||||
jekyll serve
|
jekyll serve
|
||||||
```
|
```
|
||||||
|
|
||||||
Open a browser and visit to _<http://localhost:4000>_.
|
After a while, the local service will be published at _<http://127.0.0.1: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, e.g, `/project-name`.
|
Before the deployment begins, check out 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 starts with a slash, e.g, `/project-name`.
|
||||||
|
|
||||||
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||||
|
|
||||||
#### Deploy on GitHub Pages
|
#### Deploy by Using Github Actions
|
||||||
|
|
||||||
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.
|
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 GitHub Pages service.
|
||||||
|
|
||||||
Quickly check the files needed for GitHub Actions build:
|
Quickly check the files needed for GitHub Actions build:
|
||||||
|
|
||||||
- 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 the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [sample 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 repository to `<GH-USERNAME>.github.io` on GitHub.
|
- Ensure your Jekyll site has file `tools/deploy.sh`. Otherwise, copy it from here to your Jekyll site.
|
||||||
|
|
||||||
|
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lock file:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle lock --add-platform x86_64-linux
|
||||||
|
```
|
||||||
|
|
||||||
|
After the above steps, rename your repository to `<GH_USERNAME>.github.io` on GitHub.
|
||||||
|
|
||||||
Now publish your Jekyll site by:
|
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.
|
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) through _Settings_ → _Options_ → _GitHub Pages_:
|
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
#### Deploy on Other Platforms
|
#### Manually Build and Deploy
|
||||||
|
|
||||||
On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Actions**. Therefore, we should build the site locally (or on some other 3rd-party CI platform) and then put the site files on the server.
|
On self-hosted servers, you cannot enjoy the convenience of **GitHub Actions**. Therefore, you should build the site on your local machine and then upload the site files to the server.
|
||||||
|
|
||||||
Go to the root of the source project, build your site by:
|
Go to the root of the source project, and build your site as follows:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ JEKYLL_ENV=production bundle exec jekyll b
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
Or build the site with Docker by:
|
Or build the site on Docker:
|
||||||
|
|
||||||
```terminal
|
```console
|
||||||
$ docker run -it --rm \
|
$ docker run -it --rm \
|
||||||
--env JEKYLL_ENV=production \
|
--env JEKYLL_ENV=production \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
@@ -210,11 +182,33 @@ $ docker run -it --rm \
|
|||||||
jekyll build
|
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 the target server.
|
||||||
|
|
||||||
|
### Upgrading
|
||||||
|
|
||||||
|
It depends on how you use the theme:
|
||||||
|
|
||||||
|
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the theme gem, for example:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
|
||||||
|
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
And then execute the following command:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle update jekyll-theme-chirpy
|
||||||
|
```
|
||||||
|
|
||||||
|
As the version upgrades, the critical files (for details, see the [Startup Template][starter]) and configuration options will change. Please refer to the [Upgrade Guide](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide) to keep your repo's files in sync with the latest version of the theme.
|
||||||
|
|
||||||
|
- If you forked from the source project (there will be `gemspec` in the `Gemfile` of your site), then merge the [latest upstream tags][latest-tag] into your Jekyll site to complete the upgrade.
|
||||||
|
The merge is likely to conflict with your local modifications. Please be patient and careful to resolve these conflicts.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
For more details and a better reading experience, please check out the [tutorials on the 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). Please note that the tutorials on the demo website or Wiki are based on the latest release, and the features of `master` branch usually ahead of the documentation.
|
For more details and a better reading experience, please check out the [tutorials on the demo site](https://cotes2020.github.io/chirpy-demo/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Please note that the tutorials on the demo website or Wiki are based on the latest release, and the features of `master` branch are usually ahead of the documentation.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -222,9 +216,9 @@ The old saying, "Two heads are better than one." Consequently, welcome to report
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools (their copyright information can be found in the relevant files). The avatar and favicon design comes from [Clipart Max](https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/).
|
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools (their copyright information can be found in the relevant files). The avatar and favicon design come from [Clipart Max](https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/).
|
||||||
|
|
||||||
: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.
|
||||||
|
|
||||||
Last but not least, thank [JetBrains][jb] for providing the open source license.
|
Last but not least, thank [JetBrains][jb] for providing the open source license.
|
||||||
|
|
||||||
@@ -232,7 +226,7 @@ Last but not least, thank [JetBrains][jb] for providing the open source license.
|
|||||||
|
|
||||||
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!
|
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)
|
[](https://ko-fi.com/coteschung)
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
|
|
||||||
@@ -243,6 +237,9 @@ This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chi
|
|||||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
[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
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
|
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
||||||
|
[pages-src]: https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
|
||||||
|
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
||||||
|
|
||||||
<!-- ReadMe links -->
|
<!-- ReadMe links -->
|
||||||
|
|
||||||
|
|||||||
29
_config.yml
29
_config.yml
@@ -3,12 +3,13 @@
|
|||||||
# Import the theme
|
# Import the theme
|
||||||
theme: jekyll-theme-chirpy
|
theme: jekyll-theme-chirpy
|
||||||
|
|
||||||
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
|
# Change the following value to '/PROJECT_NAME' ONLY IF your site type is GitHub Pages Project sites
|
||||||
# change below value to '/projectname'.
|
# and doesn't have a custom domain.
|
||||||
baseurl: ''
|
baseurl: ''
|
||||||
|
|
||||||
# The language of the site layout › http://www.lingoes.net/en/translator/langcode.htm
|
# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm
|
||||||
# Go to folder '_data/locales' to check the available language options
|
# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed,
|
||||||
|
# otherwise, the layout language will use the default value of 'en'.
|
||||||
lang: en
|
lang: en
|
||||||
|
|
||||||
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
||||||
@@ -78,17 +79,23 @@ theme_mode: # [light|dark]
|
|||||||
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
||||||
#
|
#
|
||||||
# e.g. 'https://cdn.com'
|
# e.g. 'https://cdn.com'
|
||||||
img_cdn: ''
|
img_cdn: 'https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@f4e0354b674f65a53b8917f0f786ed2956898cc1'
|
||||||
|
|
||||||
# the avatar on sidebar, support local or CORS resources
|
# the avatar on sidebar, support local or CORS resources
|
||||||
avatar: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/avatar.jpg
|
avatar: '/commons/avatar.jpg'
|
||||||
|
|
||||||
# boolean type, the global switch for ToC in posts.
|
# boolean type, the global switch for ToC in posts.
|
||||||
toc: true
|
toc: true
|
||||||
|
|
||||||
disqus:
|
comments:
|
||||||
comments: false # boolean type, the global switch for posts comments.
|
active: # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable
|
||||||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
# The active options are as follows:
|
||||||
|
disqus:
|
||||||
|
shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||||
|
# utterances settings › https://utteranc.es/
|
||||||
|
utterances:
|
||||||
|
repo: # <gh-username>/<repo>
|
||||||
|
issue_term: # < url | pathname | title | ...>
|
||||||
|
|
||||||
paginate: 10
|
paginate: 10
|
||||||
|
|
||||||
@@ -110,7 +117,6 @@ collections:
|
|||||||
output: true
|
output: true
|
||||||
sort_by: order
|
sort_by: order
|
||||||
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
@@ -135,7 +141,6 @@ defaults:
|
|||||||
values:
|
values:
|
||||||
layout: page
|
layout: page
|
||||||
permalink: /:title/
|
permalink: /:title/
|
||||||
dynamic_title: true # Hide title in mobile screens.
|
|
||||||
|
|
||||||
sass:
|
sass:
|
||||||
style: compressed
|
style: compressed
|
||||||
@@ -158,7 +163,7 @@ exclude:
|
|||||||
- LICENSE
|
- LICENSE
|
||||||
- gulpfile.js
|
- gulpfile.js
|
||||||
- node_modules
|
- node_modules
|
||||||
- '*.json'
|
- package*.json
|
||||||
|
|
||||||
jekyll-archives:
|
jekyll-archives:
|
||||||
enabled: [categories, tags]
|
enabled: [categories, tags]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
-
|
-
|
||||||
type: github
|
type: github
|
||||||
icon: 'fab fa-github-alt'
|
icon: 'fab fa-github'
|
||||||
-
|
-
|
||||||
type: twitter
|
type: twitter
|
||||||
icon: 'fab fa-twitter'
|
icon: 'fab fa-twitter'
|
||||||
|
|||||||
@@ -16,10 +16,11 @@ tabs:
|
|||||||
archives: Archives
|
archives: Archives
|
||||||
about: About
|
about: About
|
||||||
|
|
||||||
# text displayed in the search bar
|
# the text displayed in the search bar & search results
|
||||||
search:
|
search:
|
||||||
hint: search
|
hint: search
|
||||||
cancel: Cancel
|
cancel: Cancel
|
||||||
|
no_results: Oops! No result founds.
|
||||||
|
|
||||||
panel:
|
panel:
|
||||||
lastmod: Recent Update
|
lastmod: Recent Update
|
||||||
@@ -58,7 +59,8 @@ not_found:
|
|||||||
# ----- Posts related labels -----
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
post:
|
post:
|
||||||
published: 'on'
|
written_by: By
|
||||||
|
posted: Posted
|
||||||
updated: Updated
|
updated: Updated
|
||||||
timeago:
|
timeago:
|
||||||
day: days ago
|
day: days ago
|
||||||
@@ -75,7 +77,9 @@ post:
|
|||||||
button:
|
button:
|
||||||
next: Newer
|
next: Newer
|
||||||
previous: Older
|
previous: Older
|
||||||
copy:
|
copy_code:
|
||||||
|
succeed: Copied!
|
||||||
|
share_link:
|
||||||
title: Copy link
|
title: Copy link
|
||||||
succeed: Link copied successfully!
|
succeed: Link copied successfully!
|
||||||
# pinned prompt of posts list on homepage
|
# pinned prompt of posts list on homepage
|
||||||
|
|||||||
91
_data/locales/id-ID.yml
Normal file
91
_data/locales/id-ID.yml
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: Postingan
|
||||||
|
category: Kategori
|
||||||
|
tag: Tagar
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: Beranda
|
||||||
|
categories: Kategori
|
||||||
|
tags: Tagar
|
||||||
|
archives: Arsip
|
||||||
|
about: Tentang
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: Cari
|
||||||
|
cancel: Batal
|
||||||
|
no_results: Ups! Tidak ada hasil yang ditemukan.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: Postingan Terbaru
|
||||||
|
trending_tags: Tagar Terpopuler
|
||||||
|
toc: Konten
|
||||||
|
|
||||||
|
# The liquid date format › http://strftime.net/
|
||||||
|
date_format:
|
||||||
|
tooltip: "%a, %e %b, %Y, %l:%M %p"
|
||||||
|
post:
|
||||||
|
long: "%e %b, %Y"
|
||||||
|
short: "%e %b"
|
||||||
|
archive_month: "%b"
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: Postingan ini dilisensikan di bawah :LICENSE_NAME oleh penulis.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: Sebagian konten dilindungi.
|
||||||
|
verbose: >-
|
||||||
|
Kecuali jika dinyatakan, Postingan blog di situs ini dilisensikan
|
||||||
|
di bawah Lisensi Creative Commons Attribution 4.0 International (CC BY 4.0) oleh penulis.
|
||||||
|
|
||||||
|
meta: Didukung oleh :PLATFORM dengan tema :THEME.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: Maaf, kami gagal menemukan URL itu atau memang mengarah ke sesuatu yang tidak ada.
|
||||||
|
hint_template: :HEAD_BAK untuk mencoba mencari kembali, atau cari di :ARCHIVES_PAGE.
|
||||||
|
head_back: Kembali ke Beranda
|
||||||
|
archives_page: Halaman Arsip
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: Oleh
|
||||||
|
posted: Diterbitkan
|
||||||
|
updated: Diperbarui
|
||||||
|
timeago:
|
||||||
|
day: hari yang lalu
|
||||||
|
hour: jam yang lalu
|
||||||
|
minute: menit yang lalu
|
||||||
|
just_now: baru saja
|
||||||
|
words: kata
|
||||||
|
pageview_measure: dilihat
|
||||||
|
read_time:
|
||||||
|
unit: menit
|
||||||
|
prompt: baca
|
||||||
|
relate_posts: Postingan Lainya
|
||||||
|
share: Bagikan
|
||||||
|
button:
|
||||||
|
next: Terbaru
|
||||||
|
previous: Terlama
|
||||||
|
copy_code:
|
||||||
|
succeed: Disalin!
|
||||||
|
share_link:
|
||||||
|
title: Salin tautan
|
||||||
|
succeed: Tautan berhasil disalin!
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: Disematkan
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure: kategori
|
||||||
|
post_measure: Postingan
|
||||||
91
_data/locales/ko-KR.yml
Normal file
91
_data/locales/ko-KR.yml
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: 포스트
|
||||||
|
category: 카테고리
|
||||||
|
tag: 태그
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: 홈
|
||||||
|
categories: 카테고리
|
||||||
|
tags: 태그
|
||||||
|
archives: 아카이브
|
||||||
|
about: 정보
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: 검색
|
||||||
|
cancel: 취소
|
||||||
|
no_results: 검색 결과가 없습니다.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: 최근 업데이트
|
||||||
|
trending_tags: 인기 태그
|
||||||
|
toc: 바로가기
|
||||||
|
|
||||||
|
# The liquid date format › http://strftime.net/
|
||||||
|
date_format:
|
||||||
|
tooltip: '%F, %R %z'
|
||||||
|
post:
|
||||||
|
long: '%Y년 %m월 %d일'
|
||||||
|
short: '%m월 %d일'
|
||||||
|
archive_month: '%b월'
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: 이 기사는 저작권자의 :LICENSE_NAME 라이센스를 따릅니다.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: 일부 권리 보유
|
||||||
|
verbose: >-
|
||||||
|
명시되지 않는 한 이 사이트의 블로그 게시물은 작성자의
|
||||||
|
Creative Commons Attribution 4.0 International(CC BY 4.0) 라이선스에 따라 사용이 허가되었습니다.
|
||||||
|
|
||||||
|
meta: Powered by :PLATFORM with :THEME theme.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: 해당 URL은 존재하지 않습니다.
|
||||||
|
hint_template: :HEAD_BAK을 눌러 다시 찾거나 :ARCHIVES_PAGE에서 검색해 주세요.
|
||||||
|
head_back: 홈으로 돌아가기
|
||||||
|
archives_page: 아카이브 페이지
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: By
|
||||||
|
posted: 게시
|
||||||
|
updated: 업데이트
|
||||||
|
timeago:
|
||||||
|
day: 일 전
|
||||||
|
hour: 시간 전
|
||||||
|
minute: 분 전
|
||||||
|
just_now: 방금
|
||||||
|
words: 단어
|
||||||
|
pageview_measure: 조회
|
||||||
|
read_time:
|
||||||
|
unit: 분
|
||||||
|
prompt: 읽는 시간
|
||||||
|
relate_posts: 관련된 글
|
||||||
|
share: 공유하기
|
||||||
|
button:
|
||||||
|
next: 다음 글
|
||||||
|
previous: 이전 글
|
||||||
|
copy_code:
|
||||||
|
succeed: 복사되었습니다!
|
||||||
|
share_link:
|
||||||
|
title: 링크 복사하기
|
||||||
|
succeed: 링크가 복사되었습니다!
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: 핀
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure: 카테고리
|
||||||
|
post_measure: 포스트
|
||||||
@@ -16,10 +16,11 @@ tabs:
|
|||||||
archives: 归档
|
archives: 归档
|
||||||
about: 关于
|
about: 关于
|
||||||
|
|
||||||
# text displayed in the search bar
|
# the text displayed in the search bar & search results
|
||||||
search:
|
search:
|
||||||
hint: 搜索
|
hint: 搜索
|
||||||
cancel: 取消
|
cancel: 取消
|
||||||
|
no_results: 搜索结果为空
|
||||||
|
|
||||||
panel:
|
panel:
|
||||||
lastmod: 最近更新
|
lastmod: 最近更新
|
||||||
@@ -57,7 +58,8 @@ not_found:
|
|||||||
# ----- Posts related labels -----
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
post:
|
post:
|
||||||
published: 发表于
|
written_by: 作者
|
||||||
|
posted: 发表于
|
||||||
updated: 更新于
|
updated: 更新于
|
||||||
timeago:
|
timeago:
|
||||||
day: 天前
|
day: 天前
|
||||||
@@ -74,7 +76,9 @@ post:
|
|||||||
button:
|
button:
|
||||||
next: 下一篇
|
next: 下一篇
|
||||||
previous: 上一篇
|
previous: 上一篇
|
||||||
copy:
|
copy_code:
|
||||||
|
succeed: 已复制!
|
||||||
|
share_link:
|
||||||
title: 分享链接
|
title: 分享链接
|
||||||
succeed: 链接已复制!
|
succeed: 链接已复制!
|
||||||
# pinned prompt of posts list on homepage
|
# pinned prompt of posts list on homepage
|
||||||
|
|||||||
5
_includes/comments.html
Normal file
5
_includes/comments.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<!-- The comments switcher -->
|
||||||
|
{% if page.comments and site.comments.active %}
|
||||||
|
{% capture path %}comments/{{ site.comments.active }}.html{% endcapture %}
|
||||||
|
{% include {{ path }} %}
|
||||||
|
{% endif %}
|
||||||
54
_includes/comments/disqus.html
Normal file
54
_includes/comments/disqus.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<!--
|
||||||
|
The Disqus lazy loading.
|
||||||
|
-->
|
||||||
|
<div id="disqus_thread" class="pt-2 pb-2">
|
||||||
|
<p class="text-center text-muted small">
|
||||||
|
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var disqus_config = function () {
|
||||||
|
this.page.url = '{{ page.url | absolute_url }}';
|
||||||
|
this.page.identifier = '{{ page.url }}';
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Lazy loading */
|
||||||
|
|
||||||
|
var disqus_observer = new IntersectionObserver(function (entries) {
|
||||||
|
if(entries[0].isIntersecting) {
|
||||||
|
(function () {
|
||||||
|
var d = document, s = d.createElement('script');
|
||||||
|
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
|
||||||
|
s.setAttribute('data-timestamp', +new Date());
|
||||||
|
(d.head || d.body).appendChild(s);
|
||||||
|
})();
|
||||||
|
|
||||||
|
disqus_observer.disconnect();
|
||||||
|
}
|
||||||
|
}, { threshold: [0] });
|
||||||
|
|
||||||
|
disqus_observer.observe(document.querySelector('#disqus_thread'));
|
||||||
|
|
||||||
|
/* Auto switch theme */
|
||||||
|
|
||||||
|
function reloadDisqus() {
|
||||||
|
/* Disqus hasn't been loaded */
|
||||||
|
if (typeof DISQUS === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState == 'complete') {
|
||||||
|
DISQUS.reset({ reload: true, config: disqus_config });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const modeToggle = document.querySelector(".mode-toggle");
|
||||||
|
|
||||||
|
if (typeof modeToggle !== "undefined") {
|
||||||
|
/* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
51
_includes/comments/utterances.html
Normal file
51
_includes/comments/utterances.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<!-- https://utteranc.es/ -->
|
||||||
|
<script src="https://utteranc.es/client.js"
|
||||||
|
repo="{{ site.comments.utterances.repo }}"
|
||||||
|
issue-term="{{ site.comments.utterances.issue_term }}"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
const origin = "https://utteranc.es";
|
||||||
|
const iframe = "iframe.utterances-frame";
|
||||||
|
const lightTheme = "github-light";
|
||||||
|
const darkTheme = "github-dark";
|
||||||
|
let initTheme = lightTheme;
|
||||||
|
|
||||||
|
if ($("html[mode=dark]").length > 0
|
||||||
|
|| ($("html[mode]").length == 0
|
||||||
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
||||||
|
initTheme = darkTheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
addEventListener("message", (event) => {
|
||||||
|
let theme;
|
||||||
|
|
||||||
|
/* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */
|
||||||
|
if (event.origin === origin) {
|
||||||
|
/* page initial */
|
||||||
|
theme = initTheme;
|
||||||
|
|
||||||
|
} else if (event.source === window && event.data &&
|
||||||
|
event.data.direction === ModeToggle.ID) {
|
||||||
|
/* global theme mode changed */
|
||||||
|
const mode = event.data.message;
|
||||||
|
theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = {
|
||||||
|
type: "set-theme",
|
||||||
|
theme: theme
|
||||||
|
};
|
||||||
|
|
||||||
|
const utterances = document.querySelector(iframe).contentWindow;
|
||||||
|
utterances.postMessage(message, origin);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<!--
|
|
||||||
The Disqus lazy loading.
|
|
||||||
Powered by: <https://github.com/osvaldasvalutis/disqusLoader.js>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<div id="disqus" class="pt-2 pb-2">
|
|
||||||
<p class="text-center text-muted small pb-5">
|
|
||||||
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="{{ '/assets/js/lib/jquery.disqusloader.min.js' | relative_url }}"></script>
|
|
||||||
<script>
|
|
||||||
const options = {
|
|
||||||
scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
|
|
||||||
|
|
||||||
disqusConfig: function() {
|
|
||||||
this.page.title = '{{ page.title }}';
|
|
||||||
this.page.url = '{{ page.url | absolute_url }}';
|
|
||||||
this.page.identifier = '{{ page.url }}';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$.disqusLoader('#disqus', options);
|
|
||||||
</script>
|
|
||||||
@@ -3,14 +3,14 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<footer class="d-flex w-100 justify-content-center">
|
<footer class="d-flex w-100 justify-content-center">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center text-muted">
|
||||||
<div class="footer-left">
|
<div class="footer-left">
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
© {{ 'now' | date: "%Y" }}
|
© {{ 'now' | date: "%Y" }}
|
||||||
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
||||||
{% if site.data.locales[site.lang].copyright.brief %}
|
{% if site.data.locales[lang].copyright.brief %}
|
||||||
<span data-toggle="tooltip" data-placement="top"
|
<span data-toggle="tooltip" data-placement="top"
|
||||||
title="{{ site.data.locales[site.lang].copyright.verbose }}">{{ site.data.locales[site.lang].copyright.brief }}</span>
|
title="{{ site.data.locales[lang].copyright.verbose }}">{{ site.data.locales[lang].copyright.brief }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
|
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{{ site.data.locales[site.lang].meta
|
{{ site.data.locales[lang].meta
|
||||||
| default: 'Powered by :PLATFORM with :THEME theme.'
|
| default: 'Powered by :PLATFORM with :THEME theme.'
|
||||||
| replace: ':PLATFORM', _platform | replace: ':THEME', _theme
|
| replace: ':PLATFORM', _platform | replace: ':THEME', _theme
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
|
|
||||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||||
|
|
||||||
<!-- i18n for timeago.js -->
|
<!-- i18n for `_javascript/utils/timeago.js` -->
|
||||||
<meta name="day-prompt" content="{{ site.data.locales[site.lang].post.timeago.day | default: "d ago" }}">
|
<meta name="day-prompt" content="{{ site.data.locales[lang].post.timeago.day }}">
|
||||||
<meta name="hour-prompt" content="{{ site.data.locales[site.lang].post.timeago.hour | default: "hr ago" }}">
|
<meta name="hour-prompt" content="{{ site.data.locales[lang].post.timeago.hour }}">
|
||||||
<meta name="minute-prompt" content="{{ site.data.locales[site.lang].post.timeago.minute | default: "min ago" }}">
|
<meta name="minute-prompt" content="{{ site.data.locales[lang].post.timeago.minute }}">
|
||||||
<meta name="justnow-prompt" content="{{ site.data.locales[site.lang].post.timeago.just_now | default: "just now" }}">
|
<meta name="justnow-prompt" content="{{ site.data.locales[lang].post.timeago.just_now }}">
|
||||||
|
|
||||||
{% if site.google_analytics.pv.proxy_endpoint %}
|
{% if site.google_analytics.pv.proxy_endpoint %}
|
||||||
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
|
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<!-- layout specified -->
|
<!-- layout specified -->
|
||||||
|
|
||||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
{% if page.layout == 'post' %}
|
||||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
||||||
<!-- pv-report needs countup.js -->
|
<!-- pv-report needs countup.js -->
|
||||||
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
{% if page.layout == 'post' or page.layout == 'page' %}
|
{% if page.layout == 'post' or page.layout == 'page' %}
|
||||||
<!-- image lazy-loading & popup -->
|
<!-- image lazy-loading & popup -->
|
||||||
<script src="https://cdn.jsdelivr.net/combine/npm/lozad/dist/lozad.min.js,npm/magnific-popup@1/dist/jquery.magnific-popup.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/combine/npm/lozad/dist/lozad.min.js,npm/magnific-popup@1/dist/jquery.magnific-popup.min.js,npm/clipboard@2/dist/clipboard.min.js"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.layout == 'home'
|
{% if page.layout == 'home'
|
||||||
|
|||||||
8
_includes/lang.html
Normal file
8
_includes/lang.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{% comment %}
|
||||||
|
Detect appearance language and return it through variable "lang"
|
||||||
|
{% endcomment %}
|
||||||
|
{% if site.data.locales[site.lang] %}
|
||||||
|
{% assign lang = site.lang %}
|
||||||
|
{% else %}
|
||||||
|
{% assign lang = 'en' %}
|
||||||
|
{% endif %}
|
||||||
70
_includes/language-alias.html
Normal file
70
_includes/language-alias.html
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
{% comment %}
|
||||||
|
|
||||||
|
Convert the alias of the syntax language to the official name
|
||||||
|
|
||||||
|
See: <https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers>
|
||||||
|
|
||||||
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% assign _lang = include.language | default: '' %}
|
||||||
|
|
||||||
|
{% case _lang %}
|
||||||
|
{% when 'actionscript', 'as', 'as3' %}
|
||||||
|
{{ 'ActionScript' }}
|
||||||
|
{% when 'applescript' %}
|
||||||
|
{{ 'AppleScript' }}
|
||||||
|
{% when 'brightscript', 'bs', 'brs' %}
|
||||||
|
{{ 'BrightScript' }}
|
||||||
|
{% when 'cfscript', 'cfc' %}
|
||||||
|
{{ 'CFScript' }}
|
||||||
|
{% when 'coffeescript', 'coffee', 'coffee-script' %}
|
||||||
|
{{ 'CoffeeScript' }}
|
||||||
|
{% when 'cs', 'csharp' %}
|
||||||
|
{{ 'C#' }}
|
||||||
|
{% when 'erl' %}
|
||||||
|
{{ 'Erlang' }}
|
||||||
|
{% when 'graphql' %}
|
||||||
|
{{ 'GraphQL' }}
|
||||||
|
{% when 'haskell', 'hs' %}
|
||||||
|
{{ 'Haskell' }}
|
||||||
|
{% when 'javascript', 'js' %}
|
||||||
|
{{ 'JavaScript' }}
|
||||||
|
{% when 'make', 'mf', 'gnumake', 'bsdmake' %}
|
||||||
|
{{ 'Makefile' }}
|
||||||
|
{% when 'md', 'mkd' %}
|
||||||
|
{{ 'Markdown' }}
|
||||||
|
{% when 'm' %}
|
||||||
|
{{ 'Matlab' }}
|
||||||
|
{% when 'objective_c', 'objc', 'obj-c', 'obj_c', 'objectivec' %}
|
||||||
|
{{ 'Objective-C' }}
|
||||||
|
{% when 'perl', 'pl' %}
|
||||||
|
{{ 'Perl' }}
|
||||||
|
{% when 'php','php3','php4','php5' %}
|
||||||
|
{{ 'PHP' }}
|
||||||
|
{% when 'py' %}
|
||||||
|
{{ 'Python' }}
|
||||||
|
{% when 'rb' %}
|
||||||
|
{{ 'Ruby' }}
|
||||||
|
{% when 'rs','no_run','ignore','should_panic' %}
|
||||||
|
{{ 'Rust' }}
|
||||||
|
{% when 'bash', 'zsh', 'ksh', 'sh' %}
|
||||||
|
{{ 'Shell' }}
|
||||||
|
{% when 'st', 'squeak' %}
|
||||||
|
{{ 'Smalltalk' }}
|
||||||
|
{% when 'tex'%}
|
||||||
|
{{ 'TeX' }}
|
||||||
|
{% when 'latex' %}
|
||||||
|
{{ 'LaTex' }}
|
||||||
|
{% when 'ts', 'typescript' %}
|
||||||
|
{{ 'TypeScript' }}
|
||||||
|
{% when 'vb', 'visualbasic' %}
|
||||||
|
{{ 'Visual Basic' }}
|
||||||
|
{% when 'vue', 'vuejs' %}
|
||||||
|
{{ 'Vue.js' }}
|
||||||
|
{% when 'yml' %}
|
||||||
|
{{ 'YAML' }}
|
||||||
|
{% when 'css', 'html', 'scss', 'ssh', 'toml', 'xml', 'yaml', 'json' %}
|
||||||
|
{{ _lang | upcase }}
|
||||||
|
{% else %}
|
||||||
|
{{ _lang | capitalize }}
|
||||||
|
{% endcase %}
|
||||||
@@ -3,8 +3,34 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
function updateMermaid(event) {
|
||||||
|
if (event.source === window && event.data &&
|
||||||
|
event.data.direction === ModeToggle.ID) {
|
||||||
|
|
||||||
|
const mode = event.data.message;
|
||||||
|
|
||||||
|
if (typeof mermaid === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let expectedTheme = (mode === 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let initTheme = "default";
|
let initTheme = "default";
|
||||||
|
|
||||||
if ($("html[mode=dark]").length > 0
|
if ($("html[mode=dark]").length > 0
|
||||||
@@ -25,5 +51,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
mermaid.initialize(mermaidConf);
|
mermaid.initialize(mermaidConf);
|
||||||
|
|
||||||
|
window.addEventListener("message", updateMermaid);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
Switch the mode between dark and light.
|
Switch the mode between dark and light.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<i class="mode-toggle fas fa-adjust"></i>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
class ModeToggle {
|
class ModeToggle {
|
||||||
static get MODE_KEY() { return "mode"; }
|
static get MODE_KEY() { return "mode"; }
|
||||||
static get DARK_MODE() { return "dark"; }
|
static get DARK_MODE() { return "dark"; }
|
||||||
static get LIGHT_MODE() { return "light"; }
|
static get LIGHT_MODE() { return "light"; }
|
||||||
|
static get ID() { return "mode-toggle"; }
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (this.hasMode) {
|
if (this.hasMode) {
|
||||||
@@ -24,10 +22,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = this;
|
let self = this;
|
||||||
|
|
||||||
/* always follow the system prefers */
|
/* always follow the system prefers */
|
||||||
this.sysDarkPrefers.addListener(function() {
|
this.sysDarkPrefers.addEventListener("change", () => {
|
||||||
if (self.hasMode) {
|
if (self.hasMode) {
|
||||||
if (self.isDarkMode) {
|
if (self.isDarkMode) {
|
||||||
if (!self.isSysDarkPrefer) {
|
if (!self.isSysDarkPrefer) {
|
||||||
@@ -43,11 +41,33 @@
|
|||||||
self.clearMode();
|
self.clearMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
self.updateMermaid();
|
self.notify();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} /* constructor() */
|
} /* constructor() */
|
||||||
|
|
||||||
|
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
||||||
|
|
||||||
|
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
||||||
|
|
||||||
|
get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
|
||||||
|
|
||||||
|
get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
|
||||||
|
|
||||||
|
get hasMode() { return this.mode != null; }
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setDark() {
|
setDark() {
|
||||||
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
||||||
@@ -64,82 +84,45 @@
|
|||||||
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
/* Notify another plugins that the theme mode has changed */
|
||||||
|
notify() {
|
||||||
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
window.postMessage({
|
||||||
|
direction: ModeToggle.ID,
|
||||||
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
message: this.modeStatus
|
||||||
|
}, "*");
|
||||||
get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
|
||||||
|
|
||||||
get hasMode() { return this.mode != null; }
|
|
||||||
|
|
||||||
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
|
||||||
|
|
||||||
/* get the current mode on screen */
|
|
||||||
get modeStatus() {
|
|
||||||
if (this.isDarkMode
|
|
||||||
|| (!this.hasMode && this.isSysDarkPrefer) ) {
|
|
||||||
return ModeToggle.DARK_MODE;
|
|
||||||
} else {
|
|
||||||
return ModeToggle.LIGHT_MODE;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
updateMermaid() {
|
|
||||||
if (typeof mermaid !== "undefined") {
|
|
||||||
let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
|
|
||||||
let config = { theme: expectedTheme };
|
|
||||||
|
|
||||||
/* re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
|
||||||
$(".mermaid").each(function() {
|
|
||||||
let svgCode = $(this).prev().children().html();
|
|
||||||
$(this).removeAttr("data-processed");
|
|
||||||
$(this).html(svgCode);
|
|
||||||
});
|
|
||||||
|
|
||||||
mermaid.initialize(config);
|
|
||||||
mermaid.init(undefined, ".mermaid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flipMode() {
|
|
||||||
if (this.hasMode) {
|
|
||||||
if (this.isSysDarkPrefer) {
|
|
||||||
if (this.isLightMode) {
|
|
||||||
this.clearMode();
|
|
||||||
} else {
|
|
||||||
this.setLight();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (this.isDarkMode) {
|
|
||||||
this.clearMode();
|
|
||||||
} else {
|
|
||||||
this.setDark();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (this.isSysDarkPrefer) {
|
|
||||||
this.setLight();
|
|
||||||
} else {
|
|
||||||
this.setDark();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateMermaid();
|
|
||||||
|
|
||||||
} /* flipMode() */
|
|
||||||
|
|
||||||
} /* ModeToggle */
|
} /* ModeToggle */
|
||||||
|
|
||||||
let toggle = new ModeToggle();
|
const toggle = new ModeToggle();
|
||||||
|
|
||||||
$(".mode-toggle").click(function() {
|
function flipMode() {
|
||||||
|
if (toggle.hasMode) {
|
||||||
|
if (toggle.isSysDarkPrefer) {
|
||||||
|
if (toggle.isLightMode) {
|
||||||
|
toggle.clearMode();
|
||||||
|
} else {
|
||||||
|
toggle.setLight();
|
||||||
|
}
|
||||||
|
|
||||||
toggle.flipMode();
|
} else {
|
||||||
|
if (toggle.isDarkMode) {
|
||||||
|
toggle.clearMode();
|
||||||
|
} else {
|
||||||
|
toggle.setDark();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
} else {
|
||||||
|
if (toggle.isSysDarkPrefer) {
|
||||||
|
toggle.setLight();
|
||||||
|
} else {
|
||||||
|
toggle.setDark();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle.notify();
|
||||||
|
|
||||||
|
} /* flipMode() */
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
<!--
|
|
||||||
The Pannel on right side (Desktop views)
|
|
||||||
-->
|
|
||||||
|
|
||||||
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
|
||||||
|
|
||||||
<div class="access">
|
|
||||||
|
|
||||||
{% include update-list.html %}
|
|
||||||
|
|
||||||
{% if update_list.size > 0 %}
|
|
||||||
|
|
||||||
<div id="access-lastmod" class="post">
|
|
||||||
<span>{{- site.data.locales[site.lang].panel.lastmod | default: 'Recent Update' -}}</span>
|
|
||||||
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
|
||||||
|
|
||||||
{% for item in update_list %}
|
|
||||||
{% assign index = item | split: "::" | last | plus: 0 %}
|
|
||||||
{% assign post = site.posts[index] %}
|
|
||||||
{% assign url = post.url | relative_url %}
|
|
||||||
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div> <!-- #access-lastmod -->
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
|
||||||
|
|
||||||
{% if trending_tags.size > 0 %}
|
|
||||||
<div id="access-tags">
|
|
||||||
<span>{{- site.data.locales[site.lang].panel.trending_tags | default: 'Trending Tags' -}}</span>
|
|
||||||
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
|
||||||
|
|
||||||
{% for tag_name in trending_tags %}
|
|
||||||
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div> <!-- .access -->
|
|
||||||
|
|
||||||
{% if include.toc %}
|
|
||||||
<!-- BS-toc.js will be loaded at medium priority -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
|
|
||||||
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
|
||||||
<span class="pl-3 pt-2 mb-2">
|
|
||||||
{{- site.data.locales[site.lang].panel.toc | default: 'Contents' -}}
|
|
||||||
</span>
|
|
||||||
<nav id="toc" data-toggle="toc"></nav>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div> <!-- #panel-wrapper -->
|
|
||||||
@@ -5,24 +5,24 @@
|
|||||||
<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.locales[site.lang].post.button.previous | default: 'previous' }}">
|
prompt="{{ site.data.locales[lang].post.button.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.locales[site.lang].post.button.previous | default: 'previous' }}">
|
prompt="{{ site.data.locales[lang].post.button.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.locales[site.lang].post.button.next | default: 'next' }}">
|
prompt="{{ site.data.locales[lang].post.button.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.locales[site.lang].post.button.next | default: 'next' }}">
|
prompt="{{ site.data.locales[lang].post.button.next }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<div class="share-wrapper">
|
<div class="share-wrapper">
|
||||||
<span class="share-label text-muted mr-1">{{ site.data.locales[site.lang].post.share | default: 'Share' }}</span>
|
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.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 | absolute_url %}
|
{% assign url = page.url | absolute_url %}
|
||||||
@@ -16,9 +16,10 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<i class="fa-fw fas fa-link small" onclick="copyLink('', '{{ site.data.locales[site.lang].post.button.copy.succeed }}')"
|
<i id="copy-link" class="fa-fw fas fa-link small"
|
||||||
data-toggle="tooltip" data-placement="top"
|
data-toggle="tooltip" data-placement="top"
|
||||||
title="{{ site.data.locales[site.lang].post.button.copy.title }}">
|
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
||||||
|
title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
||||||
</i>
|
</i>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -16,14 +16,15 @@
|
|||||||
{% endunless %}
|
{% endunless %}
|
||||||
|
|
||||||
{% capture read_prompt %}
|
{% capture read_prompt %}
|
||||||
{{- site.data.locales[site.lang].post.read_time.prompt | default: "read" -}}
|
{{- site.data.locales[lang].post.read_time.prompt -}}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<!-- return element -->
|
<!-- return element -->
|
||||||
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
||||||
title="{{ words }} {{ site.data.locales[site.lang].post.words | default: "words" }}">
|
title="{{ words }} {{ site.data.locales[lang].post.words }}">
|
||||||
{{- read_time -}}{{" "}}{{- site.data.locales[site.lang].post.read_time.unit | default: "min" -}}
|
<em>{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}</em>
|
||||||
{%- if include.prompt -%}
|
{%- if include.prompt -%}
|
||||||
{% unless site.lang contains 'zh' %}{{" "}}{% endunless %}{{ read_prompt }}
|
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
|
||||||
|
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -38,92 +38,189 @@
|
|||||||
%}
|
%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<!-- images -->
|
<!-- images -->
|
||||||
|
|
||||||
{% if _content contains '<img src="' %}
|
{% assign IMG_TAG = '<img ' %}
|
||||||
|
|
||||||
<!-- add CDN prefix if it exists -->
|
|
||||||
|
|
||||||
{% 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 _content = _content | replace: '<img src="', '<img data-proofer-ignore data-src="' %}
|
|
||||||
|
|
||||||
<!-- add image placehoder to prevent layout reflow -->
|
|
||||||
|
|
||||||
|
{% if _content contains IMG_TAG %}
|
||||||
{% assign _img_content = nil %}
|
{% assign _img_content = nil %}
|
||||||
|
{% assign _img_snippets = _content | split: IMG_TAG %}
|
||||||
|
|
||||||
{% assign _images = _content | split: '<img ' %}
|
{% for _img_snippet in _img_snippets %}
|
||||||
|
|
||||||
{% for _img in _images %}
|
|
||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
{% assign _img_content = _img %}
|
{% assign _img_content = _img_snippet %}
|
||||||
{% continue %}
|
{% continue %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% assign _width = nil %}
|
{% assign _width = nil %}
|
||||||
{% assign _height = nil %}
|
{% assign _height = nil %}
|
||||||
{% assign _attrs = _img | split: '>' | first | split: ' ' %}
|
{% assign _src = nil %}
|
||||||
|
|
||||||
|
{% assign _left = _img_snippet | split: '/>' | first %}
|
||||||
|
{% assign _right = _img_snippet | replace: _left, '' %}
|
||||||
|
|
||||||
|
{% assign _left = _left | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
|
||||||
|
{% assign _attrs = _left | split: ' ' %}
|
||||||
|
|
||||||
{% for _attr in _attrs %}
|
{% for _attr in _attrs %}
|
||||||
{% capture _key %}{{ _attr | split: '=' | first }}{% endcapture %}
|
{% assign _pair = _attr | split: '=' %}
|
||||||
{% capture _value %}{{ _attr | split: '=' | last | replace: '"', '' }}{% endcapture %}
|
{% if _pair.size < 2 %}
|
||||||
|
{% continue %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% capture _key %}{{ _pair | first }}{% endcapture %}
|
||||||
|
{% capture _value %}{{ _pair | last | replace: '"', '' }}{% endcapture %}
|
||||||
|
|
||||||
{% case _key %}
|
{% case _key %}
|
||||||
{% when 'width' %}
|
{% when 'width' %}
|
||||||
{% assign _width = _value %}
|
{% assign _width = _value %}
|
||||||
{% when 'height' %}
|
{% when 'height' %}
|
||||||
{% assign _height = _value %}
|
{% assign _height = _value %}
|
||||||
|
{% when 'src' %}
|
||||||
|
{% assign _src = _value %}
|
||||||
{% endcase %}
|
{% endcase %}
|
||||||
|
|
||||||
{% if _width and _height %}
|
{% if _width and _height and _src %}
|
||||||
{% capture _svg %}data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{_width}} {{_height}}'%3E%3C/svg%3E{% endcapture %}
|
|
||||||
{% assign _img_content = _img_content | append: '<img src="' | append: _svg | append: '" ' | append: _img %}
|
|
||||||
{% break %}
|
{% break %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% unless _width and _height %}
|
{% if _src %}
|
||||||
{% assign _img_content = _img_content | append: '<img ' | append: _img %}
|
{% unless _src contains '://' %}
|
||||||
|
|
||||||
|
<!-- Add CDN URL -->
|
||||||
|
{% if site.img_cdn %}
|
||||||
|
{% assign _src_prefix = site.img_cdn %}
|
||||||
|
{% else %}
|
||||||
|
{% assign _src_prefix = site.baseurl %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Add image path -->
|
||||||
|
{% if page.img_path %}
|
||||||
|
{% assign _path = page.img_path %}
|
||||||
|
{% assign last_char = _path | slice: -1 %}
|
||||||
|
|
||||||
|
{% unless last_char == '/' %}
|
||||||
|
{% assign _path = _path | append: '/' %}
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
|
|
||||||
|
{% assign _src_prefix = _src_prefix | append: _path %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign _final_src = _src_prefix | append: _src %}
|
||||||
|
{% assign _left = _left | replace: _src, _final_src %}
|
||||||
|
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||||
|
|
||||||
|
{% assign _left = _left | replace: 'src=', 'data-src=' %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Add SVG placehoder to prevent layout reflow -->
|
||||||
|
|
||||||
|
{% if _width and _height %}
|
||||||
|
{%- capture _svg -%}
|
||||||
|
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{% assign _left = _svg | append: ' ' | append: _left %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Bypass the HTML-proofer test -->
|
||||||
|
{% assign _left = _left | append: ' data-proofer-ignore' %}
|
||||||
|
|
||||||
|
{% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% assign _content = _img_content %}
|
{% assign _content = _img_content %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Add lang-badge for code snippets -->
|
<!-- Add header for code snippets -->
|
||||||
|
|
||||||
{% if _content contains '<div class="language-' %}
|
{% if _content contains '<div class="highlight"><code>' %}
|
||||||
{% assign _code_splits = _content | split: '<div class="language-' %}
|
{% assign _code_spippets = _content | split: '<div class="highlight"><code>' %}
|
||||||
{% assign _new_content = nil %}
|
{% assign _new_content = '' %}
|
||||||
|
|
||||||
|
{% for _snippet in _code_spippets %}
|
||||||
|
|
||||||
|
{% if forloop.last %}
|
||||||
|
{% assign _new_content = _new_content | append: _snippet %}
|
||||||
|
|
||||||
{% for _snippet in _code_splits %}
|
|
||||||
{% if forloop.first %}
|
|
||||||
{% assign _new_content = _snippet %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% assign _lang = _snippet | split: ' ' | first %}
|
|
||||||
{% capture _tag_head %}<div lang="{{_lang}}" class="language-{% endcapture %}
|
{% assign _left = _snippet | split: '><' | last%}
|
||||||
{% assign _new_content = _new_content | append: _tag_head | append: _snippet %}
|
|
||||||
|
{% if _left contains 'file="' %}
|
||||||
|
{% assign _label_text = _left | split: 'file="' | last | split: '"' | first %}
|
||||||
|
{% assign _label_icon = 'far fa-file-code' %}
|
||||||
|
{% else %}
|
||||||
|
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
|
||||||
|
{% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %}
|
||||||
|
{% assign _label_icon = 'fas fa-code small' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% capture _label %}
|
||||||
|
<span label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
{% assign _new_content = _new_content | append: _snippet
|
||||||
|
| append: '<div class="code-header">'
|
||||||
|
| append: _label
|
||||||
|
| append: '<button aria-label="copy" title-succeed="'
|
||||||
|
| append: site.data.locales[lang].post.button.copy_code.succeed
|
||||||
|
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
||||||
|
| append: '<div class="highlight"><code>'
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if _new_content %}
|
|
||||||
{% assign _content = _new_content %}
|
{% assign _content = _new_content %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Create heading anchors -->
|
||||||
|
|
||||||
|
{% assign heading_levels = '2,3,4,5' | split: ',' %}
|
||||||
|
{% assign _heading_content = _content %}
|
||||||
|
|
||||||
|
{% for level in heading_levels %}
|
||||||
|
{% capture mark_start %}<h{{ level }} id="{% endcapture %}
|
||||||
|
{% capture mark_end %}</h{{ level }}>{% endcapture %}
|
||||||
|
|
||||||
|
{% if _heading_content contains mark_start %}
|
||||||
|
{% assign _new_content = nil %}
|
||||||
|
{% assign heading_snippets = _heading_content | split: mark_start %}
|
||||||
|
|
||||||
|
{% for snippet in heading_snippets %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
{% assign _new_content = snippet %}
|
||||||
|
{% continue %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign id = snippet | split: '"' | first %}
|
||||||
|
{% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
||||||
|
|
||||||
|
{% assign left = snippet | split: mark_end | first %}
|
||||||
|
{% assign right = snippet | replace: left, '' %}
|
||||||
|
|
||||||
|
{% assign _new_content = _new_content | append: mark_start
|
||||||
|
| append: left | append: anchor | append: mark_end | append: right
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign _heading_content = _new_content %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign _content = _heading_content %}
|
||||||
|
|
||||||
<!-- return -->
|
<!-- return -->
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
{% 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"
|
<h3 class="pt-2 mt-1 mb-4 ml-1"
|
||||||
data-toc-skip>{{ site.data.locales[site.lang].post.relate_posts | default: 'Further Reading' }}</h3>
|
data-toc-skip>{{ site.data.locales[lang].post.relate_posts }}</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 %}
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<div class="text-muted small">
|
<div class="text-muted small">
|
||||||
<p>
|
<p>
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
{{ content | markdownify | strip_html | truncate: 200 }}
|
{{ content | markdownify | strip_html | truncate: 200 | escape }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
{% 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="{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">
|
||||||
{categories}
|
{categories}
|
||||||
{tags}
|
{tags}
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% capture not_found %}<p class="mt-5">Oops! No result founds.</p>{% endcapture %}
|
{% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.7.3/dest/simple-jekyll-search.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
SimpleJekyllSearch({
|
SimpleJekyllSearch({
|
||||||
|
|||||||
@@ -4,15 +4,7 @@
|
|||||||
<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-sm-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.locales[site.lang].panel.trending_tags | default: 'Trending Tags' }}</h4>
|
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
|
|
||||||
{% for tag in trending_tags %}
|
|
||||||
{% capture url %}/tags/{{ tag | slugify | url_encode }}/{% endcapture %}
|
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
|
||||||
{% 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>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<div class="profile-wrapper text-center">
|
<div class="profile-wrapper text-center">
|
||||||
<div id="avatar">
|
<div id="avatar">
|
||||||
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
|
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
|
||||||
|
{% if site.avatar != '' and site.avatar %}
|
||||||
{% capture avatar_url %}
|
{% capture avatar_url %}
|
||||||
{%- if site.avatar contains '://' -%}
|
{%- if site.avatar contains '://' -%}
|
||||||
{{ site.avatar }}
|
{{ site.avatar }}
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
||||||
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -32,7 +34,7 @@
|
|||||||
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
||||||
<a href="{{ '/' | relative_url }}" class="nav-link">
|
<a href="{{ '/' | relative_url }}" class="nav-link">
|
||||||
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
<span>{{ site.data.locales[site.lang].tabs.home | default: "home" | upcase }}</span>
|
<span>{{ site.data.locales[lang].tabs.home | upcase }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- the real tabs -->
|
<!-- the real tabs -->
|
||||||
@@ -42,14 +44,24 @@
|
|||||||
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
|
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
|
||||||
|
|
||||||
<span>{{ site.data.locales[site.lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
|
<span>{{ site.data.locales[lang].tabs.[tab_name] | default: 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 class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center">
|
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
|
||||||
|
|
||||||
|
{% unless site.theme_mode %}
|
||||||
|
<button class="mode-toggle btn" aria-label="Switch Mode">
|
||||||
|
<i class="fas fa-adjust"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{% if site.data.contact.size > 0 %}
|
||||||
|
<span class="icon-border"></span>
|
||||||
|
{% endif %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
{% for entry in site.data.contact %}
|
{% for entry in site.data.contact %}
|
||||||
{% capture url %}
|
{% capture url %}
|
||||||
@@ -69,7 +81,6 @@
|
|||||||
|
|
||||||
{% if url %}
|
{% if url %}
|
||||||
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
||||||
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
|
|
||||||
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
||||||
<i class="{{ entry.icon }}"></i>
|
<i class="{{ entry.icon }}"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -77,16 +88,6 @@
|
|||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% unless site.theme_mode %}
|
|
||||||
{% if site.data.contact.size > 0 %}
|
|
||||||
<span class="icon-border order-2"></span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<span id="mode-toggle-wrapper" class="order-1">
|
|
||||||
{% include mode-toggle.html %}
|
|
||||||
</span>
|
|
||||||
{% endunless %}
|
|
||||||
|
|
||||||
</div> <!-- .sidebar-bottom -->
|
</div> <!-- .sidebar-bottom -->
|
||||||
|
|
||||||
</div><!-- #sidebar -->
|
</div><!-- #sidebar -->
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
<!--
|
<!--
|
||||||
Date format snippet
|
Date format snippet
|
||||||
See: /assets/js/_utils/timeage.js
|
See: ${JS_ROOT}/utils/timeago.js
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% assign tooltip_df = site.data.locales[site.lang].date_format.tooltip | default: '%a, %b %e, %Y, %l:%M %p %z' %}
|
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
||||||
{% assign post_long_df = site.data.locales[site.lang].date_format.post.long | default: '%b %e, %Y' %}
|
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
||||||
{% assign post_short_df = site.data.locales[site.lang].date_format.post.short | default: '%b %e' %}
|
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
||||||
|
|
||||||
{% if include.preposition %}
|
<em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
|
||||||
{{ include.preposition }}
|
date="{{ include.date }}"
|
||||||
{% 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: tooltip_df }}"
|
title="{{ include.date | date: tooltip_df }}"
|
||||||
{% endif %}>
|
{% 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: post_short_df }}
|
{{ include.date | date: post_short_df }}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{ include.date | date: post_long_df }}
|
{{ include.date | date: post_long_df }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
</em>
|
||||||
</span>
|
|
||||||
|
|||||||
16
_includes/toc.html
Normal file
16
_includes/toc.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{% assign enable_toc = false %}
|
||||||
|
{% if site.toc and page.toc %}
|
||||||
|
{% if page.content contains '<h2' or page.content contains '<h3' %}
|
||||||
|
{% assign enable_toc = true %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if enable_toc %}
|
||||||
|
<!-- BS-toc.js will be loaded at medium priority -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
|
||||||
|
|
||||||
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
||||||
|
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>
|
||||||
|
<nav id="toc" data-toggle="toc"></nav>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
{% if paths.size == 0 or page.layout == 'home' %}
|
{% if paths.size == 0 or page.layout == 'home' %}
|
||||||
<!-- index page -->
|
<!-- index page -->
|
||||||
<span>{{ site.data.locales[site.lang].tabs.home | default: 'home' | capitalize }}</span>
|
<span>{{ site.data.locales[lang].tabs.home | capitalize }}</span>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -19,14 +19,14 @@
|
|||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ '/' | relative_url }}">
|
<a href="{{ '/' | relative_url }}">
|
||||||
{{ site.data.locales[site.lang].tabs.home | default: 'home' | capitalize }}
|
{{ site.data.locales[lang].tabs.home | capitalize }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{% elsif forloop.last %}
|
{% elsif forloop.last %}
|
||||||
|
|
||||||
{% if page.collection == 'tabs' %}
|
{% if page.collection == 'tabs' %}
|
||||||
<span>{{ site.data.locales[site.lang].tabs[item] | default: page.title }}</span>
|
<span>{{ site.data.locales[lang].tabs[item] | default: page.title }}</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span>{{ page.title }}</span>
|
<span>{{ page.title }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ item | relative_url }}">
|
<a href="{{ item | relative_url }}">
|
||||||
{{ site.data.locales[site.lang].tabs[item] | default: page.title }}
|
{{ site.data.locales[lang].tabs[item] | default: page.title }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -49,12 +49,12 @@
|
|||||||
|
|
||||||
<div id="topbar-title">
|
<div id="topbar-title">
|
||||||
{% if page.layout == 'home' %}
|
{% if page.layout == 'home' %}
|
||||||
{{- site.data.locales[site.lang].title | default: site.title -}}
|
{{- site.data.locales[lang].title | default: site.title -}}
|
||||||
{% elsif page.collection == 'tabs' %}
|
{% elsif page.collection == 'tabs' or page.dynamic_title %}
|
||||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
||||||
{{- site.data.locales[site.lang].tabs[tab_key] | default: page.title -}}
|
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{- site.data.locales[site.lang].layout[page.layout] | default: page.layout | capitalize -}}
|
{{- site.data.locales[lang].layout[page.layout] | default: page.layout | capitalize -}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -62,10 +62,10 @@
|
|||||||
<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"
|
<input class="form-control" id="search-input" type="search"
|
||||||
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[site.lang].search.hint | default: 'Search' | capitalize }}...">
|
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[lang].search.hint | capitalize }}...">
|
||||||
<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" >{{ site.data.locales[site.lang].search.cancel | default: 'Cancel' }}</span>
|
<span id="search-cancel" >{{ site.data.locales[lang].search.cancel }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,3 +34,17 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if trending_tags.size > 0 %}
|
||||||
|
<div id="access-tags">
|
||||||
|
<div class="panel-heading">{{- site.data.locales[lang].panel.trending_tags -}}</div>
|
||||||
|
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
||||||
|
|
||||||
|
{% for tag_name in trending_tags %}
|
||||||
|
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
||||||
|
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -22,3 +22,19 @@
|
|||||||
{% for entry in all_list limit:MAX_SIZE %}
|
{% for entry in all_list limit:MAX_SIZE %}
|
||||||
{% assign update_list = update_list | push: entry %}
|
{% assign update_list = update_list | push: entry %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if update_list.size > 0 %}
|
||||||
|
|
||||||
|
<div id="access-lastmod" class="post">
|
||||||
|
<div class="panel-heading">{{- site.data.locales[lang].panel.lastmod -}}</div>
|
||||||
|
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
||||||
|
{% for item in update_list %}
|
||||||
|
{% assign index = item | split: "::" | last | plus: 0 %}
|
||||||
|
{% assign post = site.posts[index] %}
|
||||||
|
{% assign url = post.url | relative_url %}
|
||||||
|
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div> <!-- #access-lastmod -->
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|||||||
13
_javascript/commons/mode-toggle.js
Normal file
13
_javascript/commons/mode-toggle.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Listener for theme mode toggle
|
||||||
|
*/
|
||||||
|
$(function() {
|
||||||
|
$(".mode-toggle").click((e) => {
|
||||||
|
const $target = $(e.target);
|
||||||
|
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
|
||||||
|
$target : $target.parent());
|
||||||
|
|
||||||
|
$btn.blur(); // remove the clicking outline
|
||||||
|
flipMode();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,50 +3,50 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
const $topbarWrapper = $("#topbar-wrapper");
|
||||||
|
const $panel = $("#panel-wrapper");
|
||||||
|
const $searchInput = $("#search-input");
|
||||||
|
|
||||||
const topbarWrapper = $("#topbar-wrapper");
|
const CLASS_TOPBAR_UP = "topbar-up";
|
||||||
const toc = $("#toc-wrapper");
|
const CLASS_TOPBAR_DOWN = "topbar-down";
|
||||||
const access = $(".access");
|
const ATTR_TOC_SCROLLING_UP = "toc-scrolling-up"; // topbar locked
|
||||||
const searchInput = $("#search-input");
|
|
||||||
|
|
||||||
let didScroll;
|
let didScroll;
|
||||||
let lastScrollTop = 0;
|
let lastScrollTop = 0;
|
||||||
|
|
||||||
const delta = 5;
|
const delta = $topbarWrapper.outerHeight();
|
||||||
const topbarHeight = topbarWrapper.outerHeight();
|
const topbarHeight = $topbarWrapper.outerHeight();
|
||||||
|
|
||||||
function hasScrolled() {
|
function hasScrolled() {
|
||||||
var st = $(this).scrollTop();
|
let st = $(this).scrollTop();
|
||||||
|
|
||||||
/* Make sure they scroll more than delta */
|
/* Make sure they scroll more than delta */
|
||||||
if (Math.abs(lastScrollTop - st) <= delta) {
|
if (Math.abs(lastScrollTop - st) <= delta) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (st > lastScrollTop && st > topbarHeight) {
|
if (st > lastScrollTop ) { // Scroll Down
|
||||||
/* Scroll Down */
|
if (st > topbarHeight) {
|
||||||
topbarWrapper.removeClass("topbar-down").addClass("topbar-up");
|
$topbarWrapper.removeClass(CLASS_TOPBAR_DOWN).addClass(CLASS_TOPBAR_UP);
|
||||||
|
$panel.removeClass(CLASS_TOPBAR_DOWN);
|
||||||
|
|
||||||
if (toc.length > 0) {
|
if ($searchInput.is(":focus")) {
|
||||||
toc.removeClass("topbar-down");
|
$searchInput.blur(); /* remove focus */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {// Scroll up
|
||||||
|
// did not reach the bottom of the document, i.e., still have space to scroll up
|
||||||
|
if (st + $(window).height() < $(document).height()) {
|
||||||
|
let tocScrollingUp = $topbarWrapper.attr(ATTR_TOC_SCROLLING_UP);
|
||||||
|
if (typeof tocScrollingUp !== "undefined") {
|
||||||
|
if (tocScrollingUp === "false") {
|
||||||
|
$topbarWrapper.removeAttr(ATTR_TOC_SCROLLING_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (access.length > 0) {
|
} else {
|
||||||
access.removeClass("topbar-down");
|
$topbarWrapper.removeClass(CLASS_TOPBAR_UP).addClass(CLASS_TOPBAR_DOWN);
|
||||||
|
$panel.addClass(CLASS_TOPBAR_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchInput.is(":focus")) {
|
|
||||||
searchInput.blur(); /* remove focus */
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (st + $(window).height() < $(document).height()) {
|
|
||||||
/* Scroll Up */
|
|
||||||
topbarWrapper.removeClass("topbar-up").addClass("topbar-down");
|
|
||||||
if (toc.length > 0) {
|
|
||||||
toc.addClass("topbar-down");
|
|
||||||
}
|
|
||||||
if (access.length > 0) {
|
|
||||||
access.addClass("topbar-down");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(window).scroll(function(event) {
|
$(window).scroll(function(event) {
|
||||||
if ($("#topbar-title").is(":hidden")) { /* Not in small screens */
|
if ($("#topbar-title").is(":hidden")) {
|
||||||
didScroll = true;
|
didScroll = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.1.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
131
_javascript/utils/clipboard.js
Normal file
131
_javascript/utils/clipboard.js
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* Clipboard functions
|
||||||
|
*
|
||||||
|
* Dependencies:
|
||||||
|
* - popper.js (https://github.com/popperjs/popper-core)
|
||||||
|
* - clipboard.js (https://github.com/zenorocha/clipboard.js)
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
const btnSelector = '.code-header>button';
|
||||||
|
const ICON_SUCCESS = 'fas fa-check';
|
||||||
|
const ATTR_TIMEOUT = 'timeout';
|
||||||
|
const TIMEOUT = 2000; // in milliseconds
|
||||||
|
|
||||||
|
function isLocked(node) {
|
||||||
|
if ($(node)[0].hasAttribute(ATTR_TIMEOUT)) {
|
||||||
|
let timeout = $(node).attr(ATTR_TIMEOUT);
|
||||||
|
if (Number(timeout) > Date.now()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function lock(node) {
|
||||||
|
$(node).attr(ATTR_TIMEOUT, Date.now() + TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
function unlock(node) {
|
||||||
|
$(node).removeAttr(ATTR_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Copy code block --- */
|
||||||
|
|
||||||
|
// Initial the clipboard.js object
|
||||||
|
const clipboard = new ClipboardJS(btnSelector, {
|
||||||
|
target(trigger) {
|
||||||
|
let codeBlock = trigger.parentNode.nextElementSibling;
|
||||||
|
return codeBlock.querySelector('code .rouge-code');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(btnSelector).tooltip({
|
||||||
|
trigger: 'hover',
|
||||||
|
placement: 'left'
|
||||||
|
});
|
||||||
|
|
||||||
|
function getIcon(btn) {
|
||||||
|
let iconNode = $(btn).children();
|
||||||
|
return iconNode.attr('class');
|
||||||
|
}
|
||||||
|
|
||||||
|
const ICON_DEFAULT = getIcon(btnSelector);
|
||||||
|
|
||||||
|
function showTooltip(btn) {
|
||||||
|
const succeedTitle = $(btn).attr('title-succeed');
|
||||||
|
$(btn).attr('data-original-title', succeedTitle).tooltip('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideTooltip(btn) {
|
||||||
|
$(btn).tooltip('hide').removeAttr('data-original-title');
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSuccessIcon(btn) {
|
||||||
|
let btnNode = $(btn);
|
||||||
|
let iconNode = btnNode.children();
|
||||||
|
iconNode.attr('class', ICON_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
function resumeIcon(btn) {
|
||||||
|
let btnNode = $(btn);
|
||||||
|
let iconNode = btnNode.children();
|
||||||
|
iconNode.attr('class', ICON_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
clipboard.on('success', (e) => {
|
||||||
|
e.clearSelection();
|
||||||
|
|
||||||
|
const trigger = e.trigger;
|
||||||
|
if (isLocked(trigger)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSuccessIcon(trigger);
|
||||||
|
showTooltip(trigger);
|
||||||
|
lock(trigger);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
hideTooltip(trigger);
|
||||||
|
resumeIcon(trigger);
|
||||||
|
unlock(trigger);
|
||||||
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/* --- Post link sharing --- */
|
||||||
|
|
||||||
|
$('#copy-link').click((e) => {
|
||||||
|
|
||||||
|
let target = $(e.target);
|
||||||
|
|
||||||
|
if (isLocked(target)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy URL to clipboard
|
||||||
|
|
||||||
|
const url = window.location.href;
|
||||||
|
const $temp = $("<input>");
|
||||||
|
|
||||||
|
$("body").append($temp);
|
||||||
|
$temp.val(url).select();
|
||||||
|
document.execCommand("copy");
|
||||||
|
$temp.remove();
|
||||||
|
|
||||||
|
// Switch tooltip title
|
||||||
|
|
||||||
|
const defaultTitle = target.attr('data-original-title');
|
||||||
|
const succeedTitle = target.attr('title-succeed');
|
||||||
|
|
||||||
|
target.attr('data-original-title', succeedTitle).tooltip('show');
|
||||||
|
lock(target);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
target.attr('data-original-title', defaultTitle);
|
||||||
|
unlock(target);
|
||||||
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copy current page url to clipboard.
|
|
||||||
*/
|
|
||||||
|
|
||||||
function copyLink(url, msg) {
|
|
||||||
if (!url || 0 === url.length) {
|
|
||||||
url = window.location.href;
|
|
||||||
}
|
|
||||||
|
|
||||||
const $temp = $("<input>");
|
|
||||||
$("body").append($temp);
|
|
||||||
$temp.val(url).select();
|
|
||||||
document.execCommand("copy");
|
|
||||||
$temp.remove();
|
|
||||||
|
|
||||||
let feedback = "Link copied successfully!";
|
|
||||||
if (msg && msg.length > 0) {
|
|
||||||
feedback = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
alert(feedback);
|
|
||||||
}
|
|
||||||
@@ -8,49 +8,61 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
const $topbarWrapper = $("#topbar-wrapper");
|
||||||
|
const topbarHeight = $topbarWrapper.outerHeight();
|
||||||
|
const $topbarTitle = $("#topbar-title");
|
||||||
|
|
||||||
|
const ATTR_TOC_SCROLLING = "toc-scrolling-up";
|
||||||
|
const SCROLL_MARK = "scroll-focus";
|
||||||
|
const REM = 16; // in pixels
|
||||||
|
let tocScrollUpCount = 0;
|
||||||
|
|
||||||
$("a[href*='#']")
|
$("a[href*='#']")
|
||||||
.not("[href='#']")
|
.not("[href='#']")
|
||||||
.not("[href='#0']")
|
.not("[href='#0']")
|
||||||
.click(function(event) {
|
.click(function(event) {
|
||||||
|
|
||||||
if (this.pathname.replace(/^\//, "") === location.pathname.replace(/^\//, "")) {
|
if (this.pathname.replace(/^\//, "") === location.pathname.replace(/^\//, "")) {
|
||||||
if (location.hostname === this.hostname) {
|
if (location.hostname === this.hostname) {
|
||||||
|
|
||||||
const REM = 16; /* 16px */
|
|
||||||
|
|
||||||
const hash = decodeURI(this.hash);
|
const hash = decodeURI(this.hash);
|
||||||
let isFnRef = RegExp(/^#fnref:/).test(hash);
|
let toFootnoteRef = RegExp(/^#fnref:/).test(hash);
|
||||||
let isFn = RegExp(/^#fn:/).test(hash);
|
let toFootnote = toFootnoteRef? false : RegExp(/^#fn:/).test(hash);
|
||||||
let selector = hash.includes(":") ? hash.replace(/\:/, "\\:") : hash;
|
let selector = hash.includes(":") ? hash.replace(/\:/g, "\\:") : hash;
|
||||||
let target = $(selector);
|
let $target = $(selector);
|
||||||
|
|
||||||
if (target.length) {
|
let parent = $(this).parent().prop("tagName");
|
||||||
|
let isAnchor = RegExp(/^H\d/).test(parent);
|
||||||
|
let isMobileViews = !$topbarTitle.is(":hidden");
|
||||||
|
|
||||||
|
if (typeof $target !== "undefined") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if (history.pushState) { /* add hash to URL */
|
if (history.pushState) { /* add hash to URL */
|
||||||
history.pushState(null, null, hash);
|
history.pushState(null, null, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
let curOffset = $(this).offset().top;
|
let curOffset = isAnchor? $(this).offset().top : $(window).scrollTop();
|
||||||
let destOffset = target.offset().top;
|
let destOffset = $target.offset().top -= REM / 2;
|
||||||
const scrollUp = (destOffset < curOffset);
|
|
||||||
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
|
||||||
|
|
||||||
if (scrollUp && isFnRef) {
|
if (destOffset < curOffset) { // scroll up
|
||||||
/* Avoid the top-bar covering `fnref` when scrolling up
|
if (!isAnchor && !toFootnote) { // trigger by ToC item
|
||||||
because `fnref` has no `%anchor`(see: module.scss) style. */
|
if (!isMobileViews) { // on desktop/tablet screens
|
||||||
destOffset -= (topbarHeight + REM / 2);
|
$topbarWrapper.removeClass("topbar-down").addClass("topbar-up");
|
||||||
|
// Send message to `${JS_ROOT}/commons/topbar-switch.js`
|
||||||
|
$topbarWrapper.attr(ATTR_TOC_SCROLLING, true);
|
||||||
|
tocScrollUpCount += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("html,body").animate({
|
if ((isAnchor || toFootnoteRef) && isMobileViews) {
|
||||||
|
destOffset -= topbarHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$("html").animate({
|
||||||
scrollTop: destOffset
|
scrollTop: destOffset
|
||||||
}, 800, () => {
|
}, 500, () => {
|
||||||
|
|
||||||
const $target = $(target);
|
|
||||||
$target.focus();
|
$target.focus();
|
||||||
|
|
||||||
const SCROLL_MARK = "scroll-focus";
|
|
||||||
|
|
||||||
/* clean up old scroll mark */
|
/* clean up old scroll mark */
|
||||||
if ($(`[${SCROLL_MARK}=true]`).length) {
|
if ($(`[${SCROLL_MARK}=true]`).length) {
|
||||||
$(`[${SCROLL_MARK}=true]`).attr(SCROLL_MARK, false);
|
$(`[${SCROLL_MARK}=true]`).attr(SCROLL_MARK, false);
|
||||||
@@ -62,7 +74,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set scroll mark to footnotes */
|
/* set scroll mark to footnotes */
|
||||||
if (isFn || isFnRef) {
|
if (toFootnote || toFootnoteRef) {
|
||||||
$target.attr(SCROLL_MARK, true);
|
$target.attr(SCROLL_MARK, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +84,14 @@ $(function() {
|
|||||||
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
||||||
$target.focus(); /* Set focus again */
|
$target.focus(); /* Set focus again */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof $topbarWrapper.attr(ATTR_TOC_SCROLLING) !== "undefined") {
|
||||||
|
tocScrollUpCount -= 1;
|
||||||
|
|
||||||
|
if (tocScrollUpCount <= 0) {
|
||||||
|
$topbarWrapper.attr(ATTR_TOC_SCROLLING, "false");
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
const timeagoElem = $(".timeago");
|
const timeagoElem = $(".timeago");
|
||||||
|
let tasks = timeagoElem.length;
|
||||||
let toRefresh = timeagoElem.length;
|
|
||||||
|
|
||||||
let intervalId = void 0;
|
let intervalId = void 0;
|
||||||
|
|
||||||
const dPrompt = $("meta[name=day-prompt]").attr("content");
|
const dPrompt = $("meta[name=day-prompt]").attr("content");
|
||||||
@@ -15,20 +12,19 @@ $(function() {
|
|||||||
const minPrompt = $("meta[name=minute-prompt]").attr("content");
|
const minPrompt = $("meta[name=minute-prompt]").attr("content");
|
||||||
const justnowPrompt = $("meta[name=justnow-prompt]").attr("content");
|
const justnowPrompt = $("meta[name=justnow-prompt]").attr("content");
|
||||||
|
|
||||||
function timeago(isoDate, dateStr) {
|
function timeago(date, initDate) {
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let past = new Date(isoDate);
|
let past = new Date(date);
|
||||||
|
|
||||||
if (past.getFullYear() !== now.getFullYear()
|
if (past.getFullYear() !== now.getFullYear()
|
||||||
|| past.getMonth() !== now.getMonth()) {
|
|| past.getMonth() !== now.getMonth()) {
|
||||||
return dateStr;
|
return initDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
let seconds = Math.floor((now - past) / 1000);
|
let seconds = Math.floor((now - past) / 1000);
|
||||||
|
|
||||||
let day = Math.floor(seconds / 86400);
|
let day = Math.floor(seconds / 86400);
|
||||||
if (day >= 1) {
|
if (day >= 1) {
|
||||||
toRefresh -= 1;
|
|
||||||
return ` ${day} ${dPrompt}`;
|
return ` ${day} ${dPrompt}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,22 +43,30 @@ $(function() {
|
|||||||
|
|
||||||
function updateTimeago() {
|
function updateTimeago() {
|
||||||
$(".timeago").each(function() {
|
$(".timeago").each(function() {
|
||||||
if ($(this).children("i").length > 0) {
|
if ($(this)[0].hasAttribute("date") === false) {
|
||||||
let dateStr = $(this).clone().children().remove().end().text();
|
tasks -= 1;
|
||||||
let node = $(this).children("i");
|
return;
|
||||||
let iosDate = node.text(); /* ISO Date: "YYYY-MM-DDTHH:MM:SSZ" */
|
|
||||||
$(this).text(timeago(iosDate, dateStr));
|
|
||||||
$(this).append(node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let date = $(this).attr("date");
|
||||||
|
let initDate = $(this).text();
|
||||||
|
let relativeDate = timeago(date, initDate);
|
||||||
|
|
||||||
|
if (relativeDate === initDate) {
|
||||||
|
$(this).removeAttr("date");
|
||||||
|
} else {
|
||||||
|
$(this).text(relativeDate);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (toRefresh === 0 && typeof intervalId !== "undefined") {
|
if (tasks === 0 && typeof intervalId !== "undefined") {
|
||||||
clearInterval(intervalId); /* stop interval */
|
clearInterval(intervalId); /* stop interval */
|
||||||
}
|
}
|
||||||
return toRefresh;
|
return tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toRefresh === 0) {
|
if (tasks === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ layout: page
|
|||||||
# The Archives of posts.
|
# The Archives of posts.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
<div id="archives" class="pl-xl-2">
|
<div id="archives" class="pl-xl-2">
|
||||||
|
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
@@ -17,7 +19,7 @@ layout: page
|
|||||||
<li>
|
<li>
|
||||||
<div>
|
<div>
|
||||||
{% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %}
|
{% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %}
|
||||||
{% capture _mth_df %}{{ site.data.locales[site.lang].date_format.post.archive_month | default: "%b" }}{% endcapture %}
|
{% capture _mth_df %}{{ site.data.locales[lang].date_format.post.archive_month }}{% endcapture %}
|
||||||
{% capture this_month %}{{ post.date | date: _mth_df }}{% endcapture %}
|
{% capture this_month %}{{ post.date | date: _mth_df }}{% endcapture %}
|
||||||
<span class="date day">{{ this_day }}</span>
|
<span class="date day">{{ this_day }}</span>
|
||||||
<span class="date month small text-muted">{% include no-zero-date.html date_str=this_month %}</span>
|
<span class="date month small text-muted">{% include no-zero-date.html date_str=this_month %}</span>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ layout: page
|
|||||||
# All the Categories of posts
|
# All the Categories of posts
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
{% assign HEAD_PREFIX = "h_" %}
|
{% assign HEAD_PREFIX = "h_" %}
|
||||||
{% assign LIST_PREFIX = "l_" %}
|
{% assign LIST_PREFIX = "l_" %}
|
||||||
|
|
||||||
@@ -45,10 +47,10 @@ layout: page
|
|||||||
<span class="text-muted small font-weight-light">
|
<span class="text-muted small font-weight-light">
|
||||||
{% if sub_categories_size > 0 %}
|
{% if sub_categories_size > 0 %}
|
||||||
{{ sub_categories_size }}
|
{{ sub_categories_size }}
|
||||||
{{ site.data.locales[site.lang].categories.category_measure | default: 'categories' }},
|
{{ site.data.locales[lang].categories.category_measure }},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ top_posts_size }}
|
{{ top_posts_size }}
|
||||||
{{ site.data.locales[site.lang].categories.post_measure | default: 'posts' }}
|
{{ site.data.locales[lang].categories.post_measure }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -81,7 +83,7 @@ layout: page
|
|||||||
{% assign posts_size = site.categories[sub_category] | size %}
|
{% assign posts_size = site.categories[sub_category] | size %}
|
||||||
<span class="text-muted small font-weight-light">
|
<span class="text-muted small font-weight-light">
|
||||||
{{ posts_size }}
|
{{ posts_size }}
|
||||||
{{ site.data.locales[site.lang].categories.post_measure | default: 'posts' }}
|
{{ site.data.locales[lang].categories.post_measure }}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ layout: page
|
|||||||
# The Category layout
|
# The Category layout
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
<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>
|
||||||
@@ -11,7 +13,7 @@ layout: page
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<ul class="post-content pl-0">
|
<ul class="post-content pl-0">
|
||||||
{% assign post_df = site.data.locales[site.lang].date_format.post.long | default: '%b %e, %Y' %}
|
{% assign post_df = site.data.locales[lang].date_format.post.long %}
|
||||||
|
|
||||||
{% for post in page.posts %}
|
{% 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">
|
||||||
|
|||||||
@@ -5,16 +5,22 @@ layout: compress
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
{% capture prefer_mode %}
|
{% capture prefer_mode %}
|
||||||
{% if site.theme_mode %}
|
{% if site.theme_mode %}
|
||||||
mode="{{ site.theme_mode }}"
|
mode="{{ site.theme_mode }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<html lang="{{ site.lang | default: 'en' }}" {{ prefer_mode }}>
|
<html lang="{{ site.lang }}"{{ prefer_mode }}>
|
||||||
|
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
|
|
||||||
|
{% unless site.theme_mode %}
|
||||||
|
{% include mode-toggle.html %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
<body data-spy="scroll" data-target="#toc">
|
<body data-spy="scroll" data-target="#toc">
|
||||||
|
|
||||||
{% include sidebar.html %}
|
{% include sidebar.html %}
|
||||||
@@ -24,7 +30,7 @@ layout: compress
|
|||||||
<div id="main-wrapper">
|
<div id="main-wrapper">
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
{% include refactor-content.html content=content %}
|
{{ content }}
|
||||||
|
|
||||||
{% include footer.html %}
|
{% include footer.html %}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ layout: page
|
|||||||
# The Home page layout
|
# The Home page layout
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
{% assign pinned = site.posts | where: "pin", "true" %}
|
{% assign pinned = site.posts | where: "pin", "true" %}
|
||||||
{% assign default = site.posts | where_exp: "item", "item.pin != true" %}
|
{% assign default = site.posts | where_exp: "item", "item.pin != true" %}
|
||||||
|
|
||||||
@@ -51,13 +53,13 @@ layout: page
|
|||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<p>
|
<p>
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
{{ content | markdownify | strip_html | truncate: 200 }}
|
{{ content | markdownify | strip_html | truncate: 200 | escape }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-meta text-muted d-flex justify-content-between">
|
<div class="post-meta text-muted d-flex">
|
||||||
|
|
||||||
<div>
|
<div class="mr-auto">
|
||||||
<!-- posted date -->
|
<!-- posted date -->
|
||||||
<i class="far fa-calendar fa-fw"></i>
|
<i class="far fa-calendar fa-fw"></i>
|
||||||
{% include timeago.html date=post.date tooltip=true %}
|
{% include timeago.html date=post.date tooltip=true %}
|
||||||
@@ -66,11 +68,14 @@ layout: page
|
|||||||
<i class="far fa-clock fa-fw"></i>
|
<i class="far fa-clock fa-fw"></i>
|
||||||
{% include read-time.html content=post.content %}
|
{% include read-time.html content=post.content %}
|
||||||
|
|
||||||
<!-- page views -->
|
<!-- categories -->
|
||||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
{% if post.categories.size > 0 %}
|
||||||
<i class="far fa-eye fa-fw"></i>
|
<i class="far fa-folder-open fa-fw"></i>
|
||||||
<span id="pv_{{-post.title-}}" class="pageviews">
|
<span>
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
{% for category in post.categories %}
|
||||||
|
{{ category }}
|
||||||
|
{%- unless forloop.last -%},{%- endunless -%}
|
||||||
|
{% endfor %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +83,7 @@ layout: page
|
|||||||
{% if post.pin %}
|
{% if post.pin %}
|
||||||
<div class="pin">
|
<div class="pin">
|
||||||
<i class="fas fa-thumbtack fa-fw"></i>
|
<i class="fas fa-thumbtack fa-fw"></i>
|
||||||
<span>{{ site.data.locales[site.lang].post.pin_prompt | default: 'Pinned' }}</span>
|
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,64 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
# The page layout
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-11 col-xl-8">
|
|
||||||
<div id="page" class="post pb-5 pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 mb-md-4">
|
<!-- core -->
|
||||||
{% if page.dynamic_title %}
|
<div id="core-wrapper" class="col-12 col-lg-11 col-xl-8">
|
||||||
<h1 class="dynamic-title">
|
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
||||||
{% if page.collection == 'tabs' %}
|
|
||||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
{% capture _content %}
|
||||||
{{- site.data.locales[site.lang].tabs[tab_key] | default: page.title -}}
|
{% if layout.refactor or page.layout == 'page' %}
|
||||||
|
{% include refactor-content.html content=content %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{- page.title -}}
|
{{ content }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
{% if page.layout == 'page' or page.collection == 'tabs'%}
|
||||||
|
{% assign title = site.data.locales[lang].tabs[tab_key] | default: page.title %}
|
||||||
|
<h1 class="dynamic-title">
|
||||||
|
{{ title }}
|
||||||
</h1>
|
</h1>
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ content }}
|
{{ _content }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ content }}
|
{{ _content }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div> <!-- #page -->
|
|
||||||
</div><!-- .col-12 -->
|
|
||||||
|
|
||||||
{% include panel.html %}
|
</div>
|
||||||
|
</div> <!-- #core-wrapper -->
|
||||||
|
|
||||||
|
<!-- pannel -->
|
||||||
|
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
||||||
|
|
||||||
|
<div class="access">
|
||||||
|
{% include update-list.html %}
|
||||||
|
{% include trending-tags.html %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for _include in layout.pannel_includes %}
|
||||||
|
{% assign _include_path = _include | append: '.html' %}
|
||||||
|
{% include {{ _include_path }} %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if site.disqus.comments and page.comments %}
|
<!-- tail -->
|
||||||
|
{% if layout.tail_includes %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-11 col-xl-8">
|
<div class="col-12 col-lg-11 col-xl-8">
|
||||||
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
<div id="tail-wrapper" class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
||||||
|
{% for _include in layout.tail_includes %}
|
||||||
{% include disqus.html %}
|
{% assign _include_path = _include | append: '.html' %}
|
||||||
|
{% include {{ _include_path }} %}
|
||||||
</div> <!-- .pl-1 pr-1 -->
|
{% endfor %}
|
||||||
</div> <!-- .col-12 -->
|
</div>
|
||||||
|
</div>
|
||||||
</div> <!-- .row -->
|
</div> <!-- .row -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,32 +1,74 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: page
|
||||||
# The posts' layout
|
refactor: true
|
||||||
|
pannel_includes:
|
||||||
|
- toc
|
||||||
|
tail_includes:
|
||||||
|
- related-posts
|
||||||
|
- post-nav
|
||||||
|
- comments
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="row">
|
{% include lang.html %}
|
||||||
|
|
||||||
<div id="post-wrapper" class="col-12 col-lg-11 col-xl-8">
|
{% if page.image.src %}
|
||||||
|
{% capture bg %}
|
||||||
|
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
|
||||||
|
{% endcapture %}
|
||||||
|
<img src="{{ page.image.src }}" class="preview-img {{ bg | strip }}"
|
||||||
|
alt="{{ page.image.alt | default: "Preview Image" }}"
|
||||||
|
|
||||||
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
{% if page.image.width %}
|
||||||
|
width="{{ page.image.width }}"
|
||||||
|
{% elsif page.image.w %}
|
||||||
|
width="{{ page.image.w }}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<h1 data-toc-skip>{{ page.title }}</h1>
|
{% if page.image.height %}
|
||||||
|
height="{{ page.image.height }}"
|
||||||
|
{% elsif page.image.h %}
|
||||||
|
height="{{ page.image.h }}"
|
||||||
|
{% endif %}>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="post-meta text-muted d-flex flex-column">
|
<h1 data-toc-skip>{{ page.title }}</h1>
|
||||||
<!-- Published date and author -->
|
|
||||||
|
<div class="post-meta text-muted">
|
||||||
|
|
||||||
|
<!-- author -->
|
||||||
<div>
|
<div>
|
||||||
<span class="semi-bold">
|
{% capture author_name %}{{ page.author.name | default: site.social.name }}{% endcapture %}
|
||||||
{{ page.author | default: site.social.name }}
|
{% assign author_link = nil %}
|
||||||
</span>
|
|
||||||
{% capture _preposition %}{{ site.data.locales[site.lang].post.published | default: 'on' }}{% endcapture %}
|
{% if page.author.link %}
|
||||||
{% include timeago.html date=page.date tooltip=true preposition=_preposition %}
|
{% assign author_link = page.author.link %}
|
||||||
|
{% elsif author_name == site.social.name %}
|
||||||
|
{% assign author_link = site.social.links[0] %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{{ site.data.locales[lang].post.written_by }}
|
||||||
|
<em>
|
||||||
|
{% if author_link %}
|
||||||
|
<a href="{{ author_link }}">{{ author_name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ author_name }}
|
||||||
|
{% endif %}
|
||||||
|
</em>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex">
|
||||||
<div>
|
<div>
|
||||||
<!-- lastmod -->
|
<!-- published date -->
|
||||||
|
<span>
|
||||||
|
{{ site.data.locales[lang].post.posted }}
|
||||||
|
{% include timeago.html date=page.date tooltip=true %}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- lastmod date -->
|
||||||
{% if page.last_modified_at %}
|
{% if page.last_modified_at %}
|
||||||
<span>
|
<span>
|
||||||
{{ site.data.locales[site.lang].post.updated | default: 'Updated' }}
|
{{ site.data.locales[lang].post.updated }}
|
||||||
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
|
{% include timeago.html date=page.last_modified_at tooltip=true %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -35,35 +77,27 @@ layout: default
|
|||||||
|
|
||||||
<!-- page views -->
|
<!-- page views -->
|
||||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
||||||
<span id="pv" class="pageviews">
|
<span>
|
||||||
|
<em id="pv" class="pageviews">
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
||||||
|
</em>
|
||||||
|
{{ site.data.locales[lang].post.pageview_measure }}
|
||||||
</span>
|
</span>
|
||||||
{{ site.data.locales[site.lang].post.pageview_measure | default: "views" }}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div> <!-- .post-meta -->
|
</div> <!-- .d-flex -->
|
||||||
|
|
||||||
<div class="post-content">
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
{% if page.image.src %}
|
|
||||||
<img src="{{ page.image.src }}"
|
|
||||||
class="preview-img"
|
|
||||||
alt="{{ page.image.alt | default: "Preview Image" }}"
|
|
||||||
{% if page.image.width %}width="{{ page.image.width }}"{% endif %}
|
|
||||||
{% if page.image.height %}height="{{ page.image.height }}"{% endif %}>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
<div class="post-content">
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="post-tail-wrapper text-muted">
|
||||||
|
|
||||||
<div class="post-tail-wrapper text-muted">
|
|
||||||
|
|
||||||
<!-- categories -->
|
<!-- categories -->
|
||||||
{% if page.categories.size > 0 %}
|
{% if page.categories.size > 0 %}
|
||||||
|
|
||||||
<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 %}
|
||||||
@@ -89,13 +123,17 @@ layout: default
|
|||||||
<div class="post-tail-bottom
|
<div class="post-tail-bottom
|
||||||
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
||||||
<div class="license-wrapper">
|
<div class="license-wrapper">
|
||||||
{% if site.data.locales[site.lang].copyright.license.template %}
|
|
||||||
|
{% if site.data.locales[lang].copyright.license.template %}
|
||||||
|
|
||||||
{% capture _replacement %}
|
{% capture _replacement %}
|
||||||
<a href="{{ site.data.locales[site.lang].copyright.license.link }}">
|
<a href="{{ site.data.locales[lang].copyright.license.link }}">
|
||||||
{{ site.data.locales[site.lang].copyright.license.name }}
|
{{ site.data.locales[lang].copyright.license.name }}
|
||||||
</a>
|
</a>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
{{ site.data.locales[site.lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
|
||||||
|
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -103,39 +141,4 @@ layout: default
|
|||||||
|
|
||||||
</div><!-- .post-tail-bottom -->
|
</div><!-- .post-tail-bottom -->
|
||||||
|
|
||||||
</div><!-- div.post-tail -->
|
</div><!-- div.post-tail-wrapper -->
|
||||||
|
|
||||||
</div> <!-- .post -->
|
|
||||||
|
|
||||||
|
|
||||||
</div> <!-- #post-wrapper -->
|
|
||||||
|
|
||||||
{% 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 class="row">
|
|
||||||
<div class="col-12 col-lg-11 col-xl-8">
|
|
||||||
<div id="post-extend-wrapper" class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
|
||||||
|
|
||||||
{% include related-posts.html %}
|
|
||||||
|
|
||||||
{% include post-nav.html %}
|
|
||||||
|
|
||||||
{% if site.disqus.comments and page.comments %}
|
|
||||||
{% include disqus.html %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div> <!-- #post-extend-wrapper -->
|
|
||||||
|
|
||||||
</div> <!-- .col-* -->
|
|
||||||
|
|
||||||
</div> <!-- .row -->
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ layout: page
|
|||||||
# The layout for Tag page
|
# The layout for Tag page
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
<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>
|
||||||
@@ -10,7 +12,7 @@ layout: page
|
|||||||
<span class="lead text-muted pl-2">{{ page.posts | 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">
|
||||||
{% assign post_df = site.data.locales[site.lang].date_format.post.long | default: '%b %e, %Y' %}
|
{% assign post_df = site.data.locales[lang].date_format.post.long %}
|
||||||
|
|
||||||
{% for post in page.posts %}
|
{% 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">
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
---
|
---
|
||||||
title: Text and Typography
|
title: Text and Typography
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-08 11:33:00 +0800
|
date: 2019-08-08 11:33:00 +0800
|
||||||
categories: [Blogging, Demo]
|
categories: [Blogging, Demo]
|
||||||
tags: [typography]
|
tags: [typography]
|
||||||
math: true
|
math: true
|
||||||
mermaid: true
|
mermaid: true
|
||||||
image:
|
image:
|
||||||
src: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png
|
src: /commons/devices-mockup.png
|
||||||
width: 850
|
width: 800
|
||||||
height: 585
|
height: 500
|
||||||
---
|
---
|
||||||
|
|
||||||
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.
|
||||||
@@ -72,7 +74,6 @@ Sun
|
|||||||
Moon
|
Moon
|
||||||
: the natural satellite of the earth, visible by reflected light from the sun
|
: the natural satellite of the earth, visible by reflected light from the sun
|
||||||
|
|
||||||
|
|
||||||
## Block Quote
|
## Block Quote
|
||||||
|
|
||||||
> This line to shows the Block Quote.
|
> This line to shows the Block Quote.
|
||||||
@@ -89,44 +90,42 @@ Moon
|
|||||||
|
|
||||||
<http://127.0.0.1:4000>
|
<http://127.0.0.1:4000>
|
||||||
|
|
||||||
|
|
||||||
## Footnote
|
## Footnote
|
||||||
|
|
||||||
Click the hook will locate the footnote[^footnote], and here is another footnote[^fn-nth-2].
|
Click the hook will locate the footnote[^footnote], and here is another footnote[^fn-nth-2].
|
||||||
|
|
||||||
|
|
||||||
## Images
|
## Images
|
||||||
|
|
||||||
- Default (with caption)
|
- Default (with caption)
|
||||||
|
|
||||||
{: width="972" height="589" }
|
{: width="972" height="589" }
|
||||||
_Full screen width and center alignment_
|
_Full screen width and center alignment_
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
- Shadow
|
- Shadow
|
||||||
|
|
||||||
{: .shadow width="1548" height="864" style="max-width: 90%" }
|
{: .shadow width="1548" height="864" style="max-width: 90%" }
|
||||||
_shadow effect (visible in light mode)_
|
_shadow effect (visible in light mode)_
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
- Left aligned
|
- Left aligned
|
||||||
|
|
||||||
{: width="972" height="589" style="max-width: 70%" .normal}
|
{: width="972" height="589" style="max-width: 70%" .normal}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
- Float to left
|
- Float to left
|
||||||
|
|
||||||
{: width="972" height="589" style="max-width: 200px" .left}
|
{: width="972" height="589" style="max-width: 200px" .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."
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
- Float to right
|
- Float to right
|
||||||
|
|
||||||
{: width="972" height="589" style="max-width: 200px" .right}
|
{: width="972" height="589" style="max-width: 200px" .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."
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@@ -141,7 +140,6 @@ _shadow effect (visible in light mode)_
|
|||||||
cherry :active, c, after b a, 1d
|
cherry :active, c, after b a, 1d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Mathematics
|
## Mathematics
|
||||||
|
|
||||||
The mathematics powered by [**MathJax**](https://www.mathjax.org/):
|
The mathematics powered by [**MathJax**](https://www.mathjax.org/):
|
||||||
@@ -152,12 +150,10 @@ 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} $$
|
||||||
|
|
||||||
|
|
||||||
## Inline code
|
## Inline code
|
||||||
|
|
||||||
This is an example of `Inline Code`.
|
This is an example of `Inline Code`.
|
||||||
|
|
||||||
|
|
||||||
## Code block
|
## Code block
|
||||||
|
|
||||||
### Common
|
### Common
|
||||||
@@ -176,44 +172,23 @@ SHELL=/usr/local/bin/bash
|
|||||||
PYENV_SHELL=bash
|
PYENV_SHELL=bash
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Ruby
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
def sum_eq_n?(arr, n)
|
|
||||||
return true if arr.empty? && n == 0
|
|
||||||
arr.product(arr).reject { |a,b| a == b }.any? { |a,b| a + b == n }
|
|
||||||
end
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Shell
|
#### Shell
|
||||||
|
|
||||||
```shell
|
```bash
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "The command was not successful.";
|
echo "The command was not successful.";
|
||||||
#do the needful / exit
|
#do the needful / exit
|
||||||
fi;
|
fi;
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Liquid
|
### Specific filename
|
||||||
|
|
||||||
{% raw %}
|
```sass
|
||||||
```liquid
|
@import
|
||||||
{% if product.title contains 'Pack' %}
|
"colors/light-typography",
|
||||||
This product's title contains the word Pack.
|
"colors/dark-typography"
|
||||||
{% endif %}
|
|
||||||
```
|
|
||||||
{% endraw %}
|
|
||||||
|
|
||||||
#### Java
|
|
||||||
|
|
||||||
```java
|
|
||||||
private void writeObject(java.io.ObjectOutputStream s)
|
|
||||||
throws java.io.IOException {
|
|
||||||
// Write out any hidden serialization magic
|
|
||||||
s.defaultWriteObject();
|
|
||||||
for (E e: map.keySet()) s.writeObject(e);
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
{: file='_sass/jekyll-theme-chirpy.scss'}
|
||||||
|
|
||||||
## Reverse Footnote
|
## Reverse Footnote
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
---
|
---
|
||||||
title: Writing a New Post
|
title: Writing a New Post
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-08 14:10:00 +0800
|
date: 2019-08-08 14:10:00 +0800
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [writing]
|
tags: [writing]
|
||||||
|
render_with_liquid: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
This post will guide you how to write a post on _Chirpy_ theme. Even if you have previous experience with Jekyll, this article is worth reading, because many features require specific variables to be set.
|
||||||
|
|
||||||
## Naming and Path
|
## Naming and Path
|
||||||
|
|
||||||
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`.
|
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`. If you want to save time of creating files, please consider using the plugin [`Jekyll-Compose`](https://github.com/jekyll/jekyll-compose) to accomplish this.
|
||||||
|
|
||||||
## Front Matter
|
## Front Matter
|
||||||
|
|
||||||
@@ -23,24 +28,35 @@ tags: [TAG] # TAG names should always be lowercase
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: The posts' ***layout*** has been set to `post` by default, so there is no need to add the variable ***layout*** in Front Matter block.
|
> **Note**: The posts' _layout_ has been set to `post` by default, so there is no need to add the variable _layout_ in the Front Matter block.
|
||||||
|
|
||||||
### Timezone of date
|
### Timezone of Date
|
||||||
|
|
||||||
In order to accurately record the release date of a post, you should not only setup the `timezone` of `_config.yml` but also provide the the post's timezone in field `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
|
In order to accurately record the release date of a post, you should not only set up the `timezone` of `_config.yml` but also provide the post's timezone in variable `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
|
||||||
|
|
||||||
### 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. For instance:
|
The `categories` of each post are designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity. For instance:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
categories: [Animal, Insect]
|
categories: [Animal, Insect]
|
||||||
tags: [bee]
|
tags: [bee]
|
||||||
```
|
```
|
||||||
|
### Author Information
|
||||||
|
|
||||||
|
The author information of the post usually does not need to be filled in the _Front Matter_ , they will be obtained from variables `social.name` and the first entry of `social.links` of the configuration file by default. But you can also override it as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
author:
|
||||||
|
name: Full Name
|
||||||
|
link: https://example.com
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
## 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 a specific post, add the following to the post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
@@ -50,7 +66,7 @@ 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 are 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 a specific post, add the following to the **Front Matter** of the post:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
@@ -72,19 +88,19 @@ math: true
|
|||||||
|
|
||||||
[**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:
|
[**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
|
```yaml
|
||||||
---
|
---
|
||||||
mermaid: true
|
mermaid: true
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
Then you can use it like other markdown language: surround the graph code with ```` ```mermaid ```` and ```` ``` ````.
|
Then you can use it like other markdown languages: surround the graph code with ```` ```mermaid ```` and ```` ``` ````.
|
||||||
|
|
||||||
## Images
|
## Images
|
||||||
|
|
||||||
### Preview image
|
### Preview image
|
||||||
|
|
||||||
If you want to add an image to the top of the post contents, specify the attribute `src`, `width`, `height` and `alt` for the image:
|
If you want to add an image to the top of the post contents, specify the attribute `src`, `width`, `height`, and `alt` for the image:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
@@ -98,6 +114,8 @@ image:
|
|||||||
|
|
||||||
Except for `alt`, all other options are necessary, especially the `width` and `height`, which are related to user experience and web page loading performance. Later section ["Image size"](#image-size) will also mention this.
|
Except for `alt`, all other options are necessary, especially the `width` and `height`, which are related to user experience and web page loading performance. Later section ["Image size"](#image-size) will also mention this.
|
||||||
|
|
||||||
|
Starting from _Chirpy v5.0.0_, the attributes `height` and `width` support abbreviations: `height` → `h`, `width` → `w`.
|
||||||
|
|
||||||
|
|
||||||
### Image caption
|
### Image caption
|
||||||
|
|
||||||
@@ -107,6 +125,7 @@ Add italics to the next line of an image,then it will become the caption and a
|
|||||||

|

|
||||||
_Image Caption_
|
_Image Caption_
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
### Image size
|
### Image size
|
||||||
|
|
||||||
@@ -115,10 +134,18 @@ In order to prevent the page content layout from shifting when the image is load
|
|||||||
```markdown
|
```markdown
|
||||||
{: width="700" height="400" }
|
{: width="700" height="400" }
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
|
Starting from _Chirpy v5.0.0_, `height` and `width` support abbreviations (`height` → `h`, `width` → `w`). The following example has the same effect as the above:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: w="700" h="400" }
|
||||||
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
### Image position
|
### 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:
|
By default, the image is centered, but you can specify the position by using one of the classes `normal`, `left`, and `right`. For example:
|
||||||
|
|
||||||
- **Normal position**
|
- **Normal position**
|
||||||
|
|
||||||
@@ -127,20 +154,23 @@ By default, the image is centered, but you can specify the position by using one
|
|||||||
```markdown
|
```markdown
|
||||||
{: .normal }
|
{: .normal }
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
- **Float to the left**
|
- **Float to the left**
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
{: .left }
|
{: .left }
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
- **Float to the right**
|
- **Float to the right**
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
{: .right }
|
{: .right }
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
> **Limitation**: Once you specify the position of an image, it is forbidden to add the image caption.
|
> **Limitation**: Once the position of the image is specified, the image caption should not be added.
|
||||||
|
|
||||||
### Image shadow
|
### Image shadow
|
||||||
|
|
||||||
@@ -149,28 +179,57 @@ The screenshots of the program window can be considered to show the shadow effec
|
|||||||
```markdown
|
```markdown
|
||||||
{: .shadow }
|
{: .shadow }
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
### CDN URL
|
### 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:
|
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
|
```yaml
|
||||||
img_cdn: https://cdn.com
|
img_cdn: https://cdn.com
|
||||||
```
|
```
|
||||||
|
{: file='_config.yml' .nolineno}
|
||||||
|
|
||||||
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 `/`.
|
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:
|
For instance, when using images:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||

|

|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<img src="https://cdn.com/path/to/flower.png" alt="The flower">
|
<img src="https://cdn.com/path/to/flower.png" alt="The flower">
|
||||||
```
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
|
### Image path
|
||||||
|
|
||||||
|
When a post contains many images, it will be a time-consuming task to repeatedly define the path of the images. To solve this, we can define this path in the YAML block of the post:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
---
|
||||||
|
img_path: /img/path/
|
||||||
|
---
|
||||||
|
```
|
||||||
|
{: .nolineno }
|
||||||
|
|
||||||
|
And then, the image source of Markdown can write the file name directly:
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
{: .nolineno }
|
||||||
|
|
||||||
|
The output will be:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img src="/img/path/flower.png" alt="The flower">
|
||||||
|
```
|
||||||
|
{: .nolineno }
|
||||||
|
|
||||||
## Pinned Posts
|
## Pinned Posts
|
||||||
|
|
||||||
@@ -184,31 +243,51 @@ pin: true
|
|||||||
|
|
||||||
## Code Block
|
## Code Block
|
||||||
|
|
||||||
Markdown symbols ```` ``` ```` can easily create a code block as following examples.
|
Markdown symbols ```` ``` ```` can easily create a code block as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
This is a common code snippet, without syntax highlight and line number.
|
This is a plaintext code snippet.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Specific Language
|
### Specifying Language
|
||||||
|
|
||||||
Using ```` ```language ```` you will get code snippets with line numbers and syntax highlight.
|
Using ```` ```{language} ```` you will get a code block with 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 !
|
|
||||||
|
|
||||||
|
````markdown
|
||||||
```yaml
|
```yaml
|
||||||
# Yaml code snippet
|
key: value
|
||||||
items:
|
|
||||||
- part_no: A4786
|
|
||||||
descrip: Water Bucket (Filled)
|
|
||||||
price: 1.47
|
|
||||||
quantity: 4
|
|
||||||
```
|
```
|
||||||
|
````
|
||||||
|
|
||||||
|
> **Limitation**: The Jekyll style `highlight` tag is not compatible with this theme.
|
||||||
|
|
||||||
|
### Line Number
|
||||||
|
|
||||||
|
By default, all languages except `plaintext`, `console`, and `terminal` will display line numbers. When you want to hide the line number of the code block, you can append `{: .nolineno}` at the next line:
|
||||||
|
|
||||||
|
````markdown
|
||||||
|
```shell
|
||||||
|
echo 'No more line numbers!'
|
||||||
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
````
|
||||||
|
|
||||||
|
### Specifying the Filename
|
||||||
|
|
||||||
|
You may have noticed that the code language will be displayed on the left side of the header of the code block. If you want to replace it with the file name, you can add the attribute `file` to achieve this:
|
||||||
|
|
||||||
|
````markdown
|
||||||
|
```shell
|
||||||
|
# content
|
||||||
|
```
|
||||||
|
{: file="path/to/file" }
|
||||||
|
````
|
||||||
|
|
||||||
### Liquid Codes
|
### Liquid Codes
|
||||||
|
|
||||||
If you want to display the **Liquid** snippet, surround the liquid code with `{% raw %}{%{% endraw %} raw {%raw%}%}{%endraw%}` and `{% raw %}{%{% endraw %} endraw {%raw%}%}{%endraw%}` .
|
If you want to display the **Liquid** snippet, surround the liquid code with `{% raw %}` and `{% endraw %}`:
|
||||||
|
|
||||||
|
````markdown
|
||||||
{% raw %}
|
{% raw %}
|
||||||
```liquid
|
```liquid
|
||||||
{% if product.title contains 'Pack' %}
|
{% if product.title contains 'Pack' %}
|
||||||
@@ -216,8 +295,10 @@ If you want to display the **Liquid** snippet, surround the liquid code with `{%
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
````
|
||||||
|
|
||||||
|
Or adding `render_with_liquid: false` (Requires Jekyll 4.0 or higher) to the post's YAML block.
|
||||||
|
|
||||||
## Learn More
|
## Learn More
|
||||||
|
|
||||||
For more knowledge about Jekyll posts, visit the [Jekyll Docs: Posts](https://jekyllrb.com/docs/posts/).
|
For more knowledge about Jekyll posts, visit the [Jekyll Docs: Posts](https://jekyllrb.com/docs/posts/).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Getting Started
|
title: Getting Started
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-09 20:55:00 +0800
|
date: 2019-08-09 20:55:00 +0800
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [getting started]
|
tags: [getting started]
|
||||||
@@ -9,58 +11,24 @@ pin: true
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`. Please note that the version of `Ruby` must meet the requirements of the theme on [RubyGems.org](https://rubygems.org/gems/jekyll-theme-chirpy).
|
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
There are two ways to get the theme:
|
### Creating a New Site
|
||||||
|
|
||||||
- **[Install from RubyGems](#install-from-rubygems)** - Easy to update, isolate irrelevant project files so you can focus on writing.
|
There are two ways to create a new repository for this theme:
|
||||||
- **[Fork on GitHub](#fork-on-github)** - Convenient for custom development, but difficult to update, only suitable for web developers.
|
|
||||||
|
|
||||||
### Install from RubyGems
|
- [**Using the Chirpy Starter**](#option-1-using-the-chirpy-starter) - Easy to upgrade, isolates irrelevant project files so you can focus on writing.
|
||||||
|
- [**Forking on GitHub**](#option-2-forking-on-github) - Convenient for custom development, but difficult to upgrade. Unless you are familiar with Jekyll and are determined to tweak or contribute to this project, this approach is not recommended.
|
||||||
|
|
||||||
Add this line to your Jekyll site's `Gemfile`:
|
#### Option 1. Using the Chirpy Starter
|
||||||
|
|
||||||
```ruby
|
Create a new repository from the [**Chirpy Starter**][use-starter] and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
|
||||||
gem "jekyll-theme-chirpy"
|
|
||||||
```
|
|
||||||
|
|
||||||
And add this line to your Jekyll site's `_config.yml`:
|
#### Option 2. Forking on GitHub
|
||||||
|
|
||||||
```yaml
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and rename it to `<GH_USERNAME>.github.io`. Please note that the default branch code is in development. If you want the site to be stable, please switch to the [latest tag][latest-tag] and start writing.
|
||||||
theme: jekyll-theme-chirpy
|
|
||||||
```
|
|
||||||
|
|
||||||
And then execute:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bundle
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, go to the installed local theme path:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ cd "$(bundle info --path jekyll-theme-chirpy)"
|
|
||||||
```
|
|
||||||
|
|
||||||
And then copy the critical files (for details, see [starter project][starter]) from the theme's gem to your Jekyll site.
|
|
||||||
|
|
||||||
> ⚠️ **Watch out for duplicate files!**
|
|
||||||
>
|
|
||||||
> If your Jekyll site is created by the `jekyll new` command, there will be `index.markdown` and `about.markdown` in the root directory of your site. Please be sure to remove them, otherwise they will overwrite the `index.html` and `_tabs/about.html` from this project, resulting in blank or messy pages.
|
|
||||||
|
|
||||||
As an alternative, which we recommend, you can create a Jekyll site [**using the starter template**][use-starter] to save time copying files from the theme's gem. We've prepared everything you need there!
|
|
||||||
|
|
||||||
### 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:
|
And then execute:
|
||||||
|
|
||||||
@@ -68,18 +36,28 @@ And then execute:
|
|||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> **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.
|
> **Note**: If you don't want to deploy your site on GitHub Pages, append option `--no-gh` at the end of the above command.
|
||||||
|
|
||||||
What it does is:
|
The above command will:
|
||||||
|
|
||||||
1. Remove some files or directories from your repository:
|
1. Removes 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 the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise, set up the GitHub Action workflow by removing the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Removes item `Gemfile.lock` from `.gitignore`.
|
||||||
|
|
||||||
|
4. Creates a new commit to save the changes automatically.
|
||||||
|
|
||||||
|
### Installing Dependencies
|
||||||
|
|
||||||
|
Before running for the first time, go to the root directory of your site, and install dependencies as follows:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -94,9 +72,9 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
|
|||||||
|
|
||||||
### Customing Stylesheet
|
### Customing Stylesheet
|
||||||
|
|
||||||
If you need to customize stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
||||||
|
|
||||||
Starting from `v4.1.0`, if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
Starting from [`v4.1.0`][chirpy-4.1.0], if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
||||||
|
|
||||||
### Running Local Server
|
### Running Local Server
|
||||||
|
|
||||||
@@ -108,55 +86,62 @@ $ bundle exec jekyll s
|
|||||||
|
|
||||||
Or run the site on Docker with the following command:
|
Or run the site on Docker with the following command:
|
||||||
|
|
||||||
```terminal
|
```console
|
||||||
$ docker run -it --rm \
|
$ docker run -it --rm \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
-p 4000:4000 jekyll/jekyll \
|
-p 4000:4000 jekyll/jekyll \
|
||||||
jekyll serve
|
jekyll serve
|
||||||
```
|
```
|
||||||
|
|
||||||
Open a browser and visit to _<http://localhost:4000>_.
|
After a while, the local service will be published at _<http://127.0.0.1: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, e.g, `/project-name`.
|
Before the deployment begins, check out 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 starts with a slash, e.g, `/project-name`.
|
||||||
|
|
||||||
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||||
|
|
||||||
#### Deploy on GitHub Pages
|
#### Deploy by Using Github Actions
|
||||||
|
|
||||||
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.
|
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 GitHub Pages service.
|
||||||
|
|
||||||
Quickly check the files needed for GitHub Actions build:
|
Quickly check the files needed for GitHub Actions build:
|
||||||
|
|
||||||
- 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 the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [sample 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 repository to `<GH-USERNAME>.github.io` on GitHub.
|
- Ensure your Jekyll site has file `tools/deploy.sh`. Otherwise, copy it from here to your Jekyll site.
|
||||||
|
|
||||||
|
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lock file:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle lock --add-platform x86_64-linux
|
||||||
|
```
|
||||||
|
|
||||||
|
After the above steps, rename your repository to `<GH_USERNAME>.github.io` on GitHub.
|
||||||
|
|
||||||
Now publish your Jekyll site by:
|
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.
|
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) through _Settings_ → _Options_ → _GitHub Pages_:
|
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
||||||
|
|
||||||
{: width="850" height="153" }
|
{: width="1580" height="250" }
|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
#### Deploy on Other Platforms
|
#### Manually Build and Deploy
|
||||||
|
|
||||||
On platforms other than GitHub, we cannot enjoy the convenience of **GitHub Actions**. Therefore, we should build the site locally (or on some other 3rd-party CI platform) and then put the site files on the server.
|
On self-hosted servers, you cannot enjoy the convenience of **GitHub Actions**. Therefore, you should build the site on your local machine and then upload the site files to the server.
|
||||||
|
|
||||||
Go to the root of the source project, build your site by:
|
Go to the root of the source project, and build your site as follows:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ JEKYLL_ENV=production bundle exec jekyll b
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
Or build the site with Docker by:
|
Or build the site on Docker:
|
||||||
|
|
||||||
```terminal
|
```console
|
||||||
$ docker run -it --rm \
|
$ docker run -it --rm \
|
||||||
--env JEKYLL_ENV=production \
|
--env JEKYLL_ENV=production \
|
||||||
--volume="$PWD:/srv/jekyll" \
|
--volume="$PWD:/srv/jekyll" \
|
||||||
@@ -164,8 +149,34 @@ $ docker run -it --rm \
|
|||||||
jekyll build
|
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 the target server.
|
||||||
|
|
||||||
|
### Upgrading
|
||||||
|
|
||||||
|
It depends on how you use the theme:
|
||||||
|
|
||||||
|
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the theme gem, for example:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
|
||||||
|
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
|
||||||
|
```
|
||||||
|
{: .nolineno file="Gemfile" }
|
||||||
|
|
||||||
|
And then execute the following command:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle update jekyll-theme-chirpy
|
||||||
|
```
|
||||||
|
|
||||||
|
As the version upgrades, the critical files (for details, see the [Startup Template][starter]) and configuration options will change. Please refer to the [Upgrade Guide](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide) to keep your repo's files in sync with the latest version of the theme.
|
||||||
|
|
||||||
|
- If you forked from the source project (there will be `gemspec` in the `Gemfile` of your site), then merge the [latest upstream tags][latest-tag] into your Jekyll site to complete the upgrade.
|
||||||
|
The merge is likely to conflict with your local modifications. Please be patient and careful to resolve these conflicts.
|
||||||
|
|
||||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
[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
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
|
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
||||||
|
[pages-src]: https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
|
||||||
|
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
---
|
---
|
||||||
title: Customize the Favicon
|
title: Customize the Favicon
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-11 00:34:00 +0800
|
date: 2019-08-11 00:34:00 +0800
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [favicon]
|
tags: [favicon]
|
||||||
---
|
---
|
||||||
|
|
||||||
The [favicons](https://www.favicon-generator.org/about/) of [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) are placed in the directory `assets/img/favicons/`. You may need to replace them with your own. The following sections will guide you how to create and replace the default favicons.
|
The [favicons](https://www.favicon-generator.org/about/) of [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) are placed in the directory `assets/img/favicons/`. You may want to replace them with your own. The following sections will guide you to create and replace the default favicons.
|
||||||
|
|
||||||
## Generate the favicon
|
## Generate the favicon
|
||||||
|
|
||||||
Prepare a square image (PNG, JPG, or SVG) with a size of 512x512 or more, and then go to the online tool [**Real Favicon Generator**](https://realfavicongenerator.net/) and click button <kbd>Select your Favicon image</kbd> to upload your image file.
|
Prepare a square image (PNG, JPG, or SVG) with a size of 512x512 or more, and then go to the online tool [**Real Favicon Generator**](https://realfavicongenerator.net/) and click the button <kbd>Select your Favicon image</kbd> to upload your image file.
|
||||||
|
|
||||||
In the next step, the webpage will show all usage scenarios. You can keep the default options, scroll to the bottom of the page, and click the button <kbd>Generate your Favicons and HTML code</kbd> to generate the favicon.
|
In the next step, the webpage will show all usage scenarios. You can keep the default options, scroll to the bottom of the page, and click the button <kbd>Generate your Favicons and HTML code</kbd> to generate the favicon.
|
||||||
|
|
||||||
@@ -21,16 +23,14 @@ Download the generated package, unzip and delete the following two from the extr
|
|||||||
- `browserconfig.xml`
|
- `browserconfig.xml`
|
||||||
- `site.webmanifest`
|
- `site.webmanifest`
|
||||||
|
|
||||||
Now, copy the remaining image files (`PNG` and `ICO`) to cover the original files in the folder `assets/img/favicons/` of your Jekyll site.
|
And then copy the remaining image files (`PNG` and `ICO`) to cover the original files in the directory `assets/img/favicons/` of your Jekyll site. If your Jekyll site doesn't have this directory yet, just create one.
|
||||||
|
|
||||||
The following table will helps you understand the changes to the favicon files:
|
The following table will help you understand the changes to the favicon files:
|
||||||
|
|
||||||
| File(s) | From Online Tool | From Chirpy |
|
| File(s) | From Online Tool | From Chirpy |
|
||||||
|---------------------|:---------------------------------:|:-----------:|
|
|---------------------|:---------------------------------:|:-----------:|
|
||||||
| `*.PNG` | ✓ | ✗ |
|
| `*.PNG` | ✓ | ✗ |
|
||||||
| `*.ICO` | ✓ | ✗ |
|
| `*.ICO` | ✓ | ✗ |
|
||||||
| `browserconfig.xml` | ✗ | ✓ |
|
|
||||||
| `site.webmanifest` | ✗ | ✓ |
|
|
||||||
|
|
||||||
> Note: ✓ means keep, ✗ means delete.
|
> Note: ✓ means keep, ✗ means delete.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Enable Google Page Views
|
title: Enable Google Page Views
|
||||||
author: Dinesh Prasanth Moluguwan Krishnamoorthy
|
author:
|
||||||
|
name: Dinesh Prasanth Moluguwan Krishnamoorthy
|
||||||
|
link: https://github.com/SilleBille
|
||||||
date: 2021-01-03 18:32:00 -0500
|
date: 2021-01-03 18:32:00 -0500
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [google analytics, pageviews]
|
tags: [google analytics, pageviews]
|
||||||
@@ -13,27 +15,27 @@ This post is to enable Page Views on the [**Chirpy**][chirpy-homepage] theme bas
|
|||||||
|
|
||||||
### Create GA account and property
|
### 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.
|
First, you need to set up your account on Google analytics. While you create your account, you must create your first **Property** as well.
|
||||||
|
|
||||||
1. Head to <https://analytics.google.com/> and click on **Start Measuring**
|
1. Head to <https://analytics.google.com/> and click on **Start Measuring**
|
||||||
2. Enter your desired _Account Name_ and choose the desired checkboxes
|
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
|
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_
|
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
|
5. Hit _Create_ and accept any license popup to set up your Google Analytics account and create your property
|
||||||
|
|
||||||
### Create Data Stream
|
### 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:
|
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 create your first **Data Stream**. If not, follow these steps:
|
||||||
|
|
||||||
1. Go to **Admin** on the left column
|
1. Go to **Admin** on the left column
|
||||||
2. Select the desired property from the drop down on the second column
|
2. Select the desired property from the drop-down on the second column
|
||||||
3. Click on **Data Streams**
|
3. Click on **Data Streams**
|
||||||
4. Add a stream and click on **Web**
|
4. Add a stream and click on **Web**
|
||||||
5. Enter your blog's URL
|
5. Enter your blog's URL
|
||||||
|
|
||||||
It should look like this:
|
It should look like this:
|
||||||
|
|
||||||
{: width="1086" height="542"}
|
{: width="1086" height="542"}
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
@@ -45,14 +47,15 @@ google_analytics:
|
|||||||
proxy_endpoint: # fill in the Google Analytics superProxy endpoint of Google App Engine
|
proxy_endpoint: # fill in the Google Analytics superProxy endpoint of Google App Engine
|
||||||
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
||||||
```
|
```
|
||||||
|
{: file="_config.yml"}
|
||||||
|
|
||||||
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.
|
When you push these changes to your blog, you should start seeing the traffic on your Google Analytics. Play around with the Google Analytics dashboard to get familiar with the options available as it takes like 5 mins to pick up your changes. You should now be able to monitor your traffic in real time.
|
||||||
|
|
||||||
{: width="616" height="557"}
|
{: width="616" height="557"}
|
||||||
|
|
||||||
## Setup Page Views
|
## 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.
|
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 the Git bash terminal to run Unix-like commands.
|
||||||
|
|
||||||
### Setup Google App Engine
|
### Setup Google App Engine
|
||||||
|
|
||||||
@@ -66,7 +69,7 @@ There is a detailed [tutorial](https://developers.google.com/analytics/solutions
|
|||||||
|
|
||||||
5. Select **Python** language and **Standard** environment
|
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.
|
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, the 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
|
7. Go to your App Engine dashboard on your browser and select **API & Services** from the left navigation menu
|
||||||
|
|
||||||
@@ -76,7 +79,7 @@ There is a detailed [tutorial](https://developers.google.com/analytics/solutions
|
|||||||
|
|
||||||
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_
|
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`
|
11. Click on **Credentials** on the left and create a new **OAuth Client IDs** credential. Make sure to add an 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.
|
12. Note down the **Your Client ID** and **Your Client Secret**. You'll need this in the next section.
|
||||||
|
|
||||||
@@ -113,12 +116,13 @@ There is a detailed [tutorial](https://developers.google.com/analytics/solutions
|
|||||||
1. Clone the **Google Analytics superProxy** project on Github: <https://github.com/googleanalytics/google-analytics-super-proxy> to your local.
|
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:
|
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
|
```diff
|
||||||
- application: your-project-id
|
- application: your-project-id
|
||||||
- version: 1
|
- version: 1
|
||||||
```
|
```
|
||||||
|
|
||||||
3. In `src/config.py`, add the `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` that you gathered from you App Engine Dashboard.
|
3. In `src/config.py`, add the `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` that you gathered from your App Engine Dashboard.
|
||||||
|
|
||||||
4. Enter any random key for `XSRF_KEY`, your `config.py` should look similar to this
|
4. Enter any random key for `XSRF_KEY`, your `config.py` should look similar to this
|
||||||
|
|
||||||
@@ -140,6 +144,7 @@ There is a detailed [tutorial](https://developers.google.com/analytics/solutions
|
|||||||
# XSRF Settings
|
# XSRF Settings
|
||||||
XSRF_KEY = 'OnceUponATimeThereLivedALegend'
|
XSRF_KEY = 'OnceUponATimeThereLivedALegend'
|
||||||
```
|
```
|
||||||
|
{: file="src/config.py"}
|
||||||
|
|
||||||
**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.
|
**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.
|
||||||
|
|
||||||
@@ -183,7 +188,7 @@ There is a detailed [tutorial](https://developers.google.com/analytics/solutions
|
|||||||
|
|
||||||
If everything went good, you'll get this screen:
|
If everything went good, you'll get this screen:
|
||||||
|
|
||||||
{: width="1366" height="354"}
|
{: width="1366" height="354"}
|
||||||
|
|
||||||
### Create Google Analytics Query
|
### Create Google Analytics Query
|
||||||
|
|
||||||
@@ -204,18 +209,17 @@ In order to reduce the returned results and reduce the network bandwidth, we add
|
|||||||
|
|
||||||
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`.
|
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 <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.
|
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.
|
||||||
|
|
||||||
{: width="1100" height="126"}
|
{: width="1100" height="126"}
|
||||||
|
|
||||||
|
|
||||||
## Configure Chirpy to Display Page View
|
## 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.
|
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.
|
||||||
|
|
||||||
{: width="1210" height="694"}
|
{: width="1210" height="694"}
|
||||||
|
|
||||||
Update the `_config.yml` file of [**Chirpy**][chirpy-homepage] project with the values from your dashboard, to look similar to the following:
|
Update the `_config.yml` file of [**Chirpy**][chirpy-homepage] project with the values from your dashboard, to look similar to the following:
|
||||||
|
|
||||||
@@ -226,6 +230,7 @@ google_analytics:
|
|||||||
proxy_endpoint: 'https://PROJECT_ID.REGION_ID.r.appspot.com/query?id=<ID FROM SUPER PROXY>'
|
proxy_endpoint: 'https://PROJECT_ID.REGION_ID.r.appspot.com/query?id=<ID FROM SUPER PROXY>'
|
||||||
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
||||||
```
|
```
|
||||||
|
{: file="_config.yml"}
|
||||||
|
|
||||||
Now, you should see the Page View enabled on your blog.
|
Now, you should see the Page View enabled on your blog.
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,9 @@
|
|||||||
@mixin mode-toggle($dark-mode: false) {
|
@mixin mode-toggle($dark-mode: false) {
|
||||||
@if $dark-mode {
|
@if $dark-mode {
|
||||||
@include dark-scheme;
|
@include dark-scheme;
|
||||||
|
|
||||||
.mode-toggle {
|
|
||||||
transform: rotateY(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
} @else {
|
} @else {
|
||||||
@include light-scheme;
|
@include light-scheme;
|
||||||
|
|
||||||
.mode-toggle {
|
|
||||||
transform: none;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html:not([mode]),
|
html:not([mode]),
|
||||||
@@ -58,15 +48,15 @@ body {
|
|||||||
h1 {
|
h1 {
|
||||||
@extend %heading;
|
@extend %heading;
|
||||||
|
|
||||||
font-size: 1.8rem;
|
font-size: 1.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
@extend %heading;
|
@extend %heading;
|
||||||
@extend %section;
|
@extend %section;
|
||||||
@extend %anchor;
|
@extend %anchor-relative;
|
||||||
|
|
||||||
font-size: 1.4rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -74,7 +64,7 @@ h3 {
|
|||||||
@extend %section;
|
@extend %section;
|
||||||
@extend %anchor;
|
@extend %anchor;
|
||||||
|
|
||||||
font-size: 1.25rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
@@ -117,7 +107,19 @@ blockquote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kbd {
|
kbd {
|
||||||
|
font-family: inherit;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
line-height: 1.3rem;
|
||||||
|
min-width: 1.75rem;
|
||||||
|
text-align: center;
|
||||||
margin: 0 0.3rem;
|
margin: 0 0.3rem;
|
||||||
|
padding-top: 0.1rem;
|
||||||
|
color: var(--kbd-text-color);
|
||||||
|
background-color: var(--kbd-bg-color);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
border: solid 1px var(--kbd-wrap-color);
|
||||||
|
box-shadow: inset 0 -2px 0 var(--kbd-wrap-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
@@ -126,8 +128,6 @@ footer {
|
|||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
height: $footer-height;
|
height: $footer-height;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: #7a7b7d;
|
|
||||||
background-color: var(--footer-bg-color);
|
|
||||||
|
|
||||||
> div.d-flex {
|
> div.d-flex {
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
@@ -142,21 +142,58 @@ footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--footer-link);
|
@extend %text-color;
|
||||||
|
|
||||||
&:link {
|
&:link {
|
||||||
@include no-text-decoration;
|
@include no-text-decoration;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
|
|
||||||
@include no-text-decoration;
|
@include no-text-decoration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-right {
|
.footer-right {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i { // fontawesome icons
|
||||||
|
&.far,
|
||||||
|
&.fas {
|
||||||
|
@extend %no-cursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fade-in {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
img[data-src] {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
|
||||||
|
&[data-loaded=true] {
|
||||||
|
animation: fade-in linear 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
float: left;
|
||||||
|
margin: 0.75rem 1rem 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.right {
|
||||||
|
float: right;
|
||||||
|
margin: 0.75rem 0 1rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.shadow {
|
||||||
|
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* --- Panels --- */
|
/* --- Panels --- */
|
||||||
|
|
||||||
.access {
|
.access {
|
||||||
@@ -170,27 +207,26 @@ footer {
|
|||||||
position: -webkit-sticky; /* Safari */
|
position: -webkit-sticky; /* Safari */
|
||||||
position: sticky;
|
position: sticky;
|
||||||
}
|
}
|
||||||
&.topbar-down {
|
|
||||||
top: 6rem;
|
|
||||||
}
|
|
||||||
> div {
|
> div {
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
border-left: 1px solid var(--main-border-color);
|
border-left: 1px solid var(--main-border-color);
|
||||||
|
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-bottom: 4rem;
|
margin-bottom: 4rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
span {
|
|
||||||
@include panel-label;
|
|
||||||
}
|
|
||||||
.post-content {
|
.post-content {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-tags {
|
#panel-wrapper {
|
||||||
> div.post-content > div {
|
// the headings
|
||||||
max-width: 80%;
|
.panel-heading {
|
||||||
|
@include label(inherit);
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tag {
|
.post-tag {
|
||||||
@@ -202,6 +238,7 @@ footer {
|
|||||||
border-radius: 0.8rem;
|
border-radius: 0.8rem;
|
||||||
padding: 0.3rem 0.5rem;
|
padding: 0.3rem 0.5rem;
|
||||||
margin: 0 0.35rem 0.5rem 0;
|
margin: 0 0.35rem 0.5rem 0;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #2a408e;
|
background-color: #2a408e;
|
||||||
border-color: #2a408e;
|
border-color: #2a408e;
|
||||||
@@ -209,10 +246,13 @@ footer {
|
|||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.topbar-down > div {
|
||||||
|
top: 6rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-lastmod {
|
#access-lastmod {
|
||||||
|
|
||||||
li {
|
li {
|
||||||
height: 1.8rem;
|
height: 1.8rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -238,21 +278,24 @@ footer {
|
|||||||
.footnotes > ol {
|
.footnotes > ol {
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
|
|
||||||
> li {
|
> li {
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-bottom: 0.3rem;
|
margin-bottom: 0.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
> p {
|
> p {
|
||||||
margin-left: 0.25em;
|
margin-left: 0.25em;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// [scroll-focus] added by `smooth-scroll.js`
|
// [scroll-focus] added by `smooth-scroll.js`
|
||||||
&:target:not([scroll-focus]),
|
&:target:not([scroll-focus]),
|
||||||
&[scroll-focus=true] > p {
|
&[scroll-focus=true] > p {
|
||||||
background-color: var(--footnote-target-bg);
|
background-color: var(--footnote-target-bg);
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
-webkit-transition: background-color 1.5s ease-in-out; // Safari prior 6.1
|
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
||||||
transition: background-color 1.5s ease-in-out;
|
transition: background-color 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -264,7 +307,7 @@ footer {
|
|||||||
@include pl-pr(2px);
|
@include pl-pr(2px);
|
||||||
|
|
||||||
border-bottom-style: none !important;
|
border-bottom-style: none !important;
|
||||||
-webkit-transition: background-color 1.5s ease-in-out; // Safari prior 6.1
|
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
||||||
transition: background-color 1.5s ease-in-out;
|
transition: background-color 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,32 +321,18 @@ footer {
|
|||||||
.reversefootnote {
|
.reversefootnote {
|
||||||
@at-root a#{&} {
|
@at-root a#{&} {
|
||||||
font-size: 0.6rem;
|
font-size: 0.6rem;
|
||||||
position: absolute;
|
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
padding-top: 0.5em;
|
position: relative;
|
||||||
margin-left: 0.5em;
|
bottom: 0.25em;
|
||||||
|
margin-left: 0.25em;
|
||||||
border-bottom-style: none !important;
|
border-bottom-style: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post {
|
|
||||||
h1 {
|
|
||||||
margin-top: 3rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
em { /* MarkDown italic */
|
|
||||||
padding-right: 0.2rem;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
code {
|
|
||||||
@extend %link-hover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Begin of Markdown table style --- */
|
/* --- Begin of Markdown table style --- */
|
||||||
|
|
||||||
.table-wrapper { // it will be created by Liquid
|
// it will be created by Liquid
|
||||||
|
.table-wrapper {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
|
|
||||||
@@ -314,6 +343,7 @@ footer {
|
|||||||
|
|
||||||
thead {
|
thead {
|
||||||
border-bottom: solid 2px rgba(210, 215, 217, 0.75);
|
border-bottom: solid 2px rgba(210, 215, 217, 0.75);
|
||||||
|
|
||||||
th {
|
th {
|
||||||
@extend %table-cell;
|
@extend %table-cell;
|
||||||
}
|
}
|
||||||
@@ -322,22 +352,54 @@ footer {
|
|||||||
tbody {
|
tbody {
|
||||||
tr {
|
tr {
|
||||||
border-bottom: 1px solid var(--tb-border-color);
|
border-bottom: 1px solid var(--tb-border-color);
|
||||||
|
|
||||||
&:nth-child(2n) {
|
&:nth-child(2n) {
|
||||||
background-color: var(--tb-even-bg);
|
background-color: var(--tb-even-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-child(2n + 1) {
|
&:nth-child(2n + 1) {
|
||||||
background-color: var(--tb-odd-bg);
|
background-color: var(--tb-odd-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
@extend %table-cell;
|
@extend %table-cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // tbody
|
||||||
}
|
}// table
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- post --- */
|
/* --- post --- */
|
||||||
|
|
||||||
|
.post {
|
||||||
|
h1 {
|
||||||
|
margin-top: 3rem;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
&.img-link {
|
||||||
|
@extend %no-cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
// created by `_includes/img-extra.html`
|
||||||
|
&.popup {
|
||||||
|
cursor: zoom-in;
|
||||||
|
|
||||||
|
> img[data-src]:not(.normal):not(.left):not(.right) {
|
||||||
|
@include align-center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
code {
|
||||||
|
@extend %link-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // a
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.pageviews .fa-spinner {
|
.pageviews .fa-spinner {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
@@ -345,16 +407,20 @@ footer {
|
|||||||
.post-meta {
|
.post-meta {
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
word-spacing: 1px;
|
word-spacing: 1px;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@extend %link-color;
|
|
||||||
@extend %link-underline;
|
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %normal-font-style;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
@@ -364,8 +430,16 @@ footer {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|
||||||
@mixin caption {
|
a {
|
||||||
+ em {
|
&:not(.img-link) {
|
||||||
|
@extend %link-underline;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
@extend %link-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.img-link + em {
|
||||||
display: block;
|
display: block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@@ -373,65 +447,9 @@ footer {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
color: #6d6c6c;
|
color: #6d6c6c;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fade-in {
|
|
||||||
from { opacity: 0; }
|
|
||||||
to { opacity: 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
img[data-src] {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
|
|
||||||
&[data-loaded=true] {
|
|
||||||
animation: fade-in linear .5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.left {
|
|
||||||
float: left;
|
|
||||||
margin: 0.75rem 1rem 1rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
|
||||||
float: right;
|
|
||||||
margin: 0.75rem 0 1rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.shadow {
|
|
||||||
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include caption;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
|
||||||
blockquote & {
|
|
||||||
color: var(--link-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(.img-link) {
|
|
||||||
@extend %link-color;
|
|
||||||
@extend %link-underline;
|
|
||||||
&:hover {
|
|
||||||
@extend %link-hover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.popup { // created by `_includes/img-extra.html`
|
|
||||||
cursor: zoom-in;
|
|
||||||
|
|
||||||
> img[data-src]:not(.normal):not(.left):not(.right) {
|
|
||||||
@include align-center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.img-link {
|
|
||||||
@include caption;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // a
|
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
// attribute 'hide-bullet' was added by liquid
|
// attribute 'hide-bullet' was added by liquid
|
||||||
.task-list-item[hide-bullet] {
|
.task-list-item[hide-bullet] {
|
||||||
@@ -441,6 +459,7 @@ footer {
|
|||||||
margin: 0 0.4rem 0.2rem -1.4rem;
|
margin: 0 0.4rem 0.2rem -1.4rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
color: var(--checkbox-color);
|
color: var(--checkbox-color);
|
||||||
|
|
||||||
&.checked {
|
&.checked {
|
||||||
color: var(--checkbox-checked-color);
|
color: var(--checkbox-checked-color);
|
||||||
}
|
}
|
||||||
@@ -460,10 +479,6 @@ footer {
|
|||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
+ li {
|
|
||||||
margin-top: 0.3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol,
|
ol,
|
||||||
ul { // sub list
|
ul { // sub list
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
@@ -518,6 +533,7 @@ footer {
|
|||||||
padding: 1px 3px;
|
padding: 1px 3px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
@@ -525,10 +541,6 @@ footer {
|
|||||||
|
|
||||||
/* --- Effects classes --- */
|
/* --- Effects classes --- */
|
||||||
|
|
||||||
.semi-bold {
|
|
||||||
font-weight: 600 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loaded {
|
.loaded {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
|
|
||||||
@@ -629,31 +641,31 @@ $sidebar-display: "sidebar-display";
|
|||||||
scrollbar-width: none; /* Firefox */
|
scrollbar-width: none; /* Firefox */
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@include sidebar-links;
|
@extend %sidebar-links;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@include no-text-decoration;
|
@include no-text-decoration;
|
||||||
|
|
||||||
color: #fff;
|
color: var(--sidebar-active-color) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#avatar {
|
#avatar {
|
||||||
&:hover > a {
|
|
||||||
border-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
> a {
|
> a {
|
||||||
display: block;
|
display: block;
|
||||||
width: 6rem;
|
width: 6rem;
|
||||||
height: 6rem;
|
height: 6rem;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2px solid #b6b6b6;
|
border: 2px solid rgba(222, 222, 222, 0.7);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transform: translateZ(0); // fixed the zoom in Safari
|
transform: translateZ(0); // fixed the zoom in Safari
|
||||||
-webkit-transition: border-color 0.35s ease-in-out;
|
-webkit-transition: border-color 0.35s ease-in-out;
|
||||||
-moz-transition: border-color 0.35s ease-in-out;
|
-moz-transition: border-color 0.35s ease-in-out;
|
||||||
transition: border-color 0.35s ease-in-out;
|
transition: border-color 0.35s ease-in-out;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
@@ -674,15 +686,18 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
.site-title {
|
.site-title {
|
||||||
a {
|
a {
|
||||||
|
@extend %clickable-transition;
|
||||||
|
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
|
color: rgba(134, 133, 133, 99%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-subtitle {
|
.site-subtitle {
|
||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
color: #828282;
|
color: var(--sidebar-muted-color);
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
word-spacing: 1px;
|
word-spacing: 1px;
|
||||||
margin: 0.5rem 1.5rem 0.5rem 1.5rem;
|
margin: 0.5rem 1.5rem 0.5rem 1.5rem;
|
||||||
@@ -703,16 +718,16 @@ $sidebar-display: "sidebar-display";
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
display: table;
|
display: table;
|
||||||
height: $tab-height;
|
height: $tab-height;
|
||||||
&:hover {
|
|
||||||
.nav-link {
|
|
||||||
color: #f8f9facf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.active {
|
&.active {
|
||||||
.nav-link {
|
.nav-link {
|
||||||
color: #fcfcfc;
|
color: var(--sidebar-active-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not(.active) > a {
|
||||||
|
@extend %clickable-transition;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
@@ -724,7 +739,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
|
|
||||||
a {
|
a {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: $cursor-width / 2;
|
left: $cursor-width / 2;
|
||||||
@@ -774,7 +788,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
} // ul
|
} // ul
|
||||||
|
|
||||||
.sidebar-bottom {
|
.sidebar-bottom {
|
||||||
font-size: 1.2rem;
|
|
||||||
margin-bottom: 2.1rem;
|
margin-bottom: 2.1rem;
|
||||||
|
|
||||||
@include ml-mr(auto);
|
@include ml-mr(auto);
|
||||||
@@ -787,36 +800,40 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
@extend %icon;
|
@extend %icon;
|
||||||
|
@extend %clickable-transition;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mode-toggle-wrapper {
|
|
||||||
@extend %icon;
|
|
||||||
|
|
||||||
i {
|
i {
|
||||||
@include sidebar-links;
|
font-size: 1.2rem;
|
||||||
|
line-height: 1.75rem;
|
||||||
margin: 0;
|
|
||||||
font-size: 1.05rem;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
bottom: 1px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mode-toggle {
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
margin-bottom: 1px;
|
||||||
|
background-color: transparent;
|
||||||
|
|
||||||
|
@extend %icon;
|
||||||
|
@extend %sidebar-links;
|
||||||
|
|
||||||
|
> i {
|
||||||
|
@extend %clickable-transition;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover > i {
|
||||||
|
color: var(--sidebar-active-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-border {
|
.icon-border {
|
||||||
background-color: #525354;
|
@extend %no-cursor;
|
||||||
|
|
||||||
|
background-color: var(--sidebar-muted-color);
|
||||||
content: "";
|
content: "";
|
||||||
width: 3px;
|
width: 3px;
|
||||||
height: 3px;
|
height: 3px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
position: relative;
|
|
||||||
top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover,
|
|
||||||
#mode-toggle-wrapper i:hover {
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .sidebar-bottom
|
} // .sidebar-bottom
|
||||||
@@ -841,6 +858,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
display: none;
|
display: none;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
}
|
}
|
||||||
@@ -857,7 +875,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
|
||||||
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.05);
|
|
||||||
background-color: var(--topbar-wrapper-bg);
|
background-color: var(--topbar-wrapper-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,15 +912,19 @@ $sidebar-display: "sidebar-display";
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 85%;
|
width: 85%;
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
border: 1px solid var(--search-wrapper-bg);
|
border: 1px solid var(--search-wrapper-border-color);
|
||||||
background: var(--search-wrapper-bg);
|
background: var(--search-wrapper-bg);
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
color: var(--search-icon-color);
|
color: var(--search-icon-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.fa-times-circle { /* button 'clean up' */
|
.fa-times-circle { /* button 'clean up' */
|
||||||
|
@extend %cursor-pointer;
|
||||||
|
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -912,6 +933,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
@extend %cursor-pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-input {
|
#search-input {
|
||||||
@@ -924,6 +947,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
&:focus {
|
&:focus {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background: center;
|
background: center;
|
||||||
|
|
||||||
&.form-control {
|
&.form-control {
|
||||||
&::-webkit-input-placeholder { @include input-placeholder; }
|
&::-webkit-input-placeholder { @include input-placeholder; }
|
||||||
&::-moz-placeholder { @include input-placeholder; }
|
&::-moz-placeholder { @include input-placeholder; }
|
||||||
@@ -934,7 +958,11 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#search-hints {
|
#search-hints {
|
||||||
display: none;
|
padding: 0 1rem;
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.post-tag {
|
.post-tag {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -943,17 +971,21 @@ $sidebar-display: "sidebar-display";
|
|||||||
background: var(--search-tag-bg);
|
background: var(--search-tag-bg);
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
margin: 0 1rem 1rem 0;
|
margin: 0 1.25rem 1rem 0;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "#";
|
content: "#";
|
||||||
color: var(--text-muted-color);
|
color: var(--text-muted-color);
|
||||||
padding-right: 0.2rem;
|
padding-right: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@extend %link-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-results {
|
#search-results {
|
||||||
padding-bottom: 6rem;
|
padding-bottom: 6rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
@@ -1004,7 +1036,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page {
|
#core-wrapper {
|
||||||
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$bottom-min-height}) !important;
|
||||||
|
|
||||||
.categories,
|
.categories,
|
||||||
#tags,
|
#tags,
|
||||||
#archives {
|
#archives {
|
||||||
@@ -1041,20 +1075,24 @@ $sidebar-display: "sidebar-display";
|
|||||||
@include pl-pr(0);
|
@include pl-pr(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#main > div.row:first-child > div {
|
#main {
|
||||||
|
.row:first-child {
|
||||||
|
> div {
|
||||||
&:nth-child(1),
|
&:nth-child(1),
|
||||||
&:nth-child(2) {
|
&:nth-child(2) {
|
||||||
margin-top: $topbar-height; /* same as the height of topbar */
|
margin-top: $topbar-height; /* same as the height of topbar */
|
||||||
}
|
}
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
/* 3rem for topbar, 6rem for footer */
|
/* 3rem for topbar, 6rem for footer */
|
||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$post-extend-min-height});
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$bottom-min-height});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#post-wrapper {
|
div.row:first-of-type:last-of-type { // alone
|
||||||
min-height: calc(
|
margin-bottom: 4rem;
|
||||||
100vh - #{$topbar-height} - #{$footer-height} - #{$post-extend-min-height}) !important;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#topbar-wrapper.row,
|
#topbar-wrapper.row,
|
||||||
@@ -1066,18 +1104,27 @@ $sidebar-display: "sidebar-display";
|
|||||||
/* --- button back-to-top --- */
|
/* --- button back-to-top --- */
|
||||||
|
|
||||||
#back-to-top {
|
#back-to-top {
|
||||||
|
$size: 2.7em;
|
||||||
|
|
||||||
display: none;
|
display: none;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background: var(--button-bg);
|
background: var(--button-bg);
|
||||||
color: var(--btn-backtotop-color);
|
color: var(--btn-backtotop-color);
|
||||||
height: 2.6em;
|
padding: 0;
|
||||||
width: 2.7em;
|
width: $size;
|
||||||
|
height: $size;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid var(--btn-backtotop-border-color);
|
border: 1px solid var(--btn-backtotop-border-color);
|
||||||
transition: 0.2s ease-out;
|
transition: transform 0.2s ease-out;
|
||||||
-webkit-transition: 0.2s ease-out;
|
-webkit-transition: transform 0.2s ease-out;
|
||||||
|
|
||||||
|
i {
|
||||||
|
line-height: $size;
|
||||||
|
position: relative;
|
||||||
|
bottom: 2px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#back-to-top:hover {
|
#back-to-top:hover {
|
||||||
@@ -1102,12 +1149,12 @@ $sidebar-display: "sidebar-display";
|
|||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height});
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height});
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-wrapper {
|
#core-wrapper {
|
||||||
min-height: calc(
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$bottom-min-height}) !important;
|
||||||
100vh - #{$topbar-height} - #{$footer-height} - #{$post-extend-min-height}) !important;
|
|
||||||
h1 {
|
h1 {
|
||||||
margin-top: 2.2rem;
|
margin-top: 2.2rem;
|
||||||
font-size: 1.55rem;
|
font-size: 1.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1126,6 +1173,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
footer {
|
footer {
|
||||||
height: $footer-height;
|
height: $footer-height;
|
||||||
|
|
||||||
> div.d-flex {
|
> div.d-flex {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 1.5rem 0;
|
padding: 1.5rem 0;
|
||||||
@@ -1134,6 +1182,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
-ms-flex-pack: distribute !important;
|
-ms-flex-pack: distribute !important;
|
||||||
justify-content: space-around !important;
|
justify-content: space-around !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-left,
|
.footer-left,
|
||||||
.footer-right {
|
.footer-right {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -1157,13 +1206,13 @@ $sidebar-display: "sidebar-display";
|
|||||||
.footnotes ol > li {
|
.footnotes ol > li {
|
||||||
padding-top: 3.5rem;
|
padding-top: 3.5rem;
|
||||||
margin-top: -3.2rem;
|
margin-top: -3.2rem;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-top: -3.5rem;
|
margin-top: -3.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[#{$sidebar-display}] {
|
[#{$sidebar-display}] {
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
@@ -1228,6 +1277,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
&.loaded ~ a {
|
&.loaded ~ a {
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fa-times-circle {
|
.fa-times-circle {
|
||||||
right: 5.2rem;
|
right: 5.2rem;
|
||||||
}
|
}
|
||||||
@@ -1242,19 +1292,15 @@ $sidebar-display: "sidebar-display";
|
|||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-hints {
|
|
||||||
display: block;
|
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tags {
|
#tags {
|
||||||
-webkit-box-pack: center !important;
|
-webkit-box-pack: center !important;
|
||||||
-ms-flex-pack: center !important;
|
-ms-flex-pack: center !important;
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page h1.dynamic-title {
|
h1.dynamic-title {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
~ .post-content {
|
~ .post-content {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
@@ -1329,7 +1375,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
/* Compact icons in sidebar & panel hidden */
|
/* Compact icons in sidebar & panel hidden */
|
||||||
@media all and (min-width: 850px) and (max-width: 1199px) {
|
@media all and (min-width: 850px) and (max-width: 1199px) {
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
width: $sidebar-width-small;
|
width: $sidebar-width-small;
|
||||||
|
|
||||||
@@ -1343,6 +1388,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
span {
|
span {
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-border {
|
.icon-border {
|
||||||
left: -3px;
|
left: -3px;
|
||||||
}
|
}
|
||||||
@@ -1402,7 +1448,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
/* --- desktop mode, both sidebar and panel are visible --- */
|
/* --- desktop mode, both sidebar and panel are visible --- */
|
||||||
|
|
||||||
@media all and (min-width: 1200px) {
|
@media all and (min-width: 1200px) {
|
||||||
|
|
||||||
#main > div.row > div.col-xl-8 {
|
#main > div.row > div.col-xl-8 {
|
||||||
-webkit-box-flex: 0;
|
-webkit-box-flex: 0;
|
||||||
-ms-flex: 0 0 75%;
|
-ms-flex: 0 0 75%;
|
||||||
@@ -1432,18 +1477,25 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
#search-results > div {
|
#search-results > div {
|
||||||
width: 46%;
|
width: 46%;
|
||||||
|
|
||||||
&:nth-child(odd) {
|
&:nth-child(odd) {
|
||||||
margin-right: 1.5rem;
|
margin-right: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-child(even) {
|
&:nth-child(even) {
|
||||||
margin-left: 1.5rem;
|
margin-left: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child:nth-child(odd) {
|
&:last-child:nth-child(odd) {
|
||||||
position: relative;
|
position: relative;
|
||||||
right: 24.3%;
|
right: 24.3%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search-hints {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
font-size: 1.03rem;
|
font-size: 1.03rem;
|
||||||
}
|
}
|
||||||
@@ -1455,9 +1507,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1400px) {
|
@media all and (min-width: 1400px) {
|
||||||
|
|
||||||
#main > div.row {
|
#main > div.row {
|
||||||
padding-left: calc((100% - #{$main-content-max-width}) / 2);
|
padding-left: calc((100% - #{$main-content-max-width}) / 2);
|
||||||
|
|
||||||
> div.col-xl-8 {
|
> div.col-xl-8 {
|
||||||
max-width: 850px;
|
max-width: 850px;
|
||||||
}
|
}
|
||||||
@@ -1465,6 +1517,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
#search-result-wrapper {
|
#search-result-wrapper {
|
||||||
padding-right: 2rem;
|
padding-right: 2rem;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
max-width: 1110px;
|
max-width: 1110px;
|
||||||
}
|
}
|
||||||
@@ -1483,13 +1536,13 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1650px) {
|
@media all and (min-width: 1650px) {
|
||||||
|
|
||||||
#breadcrumb {
|
#breadcrumb {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main > div.row > div.col-xl-8 {
|
#main > div.row > div.col-xl-8 {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
||||||
> div:first-child {
|
> div:first-child {
|
||||||
padding-left: 0.55rem !important;
|
padding-left: 0.55rem !important;
|
||||||
padding-right: 1.9rem !important;
|
padding-right: 1.9rem !important;
|
||||||
@@ -1537,6 +1590,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
> a {
|
> a {
|
||||||
width: 6.2rem;
|
width: 6.2rem;
|
||||||
height: 6.2rem;
|
height: 6.2rem;
|
||||||
|
|
||||||
&.mx-auto {
|
&.mx-auto {
|
||||||
margin-left: 0 !important;
|
margin-left: 0 !important;
|
||||||
}
|
}
|
||||||
@@ -1575,19 +1629,10 @@ $sidebar-display: "sidebar-display";
|
|||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
> span {
|
> span {
|
||||||
letter-spacing: 3px;
|
letter-spacing: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> i {
|
> i {
|
||||||
@include icon-round(1.65rem);
|
|
||||||
|
|
||||||
line-height: 1.5rem;
|
|
||||||
font-size: 0.6rem;
|
|
||||||
padding-top: 1px;
|
|
||||||
padding-left: 1px;
|
|
||||||
position: relative;
|
|
||||||
bottom: 1px;
|
|
||||||
|
|
||||||
&.unloaded {
|
&.unloaded {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
}
|
}
|
||||||
@@ -1601,35 +1646,41 @@ $sidebar-display: "sidebar-display";
|
|||||||
padding-left: 3.5rem;
|
padding-left: 3.5rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
$icon-block-size: 2rem;
|
||||||
|
|
||||||
&.justify-content-center {
|
&.justify-content-center {
|
||||||
-webkit-box-pack: start !important;
|
-webkit-box-pack: start !important;
|
||||||
-ms-flex-pack: start !important;
|
-ms-flex-pack: start !important;
|
||||||
justify-content: flex-start !important;
|
justify-content: flex-start !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
> span,
|
||||||
|
> button.mode-toggle,
|
||||||
|
> a {
|
||||||
|
@include ml-mr(0.15rem);
|
||||||
|
|
||||||
|
height: $icon-block-size;
|
||||||
|
margin-bottom: 0.5rem; // wrap line
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
background-color: var(--sidebar-btn-bg);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
width: 3rem;
|
width: $icon-block-size;
|
||||||
}
|
height: $icon-block-size;
|
||||||
|
border-radius: 50%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
i {
|
&::before {
|
||||||
@include icon-round(2rem);
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
padding-top: 0.44rem;
|
left: 50%;
|
||||||
margin-top: .7rem; // multi line space
|
transform: translate(-50%, -50%);
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mode-toggle-wrapper {
|
|
||||||
width: 3rem;
|
|
||||||
|
|
||||||
i {
|
|
||||||
top: 11px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-border {
|
.icon-border {
|
||||||
top: 26px;
|
top: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .sidebar-bottom
|
} // .sidebar-bottom
|
||||||
|
|||||||
@@ -10,6 +10,46 @@
|
|||||||
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%section {
|
||||||
|
#core-wrapper & {
|
||||||
|
margin-top: 2.5rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%anchor {
|
||||||
|
.anchor {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (hover: hover) {
|
||||||
|
.anchor {
|
||||||
|
border-bottom: none !important;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.anchor {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.25s ease-in, visibility 0s ease-in 0s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%anchor-relative {
|
||||||
|
@extend %anchor;
|
||||||
|
|
||||||
|
.anchor {
|
||||||
|
position: relative;
|
||||||
|
bottom: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
%tag-hover {
|
%tag-hover {
|
||||||
background: var(--tag-hover);
|
background: var(--tag-hover);
|
||||||
transition: background 0.35s ease-in-out;
|
transition: background 0.35s ease-in-out;
|
||||||
@@ -35,20 +75,24 @@
|
|||||||
border-bottom: 1px solid var(--link-underline-color);
|
border-bottom: 1px solid var(--link-underline-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%clickable-transition {
|
||||||
|
transition: color 0.35s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
%no-cursor {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
%no-bottom-border {
|
%no-bottom-border {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
%section {
|
%cursor-pointer {
|
||||||
#post-wrapper & {
|
cursor: pointer;
|
||||||
line-height: 1.2;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%anchor {
|
%normal-font-style {
|
||||||
padding-top: 3.5rem;
|
font-style: normal;
|
||||||
margin-top: -2.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- scss mixin --------- */
|
/* ---------- scss mixin --------- */
|
||||||
@@ -57,19 +101,11 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin sidebar-links($color: rgba(255, 255, 255, 0.5)) {
|
%sidebar-links {
|
||||||
color: $color;
|
color: rgba(117, 117, 117, 0.9);
|
||||||
transition: color 0.35s ease-in-out;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin icon-round($diameter) {
|
|
||||||
border: 1px solid;
|
|
||||||
border-radius: 50%;
|
|
||||||
width: $diameter;
|
|
||||||
height: $diameter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin ml-mr($value) {
|
@mixin ml-mr($value) {
|
||||||
margin-left: $value;
|
margin-left: $value;
|
||||||
margin-right: $value;
|
margin-right: $value;
|
||||||
@@ -84,28 +120,12 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin semi-bold {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin label($font-size: 1rem, $font-weight: 600, $color: var(--label-color)) {
|
@mixin label($font-size: 1rem, $font-weight: 600, $color: var(--label-color)) {
|
||||||
color: $color;
|
color: $color;
|
||||||
font-size: $font-size;
|
font-size: $font-size;
|
||||||
font-weight: $font-weight;
|
font-weight: $font-weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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 {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
|||||||
@@ -27,22 +27,19 @@ html[mode=dark] {
|
|||||||
|
|
||||||
/* -- Codes Snippet -- */
|
/* -- Codes Snippet -- */
|
||||||
|
|
||||||
|
$code-radius: 6px;
|
||||||
|
|
||||||
%code-snippet-bg {
|
%code-snippet-bg {
|
||||||
background: var(--highlight-bg-color);
|
background: var(--highlight-bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
%code-snippet-radius {
|
%code-snippet-radius {
|
||||||
border-radius: 6px;
|
border-radius: $code-radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
%code-snippet-padding {
|
%code-snippet-padding {
|
||||||
padding: 1.5rem;
|
padding-left: 1rem;
|
||||||
}
|
padding-right: 1.5rem;
|
||||||
|
|
||||||
div > pre {
|
|
||||||
@extend %code-snippet-bg;
|
|
||||||
@extend %code-snippet-radius;
|
|
||||||
@extend %code-snippet-padding;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlighter-rouge {
|
.highlighter-rouge {
|
||||||
@@ -63,6 +60,8 @@ div > pre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -72,26 +71,17 @@ div > pre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
td pre {
|
td pre {
|
||||||
overflow: visible; /* Fixed iOS safari overflow-x */
|
overflow: visible; /* Fixed iOS safari overflow-x */
|
||||||
word-break: normal; /* Fixed iOS safari linenos code break */
|
word-break: normal; /* Fixed iOS safari linenos code break */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lineno {
|
.lineno {
|
||||||
margin-left: 0.2rem;
|
|
||||||
padding-right: 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);
|
||||||
border-right: 1px solid var(--highlight-lineno-border-color);
|
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-khtml-user-select: none;
|
-khtml-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
@@ -120,22 +110,26 @@ code {
|
|||||||
background-color: var(--inline-code-bg);
|
background-color: var(--inline-code-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@at-root a > &.highlighter-rouge {
|
a > &.highlighter-rouge {
|
||||||
padding-bottom: 0; // show link's underlinke
|
padding-bottom: 0; // show link's underlinke
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@at-root a:hover > &.highlighter-rouge {
|
a:hover > &.highlighter-rouge {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote &.highlighter-rouge {
|
blockquote &.highlighter-rouge {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.highlight > & {
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
padding: 1.5rem 1.5rem 1.5rem 1rem;
|
@extend %code-snippet-padding;
|
||||||
|
|
||||||
// Prevent some browser extends from
|
// Prevent some browser extends from
|
||||||
// changing the URL string of code block.
|
// changing the URL string of code block.
|
||||||
@@ -152,35 +146,130 @@ div {
|
|||||||
&[class^='highlighter-rouge'],
|
&[class^='highlighter-rouge'],
|
||||||
&.language-plaintext.highlighter-rouge,
|
&.language-plaintext.highlighter-rouge,
|
||||||
&.language-console.highlighter-rouge,
|
&.language-console.highlighter-rouge,
|
||||||
&.language-terminal.highlighter-rouge {
|
&.language-terminal.highlighter-rouge,
|
||||||
|
&.nolineno {
|
||||||
pre.lineno {
|
pre.lineno {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
@extend %code-snippet-padding;
|
padding-left: 1.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div[class^='language-']::before {
|
.code-header {
|
||||||
content: attr(lang);
|
@extend %no-cursor;
|
||||||
position: absolute;
|
|
||||||
right: 2rem;
|
$code-header-height: 2.25rem;
|
||||||
margin-top: 3px;
|
|
||||||
font-size: 0.7rem;
|
border-top-left-radius: $code-radius;
|
||||||
|
border-top-right-radius: $code-radius;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: $code-header-height;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
$dot-size: 0.75rem;
|
||||||
|
$dot-margin: 0.5rem;
|
||||||
|
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 1rem;
|
||||||
|
width: $dot-size;
|
||||||
|
height: $dot-size;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--code-header-muted-color);
|
||||||
|
box-shadow:
|
||||||
|
($dot-size + $dot-margin) 0 0 var(--code-header-muted-color),
|
||||||
|
($dot-size + $dot-margin) * 2 0 0 var(--code-header-muted-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
// the label block
|
||||||
|
span {
|
||||||
|
// label icon
|
||||||
|
i {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-right: 0.4rem;
|
||||||
|
color: var(--code-header-icon-color);
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@at-root [file] #{&} > i {
|
||||||
|
position: relative;
|
||||||
|
top: 1px; // center the file icon
|
||||||
|
}
|
||||||
|
|
||||||
|
// label text
|
||||||
|
&::after {
|
||||||
|
content: attr(label-text);
|
||||||
|
font-size: 0.85rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--highlight-lineno-color);
|
color: var(--code-header-text-color);
|
||||||
text-transform: uppercase;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// clipboard
|
||||||
|
button {
|
||||||
|
@extend %cursor-pointer;
|
||||||
|
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: $code-radius;
|
||||||
|
height: $code-header-height;
|
||||||
|
width: $code-header-height;
|
||||||
|
padding: 0;
|
||||||
|
background-color: inherit;
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: var(--code-header-icon-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
&[timeout] {
|
||||||
|
&:hover {
|
||||||
|
border-color: var(--clipboard-checked-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: var(--clipboard-checked-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not([timeout]):hover {
|
||||||
|
background-color: rgba(128, 128, 128, 0.37);
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media all and (max-width: 576px) {
|
||||||
div[class^='language-']::before {
|
.post-content {
|
||||||
right: 3.1rem;
|
> div[class^='language-'] {
|
||||||
}
|
@include ml-mr(-1.25rem);
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 1650px) {
|
border-radius: 0;
|
||||||
div[class^='language-']::before {
|
|
||||||
right: 3.5rem;
|
.highlight {
|
||||||
|
padding-left: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-header {
|
||||||
|
border-radius: 0;
|
||||||
|
padding-left: 0.4rem;
|
||||||
|
padding-right: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ $sidebar-width-large: 350px !default; // screen width: >= 1650px
|
|||||||
/* tabs of sidebar */
|
/* tabs of sidebar */
|
||||||
|
|
||||||
$tab-count: 5 !default; // backward compatible (version <= 4.0.2)
|
$tab-count: 5 !default; // backward compatible (version <= 4.0.2)
|
||||||
$tab-height: 3.2rem !default;
|
$tab-height: 3rem !default;
|
||||||
$tab-cursor-height: 1.6rem !default;
|
$tab-cursor-height: 1.6rem !default;
|
||||||
|
|
||||||
$cursor-width: 3px !default; // the cursor width of the selected tab
|
$cursor-width: 2px !default; // the cursor width of the selected tab
|
||||||
|
|
||||||
/* other framework sizes */
|
/* other framework sizes */
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ $main-content-max-width: 1150px !default;
|
|||||||
|
|
||||||
$panel-max-width: 300px !default;
|
$panel-max-width: 300px !default;
|
||||||
|
|
||||||
$post-extend-min-height: 35rem !default;
|
$bottom-min-height: 35rem !default;
|
||||||
|
|
||||||
/* syntax highlight */
|
/* syntax highlight */
|
||||||
|
|
||||||
|
|||||||
@@ -3,20 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@mixin dark-syntax {
|
@mixin dark-syntax {
|
||||||
/* ----- My styles ------ */
|
|
||||||
--highlight-bg-color: #252525;
|
|
||||||
--highlighter-rouge-color: #de6b18;
|
|
||||||
--highlight-lineno-color: #6c6c6d;
|
|
||||||
--highlight-lineno-border-color: #303435;
|
|
||||||
--inline-code-bg: #272822;
|
|
||||||
|
|
||||||
.highlight {
|
|
||||||
.gp { color: #818c96; }
|
|
||||||
}
|
|
||||||
|
|
||||||
pre { color: #bfbfbf; } /* override Bootstrap */
|
|
||||||
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: var(--highlight-bg-color); }
|
.highlight pre { background-color: var(--highlight-bg-color); }
|
||||||
.highlight .hll { background-color: var(--highlight-bg-color); }
|
.highlight .hll { background-color: var(--highlight-bg-color); }
|
||||||
@@ -81,4 +67,21 @@
|
|||||||
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
||||||
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
||||||
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
||||||
|
|
||||||
|
/* ----- custom styles ------ */
|
||||||
|
|
||||||
|
--highlight-bg-color: #252525;
|
||||||
|
--highlighter-rouge-color: #de6b18;
|
||||||
|
--highlight-lineno-color: #6c6c6d;
|
||||||
|
--inline-code-bg: #272822;
|
||||||
|
--code-header-text-color: #6a6a6a;
|
||||||
|
--code-header-muted-color: rgb(60 60 60);
|
||||||
|
--code-header-icon-color: rgb(86 86 86);
|
||||||
|
--clipboard-checked-color: #2bcc2b;
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
.gp { color: #818c96; }
|
||||||
|
}
|
||||||
|
|
||||||
|
pre { color: #bfbfbf; } /* override Bootstrap */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,26 +3,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@mixin dark-scheme {
|
@mixin dark-scheme {
|
||||||
/* framework */
|
/* Framework color */
|
||||||
--main-wrapper-bg: rgb(27, 27, 30);
|
|
||||||
--body-bg: var(--main-wrapper-bg);
|
--body-bg: var(--main-wrapper-bg);
|
||||||
--topbar-wrapper-bg: rgb(39, 40, 43);
|
|
||||||
--search-wrapper-bg: rgb(34, 34, 39);
|
|
||||||
--search-icon-color: rgb(100, 102, 105);
|
|
||||||
--input-focus-border-color: rgb(112, 114, 115);
|
|
||||||
--mask-bg: rgb(68, 69, 70);
|
--mask-bg: rgb(68, 69, 70);
|
||||||
--footer-bg-color: var(--main-wrapper-bg);
|
--main-wrapper-bg: rgb(27, 27, 30);
|
||||||
|
|
||||||
/* common color */
|
|
||||||
--text-color: rgb(175, 176, 177);
|
|
||||||
--heading-color: #cccccc;
|
|
||||||
--text-muted-color: rgb(107, 116, 124);
|
|
||||||
--link-color: rgb(138, 180, 248);
|
|
||||||
--link-underline-color: rgb(82, 108, 150);
|
|
||||||
--main-border-color: rgb(44, 45, 45);
|
--main-border-color: rgb(44, 45, 45);
|
||||||
--button-bg: rgb(39, 40, 43);
|
|
||||||
|
/* Common color */
|
||||||
|
--text-color: rgb(175, 176, 177);
|
||||||
|
--text-muted-color: rgb(107, 116, 124);
|
||||||
|
--heading-color: #cccccc;
|
||||||
--blockquote-border-color: rgb(66, 66, 66);
|
--blockquote-border-color: rgb(66, 66, 66);
|
||||||
--blockquote-text-color: rgb(117, 117, 117);
|
--blockquote-text-color: rgb(117, 117, 117);
|
||||||
|
--link-color: rgb(138, 180, 248);
|
||||||
|
--link-underline-color: rgb(82, 108, 150);
|
||||||
|
--button-bg: rgb(39, 40, 43);
|
||||||
--btn-border-color: rgb(63, 65, 68);
|
--btn-border-color: rgb(63, 65, 68);
|
||||||
--btn-backtotop-color: var(--text-color);
|
--btn-backtotop-color: var(--text-color);
|
||||||
--btn-backtotop-border-color: var(--btn-border-color);
|
--btn-backtotop-border-color: var(--btn-border-color);
|
||||||
@@ -33,21 +28,26 @@
|
|||||||
--checkbox-checked-color: var(--link-color);
|
--checkbox-checked-color: var(--link-color);
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
--nav-cursor-color: rgb(183, 182, 182);
|
|
||||||
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
|
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
|
||||||
|
--sidebar-muted-color: #6d6c6b;
|
||||||
|
--sidebar-active-color: rgb(255 255 255 / 80%);
|
||||||
|
--nav-cursor-color: rgb(183, 182, 182);
|
||||||
|
--sidebar-btn-bg: rgb(117 116 116 / 20%);
|
||||||
|
|
||||||
/* Top Bar */
|
/* Topbar */
|
||||||
--topbar-text-color: var(--text-color);
|
--topbar-text-color: var(--text-color);
|
||||||
|
--topbar-wrapper-bg: rgb(39, 40, 43);
|
||||||
|
--search-wrapper-bg: rgb(34, 34, 39);
|
||||||
|
--search-wrapper-border-color: rgb(34, 34, 39);
|
||||||
|
--search-icon-color: rgb(100, 102, 105);
|
||||||
|
--input-focus-border-color: rgb(112, 114, 115);
|
||||||
|
|
||||||
/* Home page */
|
/* Home page */
|
||||||
--post-list-text-color: rgb(175, 176, 177);
|
--post-list-text-color: rgb(175, 176, 177);
|
||||||
--btn-patinator-text-color: var(--text-color);
|
--btn-patinator-text-color: var(--text-color);
|
||||||
--btn-paginator-hover-color: rgb(64, 65, 66);
|
--btn-paginator-hover-color: rgb(64, 65, 66);
|
||||||
--btn-active-bg: rgba(28, 52, 94, 1);
|
|
||||||
--btn-active-border-color: rgb(66, 94, 138);
|
|
||||||
--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-text-color: var(--text-color);
|
||||||
--pin-bg: rgb(34 35 37);
|
--pin-bg: rgb(34 35 37);
|
||||||
--pin-color: inherit;
|
--pin-color: inherit;
|
||||||
|
|
||||||
@@ -65,6 +65,10 @@
|
|||||||
--card-bg: rgb(39, 40, 43);
|
--card-bg: rgb(39, 40, 43);
|
||||||
--card-border-color: rgb(53, 53, 60);
|
--card-border-color: rgb(53, 53, 60);
|
||||||
--card-box-shadow: var(--main-wrapper-bg);
|
--card-box-shadow: var(--main-wrapper-bg);
|
||||||
|
--preview-img-bg: radial-gradient(circle, rgb(22 22 24) 0%, rgb(32 32 32) 100%);
|
||||||
|
--kbd-wrap-color: #6a6a6a;
|
||||||
|
--kbd-text-color: #d3d3d3;
|
||||||
|
--kbd-bg-color: #242424;
|
||||||
|
|
||||||
/* tags */
|
/* tags */
|
||||||
--tag-border: rgb(59, 79, 88);
|
--tag-border: rgb(59, 79, 88);
|
||||||
@@ -75,17 +79,15 @@
|
|||||||
/* categories */
|
/* categories */
|
||||||
--categories-border: rgb(64, 66, 69);
|
--categories-border: rgb(64, 66, 69);
|
||||||
--categories-hover-bg: rgb(73, 75, 76);
|
--categories-hover-bg: rgb(73, 75, 76);
|
||||||
|
--categories-icon-hover-color: white;
|
||||||
|
|
||||||
/* archives */
|
/* archives */
|
||||||
--timeline-node-bg: rgb(150, 152, 156);
|
--timeline-node-bg: rgb(150, 152, 156);
|
||||||
--timeline-color: rgb(63, 65, 68);
|
--timeline-color: rgb(63, 65, 68);
|
||||||
--timeline-year-dot-color: var(--timeline-color);
|
--timeline-year-dot-color: var(--timeline-color);
|
||||||
|
|
||||||
/* Footer */
|
.post img[data-src] {
|
||||||
--footer-link: rgb(171, 171, 171);
|
filter: brightness(95%);
|
||||||
|
|
||||||
.post-content img {
|
|
||||||
filter: brightness(90%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
@@ -112,11 +114,13 @@
|
|||||||
.card-header {
|
.card-header {
|
||||||
background-color: var(--card-header-bg);
|
background-color: var(--card-header-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
border-color: var(--categories-border);
|
border-color: var(--categories-border);
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-bottom-color: var(--card-bg);
|
border-bottom-color: var(--card-bg);
|
||||||
}
|
}
|
||||||
@@ -124,13 +128,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#archives li:nth-child(odd) {
|
#archives li:nth-child(odd) {
|
||||||
background-image: linear-gradient(
|
background-image:
|
||||||
|
linear-gradient(
|
||||||
to left,
|
to left,
|
||||||
rgb(26, 26, 30),
|
rgb(26, 26, 30),
|
||||||
rgb(39, 39, 45),
|
rgb(39, 39, 45),
|
||||||
rgb(39, 39, 45),
|
rgb(39, 39, 45),
|
||||||
rgb(39, 39, 45),
|
rgb(39, 39, 45),
|
||||||
rgb(26, 26, 30));
|
rgb(26, 26, 30)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
color-scheme: dark;
|
||||||
|
|
||||||
|
#disqus_thread {
|
||||||
|
color-scheme: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // dark-scheme
|
} // dark-scheme
|
||||||
|
|||||||
@@ -70,6 +70,10 @@
|
|||||||
--highlight-bg-color: #f7f7f7;
|
--highlight-bg-color: #f7f7f7;
|
||||||
--highlighter-rouge-color: #2f2f2f;
|
--highlighter-rouge-color: #2f2f2f;
|
||||||
--highlight-lineno-color: #c2c6cc;
|
--highlight-lineno-color: #c2c6cc;
|
||||||
--highlight-lineno-border-color: #e9ecef;
|
|
||||||
--inline-code-bg: #f3f3f3;
|
--inline-code-bg: #f3f3f3;
|
||||||
|
--code-header-text-color: #a3a3b1;
|
||||||
|
--code-header-muted-color: #ebebeb;
|
||||||
|
--code-header-icon-color: #d1d1d1;
|
||||||
|
--clipboard-checked-color: #43c743;
|
||||||
|
|
||||||
} // light-syntax
|
} // light-syntax
|
||||||
|
|||||||
@@ -3,22 +3,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@mixin light-scheme {
|
@mixin light-scheme {
|
||||||
/* Common */
|
/* Framework color */
|
||||||
--body-bg: #fafafa;
|
--body-bg: #fafafa;
|
||||||
--mask-bg: #c1c3c5;
|
--mask-bg: #c1c3c5;
|
||||||
--main-wrapper-bg: white;
|
--main-wrapper-bg: white;
|
||||||
--main-border-color: #f3f3f3;
|
--main-border-color: #f3f3f3;
|
||||||
--btn-border-color: #e9ecef;
|
|
||||||
|
/* Common color */
|
||||||
--text-color: #34343c;
|
--text-color: #34343c;
|
||||||
|
--text-muted-color: gray;
|
||||||
--heading-color: black;
|
--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;
|
||||||
--link-underline-color: #dee2e6;
|
--link-underline-color: #dee2e6;
|
||||||
--text-muted-color: gray;
|
|
||||||
--tb-odd-bg: #fbfcfd;
|
|
||||||
--tb-border-color: #eaeaea;
|
|
||||||
--button-bg: #fff;
|
--button-bg: #fff;
|
||||||
|
--btn-border-color: #e9ecef;
|
||||||
--btn-backtotop-color: #686868;
|
--btn-backtotop-color: #686868;
|
||||||
--btn-backtotop-border-color: #f1f1f1;
|
--btn-backtotop-border-color: #f1f1f1;
|
||||||
--btn-box-shadow: #eaeaea;
|
--btn-box-shadow: #eaeaea;
|
||||||
@@ -26,16 +26,17 @@
|
|||||||
--checkbox-checked-color: #07a8f7;
|
--checkbox-checked-color: #07a8f7;
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
--sidebar-bg: radial-gradient(
|
--sidebar-bg: #eeeeee;
|
||||||
circle,
|
--sidebar-muted-color: #a2a19f;
|
||||||
rgba(42, 30, 107, 1) 0%,
|
--sidebar-active-color: #424242;
|
||||||
rgba(35, 37, 46, 1) 100%);
|
--nav-cursor-color: #757575;
|
||||||
--nav-cursor-color: #fcfcfc;
|
--sidebar-btn-bg: white;
|
||||||
|
|
||||||
/* Topbar */
|
/* Topbar */
|
||||||
--topbar-wrapper-bg: white;
|
|
||||||
--topbar-text-color: rgb(78, 78, 78);
|
--topbar-text-color: rgb(78, 78, 78);
|
||||||
--search-wrapper-bg: #f5f5f5;
|
--topbar-wrapper-bg: white;
|
||||||
|
--search-wrapper-bg: rgb(245 245 245 / 50%);
|
||||||
|
--search-wrapper-border-color: rgb(245 245 245);
|
||||||
--search-tag-bg: #f8f9fa;
|
--search-tag-bg: #f8f9fa;
|
||||||
--search-icon-color: #c2c6cc;
|
--search-icon-color: #c2c6cc;
|
||||||
--input-focus-border-color: var(--btn-border-color);
|
--input-focus-border-color: var(--btn-border-color);
|
||||||
@@ -43,12 +44,9 @@
|
|||||||
/* Home page */
|
/* Home page */
|
||||||
--post-list-text-color: dimgray;
|
--post-list-text-color: dimgray;
|
||||||
--btn-patinator-text-color: #555555;
|
--btn-patinator-text-color: #555555;
|
||||||
--btn-paginator-hover-color: #e9ecef;
|
--btn-paginator-hover-color: var(--sidebar-bg);
|
||||||
--btn-active-bg: #2a408e;
|
--btn-paginator-border-color: var(--sidebar-bg);
|
||||||
--btn-active-border-color: #007bff;
|
--btn-text-color: #676666;
|
||||||
--btn-text-color: #f8f8f8;
|
|
||||||
--btn-paginator-border-color: #f1f1f1;
|
|
||||||
--btn-paginator-shadow: #4b92d2;
|
|
||||||
--pin-bg: #f5f5f5;
|
--pin-bg: #f5f5f5;
|
||||||
--pin-color: #999fa4;
|
--pin-color: #999fa4;
|
||||||
|
|
||||||
@@ -58,20 +56,26 @@
|
|||||||
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
||||||
--label-color: #616161;
|
--label-color: #616161;
|
||||||
--relate-post-date: rgba(30, 55, 70, 0.4);
|
--relate-post-date: rgba(30, 55, 70, 0.4);
|
||||||
|
--footnote-target-bg: lightcyan;
|
||||||
--tag-bg: rgba(0, 0, 0, 0.075);
|
--tag-bg: rgba(0, 0, 0, 0.075);
|
||||||
--tag-border: #dee2e6;
|
--tag-border: #dee2e6;
|
||||||
--tag-shadow: var(--btn-border-color);
|
--tag-shadow: var(--btn-border-color);
|
||||||
--tag-hover: rgb(222, 226, 230);
|
--tag-hover: rgb(222, 226, 230);
|
||||||
--categories-hover-bg: var(--btn-border-color);
|
--tb-odd-bg: #fbfcfd;
|
||||||
|
--tb-border-color: #eaeaea;
|
||||||
--dash-color: silver;
|
--dash-color: silver;
|
||||||
|
--preview-img-bg: radial-gradient(circle, rgb(255 255 255) 0%, rgb(249 249 249) 100%);
|
||||||
|
--kbd-wrap-color: #bdbdbd;
|
||||||
|
--kbd-text-color: var(--text-color);
|
||||||
|
--kbd-bg-color: white;
|
||||||
|
|
||||||
|
/* Categories */
|
||||||
|
--categories-hover-bg: var(--btn-border-color);
|
||||||
|
--categories-icon-hover-color: darkslategray;
|
||||||
|
|
||||||
/* Archive */
|
/* Archive */
|
||||||
--timeline-color: rgba(0, 0, 0, 0.075);
|
--timeline-color: rgba(0, 0, 0, 0.075);
|
||||||
--timeline-node-bg: #c2c6cc;
|
--timeline-node-bg: #c2c6cc;
|
||||||
--timeline-year-dot-color: #ffffff;
|
--timeline-year-dot-color: #ffffff;
|
||||||
|
|
||||||
/* Footer */
|
|
||||||
--footer-bg-color: #ffffff;
|
|
||||||
--footnote-target-bg: lightcyan;
|
|
||||||
--footer-link: #424242;
|
|
||||||
} // light-scheme
|
} // light-scheme
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* The styles for Jekyll theme Chirpy
|
* The styles for Jekyll theme Chirpy
|
||||||
*
|
*
|
||||||
* Chirpy v4.1.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
&:not(:first-child) {
|
&:not(:first-child) {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
left: 67px;
|
left: 67px;
|
||||||
}
|
}
|
||||||
@@ -98,6 +99,7 @@
|
|||||||
.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;
|
||||||
@@ -120,6 +122,7 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.day {
|
&.day {
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
font-family: 'Lato', sans-serif;
|
font-family: 'Lato', sans-serif;
|
||||||
@@ -127,7 +130,7 @@
|
|||||||
margin-right: -2px;
|
margin-right: -2px;
|
||||||
width: 1.2rem;
|
width: 1.2rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -.15rem;
|
left: -0.15rem;
|
||||||
}
|
}
|
||||||
} // #archives .date
|
} // #archives .date
|
||||||
|
|
||||||
@@ -136,6 +139,7 @@
|
|||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
#archives {
|
#archives {
|
||||||
margin-top: -1rem;
|
margin-top: -1rem;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,24 +8,22 @@
|
|||||||
|
|
||||||
.categories {
|
.categories {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
i {
|
||||||
&.far,
|
@extend %category-icon-color;
|
||||||
&.fas {
|
|
||||||
font-size: 86%; // fontawesome icons
|
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 {
|
|
||||||
@extend %category-icon-color;
|
|
||||||
}
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
@@ -33,10 +31,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header > span > i:first-child {
|
|
||||||
@extend %category-icon-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // .categories
|
} // .categories
|
||||||
|
|
||||||
.category-trigger {
|
.category-trigger {
|
||||||
@@ -45,11 +39,18 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #6c757d !important;
|
color: #6c757d !important;
|
||||||
> i.fas {
|
|
||||||
|
&:hover {
|
||||||
|
i {
|
||||||
|
color: var(--categories-icon-hover-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 0.7rem;
|
height: 0.7rem;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
transition: 300ms ease all;
|
transition: transform 300ms ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.dash {
|
.dash {
|
||||||
margin: 0 .5rem .6rem .5rem;
|
margin: 0 0.5rem 0.6rem 0.5rem;
|
||||||
border-bottom: 2px dotted var(--dash-color);
|
border-bottom: 2px dotted var(--dash-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +60,9 @@
|
|||||||
#page-tag {
|
#page-tag {
|
||||||
ul > li {
|
ul > li {
|
||||||
&::before {
|
&::before {
|
||||||
margin: 0 .5rem;
|
margin: 0 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
> a {
|
> a {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -22,26 +22,29 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid var(--btn-paginator-border-color);
|
border: 1px solid var(--btn-paginator-border-color);
|
||||||
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 {
|
||||||
.page-link {
|
.page-link {
|
||||||
background-color: var(--btn-active-bg);
|
background-color: var(--btn-paginator-hover-color);
|
||||||
border-color: var(--btn-active-border-color);
|
|
||||||
box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important;
|
|
||||||
color: var(--btn-text-color);
|
color: var(--btn-text-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
|
|
||||||
.page-link {
|
.page-link {
|
||||||
color: rgba(108, 117, 125, 0.57);
|
color: rgba(108, 117, 125, 0.57);
|
||||||
border-color: var(--btn-paginator-border-color);
|
border-color: var(--btn-paginator-border-color);
|
||||||
background-color: var(--button-bg);
|
background-color: var(--button-bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:first-child .page-link,
|
&:first-child .page-link,
|
||||||
&:last-child .page-link {
|
&:last-child .page-link {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
@@ -71,9 +74,14 @@
|
|||||||
.post-meta {
|
.post-meta {
|
||||||
i {
|
i {
|
||||||
font-size: 0.73rem;
|
font-size: 0.73rem;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-left: 1.2rem;
|
||||||
}
|
}
|
||||||
span:not(:last-child) {
|
}
|
||||||
margin-right: 1.2rem;
|
|
||||||
|
em {
|
||||||
|
@extend %normal-font-style;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +89,7 @@
|
|||||||
margin-top: 0.6rem;
|
margin-top: 0.6rem;
|
||||||
margin-bottom: 0.6rem;
|
margin-bottom: 0.6rem;
|
||||||
color: var(--post-list-text-color);
|
color: var(--post-list-text-color);
|
||||||
|
|
||||||
> p {
|
> p {
|
||||||
/* Make preview shorter on the homepage */
|
/* Make preview shorter on the homepage */
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -98,13 +107,13 @@
|
|||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
color: var(--pin-color);
|
color: var(--pin-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
> span {
|
> span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .post-preview
|
} // .post-preview
|
||||||
|
|
||||||
} // #post-list
|
} // #post-list
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@@ -124,9 +133,9 @@
|
|||||||
|
|
||||||
/* Sidebar is visible */
|
/* Sidebar is visible */
|
||||||
@media all and (min-width: 831px) {
|
@media all and (min-width: 831px) {
|
||||||
|
|
||||||
#post-list {
|
#post-list {
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
|
|
||||||
.post-preview .post-meta {
|
.post-preview .post-meta {
|
||||||
.pin {
|
.pin {
|
||||||
background: var(--pin-bg);
|
background: var(--pin-bg);
|
||||||
|
|||||||
@@ -16,27 +16,37 @@
|
|||||||
border-color: var(--btn-border-color);
|
border-color: var(--btn-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin dot($pl: 0.2rem, $pr: 0.4rem) {
|
@mixin dot($pl: 0.25rem, $pr: 0.25rem) {
|
||||||
content: "\2022";
|
content: "\2022";
|
||||||
color: rgba(158, 158, 158, 0.8);
|
|
||||||
padding-left: $pl;
|
padding-left: $pl;
|
||||||
padding-right: $pr;
|
padding-right: $pr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-wrapper .post-meta {
|
%text-color {
|
||||||
> div:nth-child(2) {
|
color: var(--text-color);
|
||||||
> span:not(:first-child)::before {
|
}
|
||||||
|
|
||||||
|
h1 + .post-meta {
|
||||||
|
span + span::before {
|
||||||
@include dot;
|
@include dot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %text-color;
|
||||||
|
|
||||||
|
a {
|
||||||
|
@extend %text-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
img.preview-img {
|
||||||
.preview-img {
|
margin-top: 3.75rem;
|
||||||
@include align-center;
|
margin-bottom: 0;
|
||||||
|
border-radius: 6px;
|
||||||
|
|
||||||
margin-top: 0;
|
&.bg[data-loaded=true] {
|
||||||
margin-bottom: 2.5rem !important;
|
background: var(--preview-img-bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +54,10 @@
|
|||||||
margin-top: 6rem;
|
margin-top: 6rem;
|
||||||
border-bottom: 1px double var(--main-border-color);
|
border-bottom: 1px double var(--main-border-color);
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
|
|
||||||
|
.post-meta a {
|
||||||
|
@extend %link-underline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tags {
|
.post-tags {
|
||||||
@@ -109,7 +123,7 @@
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .post-navigation
|
} /* .post-navigation */
|
||||||
|
|
||||||
@keyframes fade-up {
|
@keyframes fade-up {
|
||||||
from {
|
from {
|
||||||
@@ -131,22 +145,23 @@
|
|||||||
top: 4rem;
|
top: 4rem;
|
||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
animation: fade-up 0.8s;
|
animation: fade-up 0.8s;
|
||||||
&.topbar-down {
|
|
||||||
top: 6rem;
|
|
||||||
}
|
|
||||||
> span {
|
|
||||||
@include panel-label;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#toc li > a {
|
#toc li a {
|
||||||
line-height: 1rem;
|
font-size: 0.8rem;
|
||||||
padding-top: 0.5rem;
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
|
|
||||||
&.nav-link:not(.active) {
|
&.nav-link:not(.active) {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
nav[data-toggle=toc] {
|
||||||
|
.nav {
|
||||||
|
.nav > li > a.active {
|
||||||
|
font-weight: 600 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Related Posts --- */
|
/* --- Related Posts --- */
|
||||||
@@ -155,6 +170,11 @@
|
|||||||
> h3 {
|
> h3 {
|
||||||
@include label(1.1rem, 600);
|
@include label(1.1rem, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %normal-font-style;
|
||||||
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
border-color: var(--card-border-color);
|
border-color: var(--card-border-color);
|
||||||
background-color: var(--card-bg);
|
background-color: var(--card-bg);
|
||||||
@@ -162,9 +182,11 @@
|
|||||||
-webkit-transition: all 0.3s ease-in-out;
|
-webkit-transition: all 0.3s ease-in-out;
|
||||||
-moz-transition: all 0.3s ease-in-out;
|
-moz-transition: all 0.3s ease-in-out;
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
color: var(--text-color);
|
@extend %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);
|
||||||
@@ -193,6 +215,7 @@
|
|||||||
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;
|
||||||
@@ -207,11 +230,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-extend-wrapper {
|
#tail-wrapper {
|
||||||
min-height: 2rem;
|
min-height: 2rem;
|
||||||
#disqus_thread {
|
|
||||||
|
> div:last-of-type {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#disqus_thread {
|
||||||
|
min-height: 8.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tail-bottom a {
|
.post-tail-bottom a {
|
||||||
@@ -228,45 +257,57 @@
|
|||||||
|
|
||||||
.share-icons {
|
.share-icons {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: 0.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: 0.35rem;
|
position: relative;
|
||||||
|
bottom: 1px;
|
||||||
|
|
||||||
|
@extend %cursor-pointer;
|
||||||
|
|
||||||
&: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));
|
@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));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.fa-telegram {
|
&.fa-telegram {
|
||||||
@include btn-sharing-color(rgb(39, 159, 217));
|
@include btn-sharing-color(rgb(39, 159, 217));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.fa-weibo {
|
&.fa-weibo {
|
||||||
@include btn-sharing-color(rgb(229, 20, 43));
|
@include btn-sharing-color(rgb(229, 20, 43));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .share-icons
|
} /* .share-icons */
|
||||||
|
|
||||||
.fas.fa-link {
|
.fas.fa-link {
|
||||||
@include btn-sharing-color(rgb(171, 171, 171));
|
@include btn-sharing-color(rgb(171, 171, 171));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .share-wrapper
|
} /* .share-wrapper */
|
||||||
|
|
||||||
.share-label {
|
.share-label {
|
||||||
@include label(inherit, 400, inherit);
|
@include label(inherit, 400, inherit);
|
||||||
@@ -278,8 +319,10 @@
|
|||||||
|
|
||||||
.license-wrapper {
|
.license-wrapper {
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
|
|
||||||
> a {
|
> a {
|
||||||
font-weight: 600;
|
color: var(--text-color);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
}
|
}
|
||||||
@@ -288,27 +331,23 @@
|
|||||||
span:last-child {
|
span:last-child {
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
}
|
}
|
||||||
} // .license-wrapper
|
|
||||||
|
} /* .license-wrapper */
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
|
.preview-img[data-src] {
|
||||||
|
margin-top: 2.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.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) {
|
||||||
@@ -317,28 +356,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 768px) {
|
|
||||||
#post-wrapper {
|
|
||||||
.post-meta {
|
|
||||||
>div:not(:first-child)::before {
|
|
||||||
@include dot(0.5rem, 0.2rem);
|
|
||||||
}
|
|
||||||
&.flex-column {
|
|
||||||
-webkit-box-orient: horizontal !important;
|
|
||||||
-webkit-box-direction: normal !important;
|
|
||||||
-ms-flex-direction: row !important;
|
|
||||||
flex-direction: row !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // .post
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 849px) {
|
||||||
.post-navigation {
|
.post-navigation {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
margin-left: -.5rem;
|
margin-left: -0.5rem;
|
||||||
margin-right: -.5rem;
|
margin-right: -0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-img[data-src] {
|
||||||
|
max-width: 100vw;
|
||||||
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
border: 1px solid var(--tag-border) !important;
|
border: 1px solid var(--tag-border) !important;
|
||||||
box-shadow: 0 0 3px 0 var(--tag-shadow);
|
box-shadow: 0 0 3px 0 var(--tag-shadow);
|
||||||
|
|
||||||
span {
|
span {
|
||||||
margin-left: 0.6em;
|
margin-left: 0.6em;
|
||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: About
|
title: About
|
||||||
icon: fas fa-info
|
icon: fas fa-info-circle
|
||||||
order: 4
|
order: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
layout: tags
|
layout: tags
|
||||||
title: Tags
|
title: Tags
|
||||||
icon: fas fa-tags
|
icon: fas fa-tag
|
||||||
order: 2
|
order: 2
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -11,19 +11,21 @@ redirect_from:
|
|||||||
dynamic_title: true
|
dynamic_title: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
<div class="lead">
|
<div class="lead">
|
||||||
|
|
||||||
{%- capture _head_back -%}
|
{%- capture _head_back -%}
|
||||||
<a href="{{ '/' | relative_url }}">{{ site.data.locales[site.lang].not_found.head_back }}</a>
|
<a href="{{ '/' | relative_url }}">{{ site.data.locales[lang].not_found.head_back }}</a>
|
||||||
{%- endcapture -%}
|
{%- endcapture -%}
|
||||||
|
|
||||||
{%- capture _archives_page -%}
|
{%- capture _archives_page -%}
|
||||||
<a href="{{ 'archives' | relative_url }}">{{ site.data.locales[site.lang].not_found.archives_page }}</a>
|
<a href="{{ 'archives' | relative_url }}">{{ site.data.locales[lang].not_found.archives_page }}</a>
|
||||||
{%- endcapture -%}
|
{%- endcapture -%}
|
||||||
|
|
||||||
<p>{{site.data.locales[site.lang].not_found.statment }}</p>
|
<p>{{site.data.locales[lang].not_found.statment }}</p>
|
||||||
|
|
||||||
<p>{{ site.data.locales[site.lang].not_found.hint_template
|
<p>{{ site.data.locales[lang].not_found.hint_template
|
||||||
| replace: ':HEAD_BAK', _head_back
|
| replace: ':HEAD_BAK', _head_back
|
||||||
| replace: ':ARCHIVES_PAGE', _archives_page }}
|
| replace: ':ARCHIVES_PAGE', _archives_page }}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ permalink: /feed.xml
|
|||||||
<uri>{{ "/" | absolute_url }}</uri>
|
<uri>{{ "/" | absolute_url }}</uri>
|
||||||
</author>
|
</author>
|
||||||
<link rel="self" type="application/atom+xml" href="{{ page.url | absolute_url }}"/>
|
<link rel="self" type="application/atom+xml" href="{{ page.url | absolute_url }}"/>
|
||||||
<link rel="alternate" type="text/html" hreflang="{{ site.lang | default: 'en' }}"
|
<link rel="alternate" type="text/html" hreflang="{{ site.lang }}"
|
||||||
href="{{ '/' | absolute_url }}"/>
|
href="{{ '/' | absolute_url }}"/>
|
||||||
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
|
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
|
||||||
<rights> © {{ 'now' | date: '%Y' }} {{ site.social.name }} </rights>
|
<rights> © {{ 'now' | date: '%Y' }} {{ site.social.name }} </rights>
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ layout: compress
|
|||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
{
|
{
|
||||||
"title": "{{ post.title | escape }}",
|
"title": "{{ post.title | escape }}",
|
||||||
"url": "{{ site.baseurl }}{{ post.url }}",
|
"url": "{{ post.url | relative_url }}",
|
||||||
"categories": "{{ post.categories | join: ', '}}",
|
"categories": "{{ post.categories | join: ', '}}",
|
||||||
"tags": "{{ post.tags | join: ', ' }}",
|
"tags": "{{ post.tags | join: ', ' }}",
|
||||||
"date": "{{ post.date }}",
|
"date": "{{ post.date }}",
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | truncate: 300 | replace: '\', '\\\\' }}"
|
"snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | replace: '\', '\\\\' }}"
|
||||||
}{% unless forloop.last %},{% endunless %}
|
}{% unless forloop.last %},{% endunless %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
]
|
]
|
||||||
|
|||||||
4
assets/js/dist/categories.min.js
vendored
4
assets/js/dist/categories.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.1.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),s=$("#search-cancel"),t=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),f=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset:()=>o}}(),u={on(){o.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),n.addClass("d-flex"),s.addClass("loaded")},off(){s.removeClass("loaded"),n.removeClass("d-flex"),o.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},p=function(){let o=!1;return{on(){o||(f.block(),r.removeClass("unloaded"),a.addClass("unloaded"),o=!0)},off(){o&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),t.removeClass("visible"),a.removeClass("unloaded"),f.release(),i.val(""),o=!1)},isVisible:()=>o}}();function h(){return s.hasClass("loaded")}e.click(function(){u.on(),p.on(),i.focus()}),s.click(function(){u.off(),p.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(o){8===o.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),t.hasClass("visible")||t.addClass("visible"),h()&&c.addClass("unloaded"))}),t.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):p.off(),i.focus(),t.removeClass("visible")})}),$(function(){const o=function(){let o=!1;const e=$("body");return{toggle(){!1===o?e.attr("sidebar-display",""):e.removeAttr("sidebar-display"),o=!o}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const o=$("#topbar-wrapper"),e=$("#toc-wrapper"),s=$(".access"),t=$("#search-input");let a,l=0;const n=5,r=o.outerHeight();$(window).scroll(function(o){$("#topbar-title").is(":hidden")&&(a=!0)}),setInterval(function(){a&&(!function(){var a=$(this).scrollTop();Math.abs(l-a)<=n||(a>l&&a>r?(o.removeClass("topbar-down").addClass("topbar-up"),e.length>0&&e.removeClass("topbar-down"),s.length>0&&s.removeClass("topbar-down"),t.is(":focus")&&t.blur()):a+$(window).height()<$(document).height()&&(o.removeClass("topbar-up").addClass("topbar-down"),e.length>0&&e.addClass("topbar-down"),s.length>0&&s.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const o=$("#topbar-title"),e=$("div.post>h1"),s=o.text().trim();let t=e.length>0?e.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||e.is(":hidden")||o.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?o.text()!==t&&o.text(t):o.text()!==s&&o.text(s)}),o.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const o=$(".collapse");o.on("hide.bs.collapse",function(){const o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$(`#${o}`).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){const o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$(`#${o}`).addClass("hide-border-bottom"))})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const o=$(e.target);let t=o.prop("tagName")==="button".toUpperCase()?o:o.parent();t.blur(),flipMode()})}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),f={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),r.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},p=function(){let e=!1;return{on(){e||(u.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),s.removeClass("visible"),a.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible(){return e}}}();function h(){return t.hasClass("loaded")}o.click(function(){f.on(),p.on(),i.focus()}),t.click(function(){f.off(),p.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),s.hasClass("visible")||s.addClass("visible"),h()&&c.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):p.off(),i.focus(),s.removeClass("visible")})}),$(function(){var e=function(){const e="sidebar-display";let o=!1;const t=$("body");return{toggle(){!1===o?t.attr(e,""):t.removeAttr(e),o=!o}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),s=$("#panel-wrapper"),a=$("#search-input"),l="topbar-up",r="topbar-down",n="toc-scrolling-up";let o,d=0;const i=t.outerHeight(),c=t.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(o=!0)}),setInterval(function(){o&&(function(){var e,o=$(this).scrollTop();Math.abs(d-o)<=i||(o>d?o>c&&(t.removeClass(r).addClass(l),s.removeClass(r),a.is(":focus")&&a.blur()):o+$(window).height()<$(document).height()&&(void 0!==(e=t.attr(n))?"false"===e&&t.removeAttr(n):(t.removeClass(l).addClass(r),s.addClass(r))),d=o)}(),o=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=(0<o.length?o:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t))}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const e=$(".collapse");e.on("hide.bs.collapse",function(){var e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${e} i.fas`).addClass("rotate"),$("#"+e).removeClass("hide-border-bottom"))}),e.on("show.bs.collapse",function(){var e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${e} i.fas`).removeClass("rotate"),$("#"+e).addClass("hide-border-bottom"))})});
|
||||||
4
assets/js/dist/commons.min.js
vendored
4
assets/js/dist/commons.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.1.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),s=$("#search-cancel"),t=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),d=$("#search-result-wrapper"),r=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),s.addClass("loaded")},off(){s.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),d.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(r.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),d.addClass("unloaded"),t.removeClass("visible"),a.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible:()=>e}}();function h(){return s.hasClass("loaded")}o.click(function(){p.on(),f.on(),i.focus()}),s.click(function(){p.off(),f.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):f.off():""!==i.val()&&(f.on(),t.hasClass("visible")||t.addClass("visible"),h()&&c.addClass("unloaded"))}),t.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),r.empty()):f.off(),i.focus(),t.removeClass("visible")})}),$(function(){const e=function(){let e=!1;const o=$("body");return{toggle(){!1===e?o.attr("sidebar-display",""):o.removeAttr("sidebar-display"),e=!e}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#topbar-wrapper"),o=$("#toc-wrapper"),s=$(".access"),t=$("#search-input");let a,l=0;const n=5,d=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(a=!0)}),setInterval(function(){a&&(!function(){var a=$(this).scrollTop();Math.abs(l-a)<=n||(a>l&&a>d?(e.removeClass("topbar-down").addClass("topbar-up"),o.length>0&&o.removeClass("topbar-down"),s.length>0&&s.removeClass("topbar-down"),t.is(":focus")&&t.blur()):a+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),o.length>0&&o.addClass("topbar-down"),s.length>0&&s.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),s=e.text().trim();let t=o.length>0?o.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==t&&e.text(t):e.text()!==s&&e.text(s)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const o=$(e.target);let t=o.prop("tagName")==="button".toUpperCase()?o:o.parent();t.blur(),flipMode()})}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),l=$("#main"),a=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),a.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),a.removeClass("unloaded"),o.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),l.addClass("unloaded"),e=!0)},off(){e&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),s.removeClass("visible"),l.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible(){return e}}}();function h(){return t.hasClass("loaded")}o.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):f.off():""!==i.val()&&(f.on(),s.hasClass("visible")||s.addClass("visible"),h()&&c.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):f.off(),i.focus(),s.removeClass("visible")})}),$(function(){var e=function(){const e="sidebar-display";let o=!1;const t=$("body");return{toggle(){!1===o?t.attr(e,""):t.removeAttr(e),o=!o}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),s=$("#panel-wrapper"),l=$("#search-input"),a="topbar-up",n="topbar-down",r="toc-scrolling-up";let o,d=0;const i=t.outerHeight(),c=t.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(o=!0)}),setInterval(function(){o&&(function(){var e,o=$(this).scrollTop();Math.abs(d-o)<=i||(o>d?o>c&&(t.removeClass(n).addClass(a),s.removeClass(n),l.is(":focus")&&l.blur()):o+$(window).height()<$(document).height()&&(void 0!==(e=t.attr(r))?"false"===e&&t.removeAttr(r):(t.removeClass(a).addClass(n),s.addClass(n))),d=o)}(),o=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=(0<o.length?o:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t))}),e.click(function(){$("body,html").animate({scrollTop:0},800)})});
|
||||||
4
assets/js/dist/home.min.js
vendored
4
assets/js/dist/home.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.1.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),l=$("#main"),n=$("#topbar-title"),s=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),d=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),p={on(){e.addClass("unloaded"),n.addClass("unloaded"),t.addClass("unloaded"),s.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),s.removeClass("d-flex"),e.removeClass("unloaded"),n.removeClass("unloaded"),t.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),l.addClass("unloaded"),e=!0)},off(){e&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),l.removeClass("unloaded"),u.release(),d.val(""),e=!1)},isVisible:()=>e}}();function h(){return o.hasClass("loaded")}t.click(function(){p.on(),f.on(),d.focus()}),o.click(function(){p.off(),f.off()}),d.focus(function(){s.addClass("input-focus")}),d.focusout(function(){s.removeClass("input-focus")}),d.on("keyup",function(e){8===e.keyCode&&""===d.val()?h()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),h()?(c.removeClass("unloaded"),i.empty()):f.off(),d.focus(),a.removeClass("visible")})}),$(function(){const e=function(){let e=!1;const t=$("body");return{toggle(){!1===e?t.attr("sidebar-display",""):t.removeAttr("sidebar-display"),e=!e}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#topbar-wrapper"),t=$("#toc-wrapper"),o=$(".access"),a=$("#search-input");let l,n=0;const s=5,r=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(l=!0)}),setInterval(function(){l&&(!function(){var l=$(this).scrollTop();Math.abs(n-l)<=s||(l>n&&l>r?(e.removeClass("topbar-down").addClass("topbar-up"),t.length>0&&t.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),a.is(":focus")&&a.blur()):l+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),t.length>0&&t.addClass("topbar-down"),o.length>0&&o.addClass("topbar-down")),n=l)}(),l=!1)},250)}),$(function(){const e=$("#topbar-title"),t=$("div.post>h1"),o=e.text().trim();let a=t.length>0?t.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||t.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==a&&e.text(a):e.text()!==o&&e.text(o)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){let e=$(".timeago").length,t=void 0;const o=$("meta[name=day-prompt]").attr("content"),a=$("meta[name=hour-prompt]").attr("content"),l=$("meta[name=minute-prompt]").attr("content"),n=$("meta[name=justnow-prompt]").attr("content");function s(){return $(".timeago").each(function(){if($(this).children("i").length>0){let t=$(this).clone().children().remove().end().text(),s=$(this).children("i"),r=s.text();$(this).text(function(t,s){let r=new Date,i=new Date(t);if(i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth())return s;let d=Math.floor((r-i)/1e3),c=Math.floor(d/86400);if(c>=1)return e-=1,` ${c} ${o}`;let u=Math.floor(d/3600);if(u>=1)return` ${u} ${a}`;let $=Math.floor(d/60);return $>=1?` ${$} ${l}`:n}(r,t)),$(this).append(s)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&s()>0&&(t=setInterval(s,6e4))});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(t=>{const e=$(t.target);let o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();o.blur(),flipMode()})}),$(function(){const t=$("#sidebar-trigger"),e=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),s=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),d=$("#search-input"),c=$("#search-hints"),u=function(){let t=0;return{block(){t=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(t)},getOffset(){return t}}}(),p={on(){t.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),n.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),n.removeClass("d-flex"),t.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let t=!1;return{on(){t||(u.block(),r.removeClass("unloaded"),s.addClass("unloaded"),t=!0)},off(){t&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),s.removeClass("unloaded"),u.release(),d.val(""),t=!1)},isVisible(){return t}}}();function h(){return o.hasClass("loaded")}e.click(function(){p.on(),f.on(),d.focus()}),o.click(function(){p.off(),f.off()}),d.focus(function(){n.addClass("input-focus")}),d.focusout(function(){n.removeClass("input-focus")}),d.on("keyup",function(t){8===t.keyCode&&""===d.val()?h()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),h()?(c.removeClass("unloaded"),i.empty()):f.off(),d.focus(),a.removeClass("visible")})}),$(function(){var t=function(){const t="sidebar-display";let e=!1;const o=$("body");return{toggle(){!1===e?o.attr(t,""):o.removeAttr(t),e=!e}}}();$("#sidebar-trigger").click(t.toggle),$("#mask").click(t.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const o=$("#topbar-wrapper"),a=$("#panel-wrapper"),s=$("#search-input"),l="topbar-up",n="topbar-down",r="toc-scrolling-up";let e,i=0;const d=o.outerHeight(),c=o.outerHeight();$(window).scroll(function(t){$("#topbar-title").is(":hidden")&&(e=!0)}),setInterval(function(){e&&(function(){var t,e=$(this).scrollTop();Math.abs(i-e)<=d||(e>i?e>c&&(o.removeClass(n).addClass(l),a.removeClass(n),s.is(":focus")&&s.blur()):e+$(window).height()<$(document).height()&&(void 0!==(t=o.attr(r))?"false"===t&&o.removeAttr(r):(o.removeClass(l).addClass(n),a.addClass(n))),i=e)}(),e=!1)},250)}),$(function(){const t=$("#topbar-title"),e=$("div.post>h1"),o=t.text().trim();let a=(0<e.length?e:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||e.is(":hidden")||t.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?t.text()!==a&&t.text(a):t.text()!==o&&t.text(o))}),t.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){let o=$(".timeago").length,t=void 0;const s=$("meta[name=day-prompt]").attr("content"),l=$("meta[name=hour-prompt]").attr("content"),n=$("meta[name=minute-prompt]").attr("content"),r=$("meta[name=justnow-prompt]").attr("content");function e(){return $(".timeago").each(function(){var t,e;!1!==$(this)[0].hasAttribute("date")?(e=function(t,e){let o=new Date,a=new Date(t);return a.getFullYear()!==o.getFullYear()||a.getMonth()!==o.getMonth()?e:(t=Math.floor((o-a)/1e3),1<=(e=Math.floor(t/86400))?` ${e} `+s:1<=(e=Math.floor(t/3600))?` ${e} `+l:1<=(t=Math.floor(t/60))?` ${t} `+n:r)}($(this).attr("date"),t=$(this).text()))===t?$(this).removeAttr("date"):$(this).text(e):--o}),0===o&&void 0!==t&&clearInterval(t),o}0!==o&&0<e()&&(t=setInterval(e,6e4))});
|
||||||
4
assets/js/dist/page.min.js
vendored
4
assets/js/dist/page.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/dist/post.min.js
vendored
4
assets/js/dist/post.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/dist/pvreport.min.js
vendored
4
assets/js/dist/pvreport.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.1.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
const getInitStatus=function(){let e=!1;return()=>{let t=e;return e||(e=!0),t}}(),PvOpts=function(){function e(e){return $(e).attr("content")}function t(t){let a=e(t);return void 0!==a&&!1!==a}return{getProxyMeta:()=>e("meta[name=pv-proxy-endpoint]"),getLocalMeta:()=>e("meta[name=pv-cache-path]"),hasProxyMeta:()=>t("meta[name=pv-proxy-endpoint]"),hasLocalMeta:()=>t("meta[name=pv-cache-path]")}}(),PvStorage=function(){const e={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t="same-origin",a="cors";function o(e){return localStorage.getItem(e)}function r(e,t){localStorage.setItem(e,t)}function n(t,a){r(e.KEY_PV,t),r(e.KEY_PV_SRC,a),r(e.KEY_CREATION,(new Date).toJSON())}return{keysCount:()=>Object.keys(e).length,hasCache:()=>null!==localStorage.getItem(e.KEY_PV),getCache:()=>JSON.parse(localStorage.getItem(e.KEY_PV)),saveLocalCache(e){n(e,t)},saveProxyCache(e){n(e,a)},isExpired(){let t=new Date(o(e.KEY_CREATION));return t.setHours(t.getHours()+1),Date.now()>=t.getTime()},isFromLocal:()=>o(e.KEY_PV_SRC)===t,isFromProxy:()=>o(e.KEY_PV_SRC)===a,newerThan:e=>PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"],inspectKeys(){if(localStorage.length===PvStorage.keysCount())for(let t=0;t<localStorage.length;t++){switch(localStorage.key(t)){case e.KEY_PV:case e.KEY_PV_SRC:case e.KEY_CREATION:break;default:return void localStorage.clear()}}else localStorage.clear()}}}();function countUp(e,t,a){if(e<t){let o=new CountUp(a,e,t);o.error?console.error(o.error):o.start()}}function countPV(e,t){let a=0;if(void 0!==t)for(let o=0;o<t.length;++o){if(t[parseInt(o,10)][0]===e){a+=parseInt(t[parseInt(o,10)][1],10);break}}return a}function tacklePV(e,t,a,o){let r=countPV(t,e);if(r=0===r?1:r,o){const e=parseInt(a.text().replace(/,/g,""),10);r>e&&countUp(e,r,a.attr("id"))}else a.text((new Intl.NumberFormat).format(r))}function displayPageviews(e){if(void 0===e)return;let t=getInitStatus();const a=e.rows;if($("#post-list").length>0)$(".post-preview").each(function(){const e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)});else if($(".post").length>0){const e=window.location.pathname;tacklePV(a,e,$("#pv"),t)}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(e=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(t=>{e&&PvStorage.isFromProxy()&&PvStorage.newerThan(t)||(displayPageviews(t),PvStorage.saveLocalCache(JSON.stringify(t)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
const getInitStatus=function(){let t=!1;return()=>{var e=t;return t=t||!0,e}}(),PvOpts=function(){function t(e){return $(e).attr("content")}function e(e){e=t(e);return void 0!==e&&!1!==e}return{getProxyMeta(){return t("meta[name=pv-proxy-endpoint]")},getLocalMeta(){return t("meta[name=pv-cache-path]")},hasProxyMeta(){return e("meta[name=pv-proxy-endpoint]")},hasLocalMeta(){return e("meta[name=pv-cache-path]")}}}(),PvStorage=function(){const a={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t={LOCAL:"same-origin",PROXY:"cors"};function r(e){return localStorage.getItem(e)}function o(e,t){localStorage.setItem(e,t)}function n(e,t){o(a.KEY_PV,e),o(a.KEY_PV_SRC,t),o(a.KEY_CREATION,(new Date).toJSON())}return{keysCount(){return Object.keys(a).length},hasCache(){return null!==localStorage.getItem(a.KEY_PV)},getCache(){return JSON.parse(localStorage.getItem(a.KEY_PV))},saveLocalCache(e){n(e,t.LOCAL)},saveProxyCache(e){n(e,t.PROXY)},isExpired(){let e=new Date(r(a.KEY_CREATION));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()},isFromLocal(){return r(a.KEY_PV_SRC)===t.LOCAL},isFromProxy(){return r(a.KEY_PV_SRC)===t.PROXY},newerThan(e){return PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"]},inspectKeys(){if(localStorage.length===PvStorage.keysCount())for(let e=0;e<localStorage.length;e++)switch(localStorage.key(e)){case a.KEY_PV:case a.KEY_PV_SRC:case a.KEY_CREATION:break;default:return void localStorage.clear()}else localStorage.clear()}}}();function countUp(t,a,r){if(t<a){let e=new CountUp(r,t,a);e.error?console.error(e.error):e.start()}}function countPV(t,a){let r=0;if(void 0!==a)for(let e=0;e<a.length;++e)if(a[parseInt(e,10)][0]===t){r+=parseInt(a[parseInt(e,10)][1],10);break}return r}function tacklePV(e,t,a,r){let o=countPV(t,e);o=0===o?1:o,r?(r=parseInt(a.text().replace(/,/g,""),10),o>r&&countUp(r,o,a.attr("id"))):a.text((new Intl.NumberFormat).format(o))}function displayPageviews(e){if(void 0!==e){let t=getInitStatus();const a=e.rows;0<$("#post-list").length?$(".post-preview").each(function(){var e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)}):0<$(".post").length&&(e=window.location.pathname,tacklePV(a,e,$("#pv"),t))}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(t=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(e=>{t&&PvStorage.isFromProxy()&&PvStorage.newerThan(e)||(displayPageviews(e),PvStorage.saveLocalCache(JSON.stringify(e)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
||||||
8
assets/js/lib/jquery.disqusloader.min.js
vendored
8
assets/js/lib/jquery.disqusloader.min.js
vendored
@@ -1,8 +0,0 @@
|
|||||||
/*!
|
|
||||||
disqusLoader.js v1.0
|
|
||||||
A JavaScript plugin for lazy-loading Disqus comments widget.
|
|
||||||
-
|
|
||||||
By Osvaldas Valutis, www.osvaldas.info
|
|
||||||
Available for use under the MIT License
|
|
||||||
*/
|
|
||||||
(function(e,g,h,d){var a=e(g),k=function(o,n){var q,p;return function(){var t=this,s=arguments,r=+new Date;q&&r<q+o?(clearTimeout(p),p=setTimeout(function(){q=r,n.apply(t,s)},o)):(q=r,n.apply(t,s))}},m=false,j=false,i=false,c=false,f="unloaded",b=e(),l=function(){if(!b.length||b.data("disqusLoaderStatus")=="loaded"){return true}var n=a.scrollTop();if(b.offset().top-n>a.height()*j||n-b.offset().top-b.outerHeight()-(a.height()*j)>0){return true}e("#disqus_thread").removeAttr("id");b.attr("id","disqus_thread").data("disqusLoaderStatus","loaded");if(f=="loaded"){DISQUS.reset({reload:true,config:i})}else{g.disqus_config=i;if(f=="unloaded"){f="loading";e.ajax({url:c,async:true,cache:true,dataType:"script",success:function(){f="loaded"}})}}};a.on("scroll resize",k(m,l));e.disqusLoader=function(o,n){n=e.extend({},{laziness:1,throttle:250,scriptUrl:false,disqusConfig:false},n);j=n.laziness+1;m=n.throttle;i=n.disqusConfig;c=c===false?n.scriptUrl:c;b=(typeof o=="string"?e(o):o).eq(0);b.data("disqusLoaderStatus","unloaded");l()}})(jQuery,window,document);
|
|
||||||
@@ -1,39 +1,27 @@
|
|||||||
<div align="right">
|
<div align="right">
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy#readme">EN</a> |
|
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md">中文 (简体)</a>
|
[EN](https://github.com/cotes2020/jekyll-theme-chirpy#readme) / 中文
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>Chirpy Jekyll Theme</h1>
|
|
||||||
<p>
|
# Chirpy Jekyll Theme
|
||||||
<a href="https://rubygems.org/gems/jekyll-theme-chirpy">
|
|
||||||
<img alt="Gem Version" src="https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen"></img>
|
一款简约而强大、采用响应式设计的 Jekyll 主题,适合展示专业写作内容。
|
||||||
</a>
|
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush">
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||||
<img alt="Build Status" src="https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?branch=master&event=push"></img>
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
</a>
|
[](https://www.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade)
|
||||||
<a href="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)
|
||||||
<img alt="Codacy Badge" src="https://api.codacy.com/project/badge/Grade/8220b926db514f13afc3f02b7f884f4b"></img>
|
[](https://996.icu)
|
||||||
</a>
|
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE">
|
[**线上体验 →**](https://cotes2020.github.io/chirpy-demo)
|
||||||
<img alt="GitHub license" src="https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg"></img>
|
|
||||||
</a>
|
[](https://cotes2020.github.io/chirpy-demo)
|
||||||
<a href="https://996.icu">
|
|
||||||
<img alt="996.icu" src="https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg"></img>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
一个采用了最简化、侧边栏、响应式设计的 Jekyll 主题,专注于文本展示,旨在帮助您轻松地记录和分享知识。
|
|
||||||
|
|
||||||
[在线体验 »](https://chirpy.cotes.info)
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://chirpy.cotes.info">
|
|
||||||
<img alt="Devices Mockup" src="https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png"></img>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## 功能一览
|
## 功能一览
|
||||||
|
|
||||||
- 本地化外观语言
|
- 本地化外观语言
|
||||||
@@ -54,62 +42,26 @@
|
|||||||
- SEO 优化
|
- SEO 优化
|
||||||
- 网站性能优化
|
- 网站性能优化
|
||||||
|
|
||||||
|
|
||||||
## 前提要求
|
## 前提要求
|
||||||
|
|
||||||
参考 [Jekyll Docs](https://jekyllrb.com/docs/installation/) 安装 `Ruby`,`RubyGems`,`Jekyll` 和 `Bundler`。需要注意的是,`Ruby` 的版本必须与主题在 [RubyGems.org](https://rubygems.org/gems/jekyll-theme-chirpy) 上的要求一致.
|
参考 [Jekyll Docs](https://jekyllrb.com/docs/installation/) 安装 `Ruby`,`RubyGems`,`Jekyll` 和 `Bundler`。
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
有二法可得此主题:
|
### 创建新仓库
|
||||||
|
|
||||||
- **[从 RubyGems 安装](#从-rubygems-安装)** - 易于版本升级,隔离无关的主题项目文件,让您的仓库舒适清爽。
|
有两种方式可以创建一个使用本主题的仓库:
|
||||||
- **[从 GitHub 上 Fork](#从-github-上-fork)** - 对个性化二次开发友好,但是难于升级,只适合专业开发人员使用。
|
|
||||||
|
|
||||||
### 从 RubyGems 安装
|
- [**使用 Chirpy Starter**](#使用-chirpy-starter) - 易于版本升级,隔离无关的主题项目文件,让您的仓库舒适清爽。
|
||||||
|
- [**从 GitHub 上 Fork**](#从-github-上-fork) - 对个性化二次开发友好,但是难于升级。除非您决定魔改此款主题或者参与代码贡献,否则不推荐使用此方式。
|
||||||
|
|
||||||
在您的 Jekyll 站点的 `Gemfile` 添加:
|
#### 使用 Chirpy Starter
|
||||||
|
|
||||||
```ruby
|
[使用 Chirpy Starter][use-starter] 来快速创建 Jekyll 站点,命名为 `<GH_USERNAME>.github.io`,其中 `GH_USERNAME` 是您的 GitHub username。
|
||||||
gem "jekyll-theme-chirpy"
|
|
||||||
```
|
|
||||||
|
|
||||||
然后,添加这行到您的 Jekyll 站点的 `_config.yml`:
|
#### 从 GitHub 上 Fork
|
||||||
|
|
||||||
```yaml
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) 并改名为 `<GH_USERNAME>.github.io`。友情提示:默认分支的代码处于开发状态,如果您想博客更加稳定,请切换到最新的 [Tag][latest-tag] 开始写作。
|
||||||
theme: jekyll-theme-chirpy
|
|
||||||
```
|
|
||||||
|
|
||||||
接着执行:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bundle
|
|
||||||
```
|
|
||||||
|
|
||||||
然后,进入主题的 gem 目录:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ cd "$(bundle info --path jekyll-theme-chirpy)"
|
|
||||||
```
|
|
||||||
|
|
||||||
拷贝运行站点所需主题的 gem 文件(详见 [starter 仓库][starter] 的文件目录)至您的 Jekyll 站点, 然后把主题的 `_config.yml` 全部内容附加到您的 Jekyll 站点的同名文件。
|
|
||||||
|
|
||||||
> ⚠️ **留意重叠的文件!**
|
|
||||||
>
|
|
||||||
> 如果您的网站是通过命令 `jekyll new` 创建的,那么站点的根目录会存在文件 `index.markdown` 和 `about.markdown`。 请务必删除它们, 否则在网站构建后将覆盖主题的 `index.html` 和 `_tabs/about.html`,引起空白或错乱的页面出现。
|
|
||||||
|
|
||||||
作为替代方案,同时也被我们力荐,您可以 [使用 starter template][use-starter] 来快速创建 Jekyll 站点,以省去复制主题 gem 文件的时间。那里早已为您准备好建站需要的一切!
|
|
||||||
|
|
||||||
|
|
||||||
### 从 GitHub 上 Fork
|
|
||||||
|
|
||||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) 然后克隆到本地。(友情提示:默认分支的代码处于开发状态,如果您想博客更加稳定,请切换到最新的 [Tag](https://github.com/cotes2020/jekyll-theme-chirpy/tags) 开始写作。)
|
|
||||||
|
|
||||||
安装依赖:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bundle
|
|
||||||
```
|
|
||||||
|
|
||||||
接着执行文件初始化:
|
接着执行文件初始化:
|
||||||
|
|
||||||
@@ -117,18 +69,29 @@ $ bundle
|
|||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> 如果您不打算部署到 GitHub Pages, 在上述命令后附加参数选项 `--no-gh`。
|
> **注**:如果您不打算部署到 GitHub Pages, 在上述命令后附加参数选项 `--no-gh`。
|
||||||
|
|
||||||
上述脚本完成了以下工作:
|
上述脚本将会:
|
||||||
|
|
||||||
1. 从您的仓库中删除了:
|
1. 从您的仓库中删除了:
|
||||||
|
|
||||||
- `.travis.yml`
|
- `.travis.yml`
|
||||||
- `_posts` 下的文件
|
- `_posts` 下的文件
|
||||||
- `docs` 目录
|
- `docs` 目录
|
||||||
|
|
||||||
2. 如果使用了参数 `--no-gh`,则会怒删 `.github`。否则,将会配置 GitHub Actions:把 `.github/workflows/pages-deploy.yml.hook` 的后缀 `.hook` 去除,然后删除 `.github` 里的其他目录和文件。
|
2. 如果使用了参数 `--no-gh`,则会怒删文件夹 `.github`。否则,配置 GitHub Actions:把 `.github/workflows/pages-deploy.yml.hook` 的后缀 `.hook` 去除,然后删除 `.github` 里的其他目录和文件。
|
||||||
|
|
||||||
3. 自动提交一个 Commit 以保存上述文件的更改。
|
3. 从 `.gitignore` 中删除 `Gemfile.lock`。
|
||||||
|
|
||||||
|
4. 自动提交一个 Commit 以保存上述文件的更改。
|
||||||
|
|
||||||
|
### 安装依赖:
|
||||||
|
|
||||||
|
首次运行本项目,需要先安装依赖:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle
|
||||||
|
```
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
@@ -143,9 +106,9 @@ $ bash tools/init.sh
|
|||||||
|
|
||||||
### 自定义样式
|
### 自定义样式
|
||||||
|
|
||||||
如果您需要自定义样式, 拷贝主题的文件 `assets/css/style.scss` 到您站点的相同路径上,然后在该文件末尾添加样式。
|
如果您需要自定义样式, 拷贝主题的文件 `assets/css/style.scss` 到您站点的相同路径上,然后在该文件末尾添加样式。
|
||||||
|
|
||||||
自 `v4.1.0` 起,如果您想覆盖文件 `_sass/addon/variables.scss` 里定义的 SASS 变量的默认值,新建文件 `_sass/variables-hook.scss`,然后重写您需要的变量即可。
|
自 [`v4.1.0`][chirpy-4.1.0] 起,如果您想覆盖文件 `_sass/addon/variables.scss` 里定义的 SASS 变量的默认值,新建文件 `_sass/variables-hook.scss`,然后重写您需要的变量即可。
|
||||||
|
|
||||||
### 本地运行
|
### 本地运行
|
||||||
|
|
||||||
@@ -164,36 +127,43 @@ $ docker run -it --rm \
|
|||||||
jekyll serve
|
jekyll serve
|
||||||
```
|
```
|
||||||
|
|
||||||
访问本地服务:<http://localhost:4000>
|
稍候片刻,即可访问本地服务:_<http://localhost:4000>_
|
||||||
|
|
||||||
### 部署
|
### 部署
|
||||||
|
|
||||||
部署开始前,把 `_config.yml` 的 `url` 改为 `https://<username>.github.io`(或者您的私有域名,如:`https://yourdomain.com`)。另外,如果您想使用 [Project 类型网站](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites),修改配置文件的 `baseurl` 为项目名称,以斜杠开头,如:`/project`。
|
部署开始前,把 `_config.yml` 的 `url` 改为 `https://<username>.github.io`(或者您的私有域名,如:`https://yourdomain.com`)。另外,如果您想使用 [Project 类型网站](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites),修改配置文件的 `baseurl` 为项目名称,以斜杠开头,如:`/project`。
|
||||||
|
|
||||||
现在您可以选择下列其中一个方式去站点部署。
|
现在您可以选择下列其中一个方式去站点部署。
|
||||||
|
|
||||||
#### 部署到 GitHub Pages
|
#### 使用 GitHub Actions 部署
|
||||||
|
|
||||||
由于安全原因,GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用插件去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
|
由于安全原因,默认的 GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用插件去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
|
||||||
|
|
||||||
快速检查 GitHub Actions 构建需要的文件:
|
快速检查 GitHub Actions 构建需要的文件:
|
||||||
|
|
||||||
- 确保您的 Jekyll 站点存在文件 `.github/workflows/pages-deploy.yml`。没有的话,新建并填入[示例工作流][workflow]的内容, 注意参数 `on.push.branches` 的值必须和您的仓库默认分支名相同。
|
- 确保您的 Jekyll 站点存在文件 `.github/workflows/pages-deploy.yml`。没有的话,新建并填入「[示例 Workflow][workflow]」的内容,注意参数 `on.push.branches` 的值必须和您的仓库默认分支名相同。
|
||||||
- 检查您的 Jekyll 站点是否有文件 `tools/test.sh` 和 `tools/deploy.sh`. 没有的话, 从本仓库拷贝到您的 Jekyll 项目.
|
|
||||||
|
|
||||||
在 GitHub 把您的仓库命名为 `<GH-USERNAME>.github.io`,然后开始发布:
|
- 检查您的 Jekyll 站点是否有文件 `tools/deploy.sh`。没有的话, 从本仓库拷贝到您的 Jekyll 项目。
|
||||||
|
|
||||||
|
- 再者,如果您已经把文件 `Gemfile.lock` 提交到了仓库里面,并且您运行本项目的操作系统不是 Linux,需要添加新的平台信息:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle lock --add-platform x86_64-linux
|
||||||
|
```
|
||||||
|
|
||||||
|
完成上述条目后,到 GitHub 把您的仓库命名为 `<GH-USERNAME>.github.io`,然后开始发布:
|
||||||
|
|
||||||
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
||||||
|
|
||||||
2. 回到 GitHub 上的仓库, 通过 _Settings_ → _Options_ → _GitHub Pages_ 选择分支 `gh-pages` 作为[_发布源_](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site):
|
2. 回到 GitHub 上的仓库,选择标签 _Settings_ → 点击左侧导航栏的 _Pages_ → _GitHub Pages_ 选择分支 `gh-pages` 的 `/(root)` 作为「[发布源][pages-src]」:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. 按照 GitHub 指示的地址去访问您的网站。
|
3. 按照 GitHub 指示的地址去访问您的网站。
|
||||||
|
|
||||||
#### 部署到其他 Pages 平台
|
#### 手动构建部署
|
||||||
|
|
||||||
在 GitHub 之外的平台,例如 GitLab,就没法享受 **GitHub Actions** 的便利了。因此我们需要在本地构建站点(或者在其他第三方 CI 平台),然后推送站点文件到服务器上。
|
在 GitHub 之外的平台,就没法享受 **GitHub Actions** 的便利了。因此您需要在本地构建站点,然后推送站点文件到服务器上。
|
||||||
|
|
||||||
在项目根目录,运行:
|
在项目根目录,运行:
|
||||||
|
|
||||||
@@ -213,27 +183,48 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||
生成的静态文件将会在 `_site`, 把内部的文件上传到服务器即可。
|
生成的静态文件将会在 `_site`, 把内部的文件上传到服务器即可。
|
||||||
|
|
||||||
|
### 升级
|
||||||
|
|
||||||
|
这取决于您如何使用这个 theme:
|
||||||
|
|
||||||
|
- 如果您是使用 theme gem(`Gemfile` 会有 `gem "jekyll-theme-chirpy"`),编辑 `Gemfile` 并更新 them gem 的版本号,譬如:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
|
||||||
|
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
接着执行以下命令:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ bundle update jekyll-theme-chirpy
|
||||||
|
```
|
||||||
|
|
||||||
|
随着 theme 版本的升级,运行站点的必要文件(详见 [Chirpy Starter][starter])以及配置选项会出现变化,请参阅「[升级指南](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide)」的改动细节去保持您仓库中的相关文件同步到最新版本。
|
||||||
|
|
||||||
|
- 如果您是以 fork 的方式使用(您站点的 `Gemfile` 会有 `gemspec`),那么合并上游 [最新的 tag][latest-tag] 到您的 Repo 以完成升级。期间很有可能会产生冲突 (conflicts),请务必耐心谨慎地解决它们。
|
||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
若想要更多细节以及更佳的阅读体验,请参阅 [线上教程](https://chirpy.cotes.info/categories/tutorial/)。 与此同时,[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki) 也有一份教程的拷贝。请注意,Demo 网站和 Wiki 上的文档都是基于最新的发行版本,而 `master` 分支的功能往往领先于现有文档。
|
若想要更多细节以及更佳的阅读体验,请参阅「[线上教程](https://cotes2020.github.io/chirpy-demo/categories/tutorial/)」。 与此同时,「[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki)」也有一份教程的拷贝。请注意,Demo 网站和 Wiki 上的文档都是基于最新的发行版本,而 `master` 分支的功能往往领先于现有文档。
|
||||||
|
|
||||||
## 参与贡献
|
## 参与贡献
|
||||||
|
|
||||||
三人行必有我师,欢迎提报告 bug, 帮助改进代码质量,或者提交新功能。具体操作规则请参考 [贡献指南](../.github/CONTRIBUTING.md),谢谢 🙏。
|
三人行必有我师,欢迎提报告 bug,帮助改进代码质量,或者提交新功能。具体操作规则请参考「[贡献指南](../.github/CONTRIBUTING.md)」,谢谢 🙏。
|
||||||
|
|
||||||
## 鸣谢
|
## 鸣谢
|
||||||
|
|
||||||
这个主题的开发主要基于 [Jekyll](https://jekyllrb.com/) 生态、[Bootstrap](https://getbootstrap.com/)、[Font Awesome](https://fontawesome.com/) 和其他一些出色的工具 (相关文件中可以找到这些工具的版权信息)。头像和图标的设计来自于 [Clipart Max](https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/)。
|
此款主题的开发主要基于 [Jekyll](https://jekyllrb.com/) 生态、[Bootstrap](https://getbootstrap.com/)、[Font Awesome](https://fontawesome.com/) 和其他一些出色的工具 (相关文件中可以找到这些工具的版权信息)。头像和图标的设计来自于 [Clipart Max](https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/)。
|
||||||
|
|
||||||
:tada: 感谢所有参与代码贡献的小伙伴, 他们的 GayHub ID 在这个[列表](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors)。 另外, 提交过 issues(或者未被合并 PR) 的高富帅和白富美也不会被遗忘,他/她们帮助报告 bug、分享新点子或者启发了我写出更通俗易懂的文档。
|
:tada: 感谢所有参与代码贡献的小伙伴,他们的 GayHub ID 在这个「[列表](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors)」。 另外,提交过 issues(或者未被合并 PR)的高富帅和白富美也不会被遗忘,他/她们帮助报告 bug、分享新点子或者启发了我写出更通俗易懂的文档。
|
||||||
|
|
||||||
还有,感谢 [JetBrains][jb] 提供开源 License!
|
还有,感谢 [JetBrains][jb] 提供开源 License!
|
||||||
|
|
||||||
## 赞助
|
## 赞助
|
||||||
|
|
||||||
如果您喜欢这个主题或者它对您有帮助,请考虑打赏作者,您的支持将会极大地鼓励作者,并帮助作者更好地维护项目!
|
如果您喜欢此款主题或者它对您有帮助,请考虑打赏作者,您的支持将会极大地鼓励作者,并帮助作者更好地维护项目!
|
||||||
|
|
||||||
[](https://www.buymeacoffee.com/coteschung)
|
[](https://ko-fi.com/coteschung)
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
|
|
||||||
@@ -244,6 +235,9 @@ $ docker run -it --rm \
|
|||||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
[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
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
|
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
||||||
|
[pages-src]: https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
|
||||||
|
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
||||||
|
|
||||||
<!-- ReadMe links -->
|
<!-- ReadMe links -->
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const postJs = () => {
|
|||||||
`${JS_SRC}/utils/img-extra.js`,
|
`${JS_SRC}/utils/img-extra.js`,
|
||||||
`${JS_SRC}/utils/timeago.js`,
|
`${JS_SRC}/utils/timeago.js`,
|
||||||
`${JS_SRC}/utils/checkbox.js`,
|
`${JS_SRC}/utils/checkbox.js`,
|
||||||
`${JS_SRC}/utils/copy-link.js`,
|
`${JS_SRC}/utils/clipboard.js`,
|
||||||
// 'smooth-scroll.js' must be called after ToC is ready
|
// 'smooth-scroll.js' must be called after ToC is ready
|
||||||
`${JS_SRC}/utils/smooth-scroll.js`
|
`${JS_SRC}/utils/smooth-scroll.js`
|
||||||
], 'post'
|
], 'post'
|
||||||
@@ -66,7 +66,7 @@ const pageJs = () => {
|
|||||||
`${JS_SRC}/commons/*.js`,
|
`${JS_SRC}/commons/*.js`,
|
||||||
`${JS_SRC}/utils/checkbox.js`,
|
`${JS_SRC}/utils/checkbox.js`,
|
||||||
`${JS_SRC}/utils/img-extra.js`,
|
`${JS_SRC}/utils/img-extra.js`,
|
||||||
`${JS_SRC}/utils/copy-link.js`,
|
`${JS_SRC}/utils/clipboard.js`
|
||||||
], 'page'
|
], 'page'
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -89,6 +89,5 @@ exports.liveRebuild = () => {
|
|||||||
`${ JS_SRC }/lib/*.js`
|
`${ JS_SRC }/lib/*.js`
|
||||||
],
|
],
|
||||||
buildJs
|
buildJs
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "jekyll-theme-chirpy"
|
spec.name = "jekyll-theme-chirpy"
|
||||||
spec.version = "4.1.1"
|
spec.version = "5.0.0"
|
||||||
spec.authors = ["Cotes Chung"]
|
spec.authors = ["Cotes Chung"]
|
||||||
spec.email = ["cotes.chung@gmail.com"]
|
spec.email = ["cotes.chung@gmail.com"]
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|||||||
"plugin_type" => "theme"
|
"plugin_type" => "theme"
|
||||||
}
|
}
|
||||||
|
|
||||||
spec.required_ruby_version = [">= 2.4", "< 3.0"]
|
spec.required_ruby_version = ">= 2.4"
|
||||||
|
|
||||||
spec.add_runtime_dependency "jekyll", "~> 4.1"
|
spec.add_runtime_dependency "jekyll", "~> 4.1"
|
||||||
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
|
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jekyll-theme-chirpy",
|
"name": "jekyll-theme-chirpy",
|
||||||
"version": "4.1.1",
|
"version": "5.0.0",
|
||||||
"description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.",
|
"description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
@@ -25,6 +25,6 @@
|
|||||||
"gulp-insert": "^0.5.0",
|
"gulp-insert": "^0.5.0",
|
||||||
"gulp-rename": "^2.0.0",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-uglify": "^3.0.2",
|
"gulp-uglify": "^3.0.2",
|
||||||
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony"
|
"uglify-js": "^3.14.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
120
tools/bump.sh
120
tools/bump.sh
@@ -1,11 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# How does it work:
|
|
||||||
#
|
#
|
||||||
# 1. Cherry pick the latest commit from default branch
|
# 1. Bump latest version number to the following files:
|
||||||
# to the target release branch if the target release branch already existed.
|
|
||||||
#
|
|
||||||
# 2. Bump latest version number to the following files:
|
|
||||||
#
|
#
|
||||||
# - _sass/jekyll-theme-chirpy.scss
|
# - _sass/jekyll-theme-chirpy.scss
|
||||||
# - _javascript/copyright
|
# - _javascript/copyright
|
||||||
@@ -13,22 +9,16 @@
|
|||||||
# - jekyll-theme-chirpy.gemspec
|
# - jekyll-theme-chirpy.gemspec
|
||||||
# - package.json
|
# - package.json
|
||||||
#
|
#
|
||||||
# 3. Create a git-tag on release branch
|
# 2. Then create a commit to automatically save the changes.
|
||||||
#
|
|
||||||
# 4. Build a RubyGems package base on the latest git-tag
|
|
||||||
#
|
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
#
|
#
|
||||||
# Run on default branch, if run on other branch requires parameter '-m' (manual mode).
|
# Run on the default branch or hotfix branch
|
||||||
#
|
#
|
||||||
#
|
# Requires: Git, Gulp
|
||||||
# Requires: Git, Gulp, RubyGems
|
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
opt_manual=false
|
|
||||||
|
|
||||||
ASSETS=(
|
ASSETS=(
|
||||||
"_sass/jekyll-theme-chirpy.scss"
|
"_sass/jekyll-theme-chirpy.scss"
|
||||||
"_javascript/copyright"
|
"_javascript/copyright"
|
||||||
@@ -38,10 +28,6 @@ GEM_SPEC="jekyll-theme-chirpy.gemspec"
|
|||||||
|
|
||||||
NODE_META="package.json"
|
NODE_META="package.json"
|
||||||
|
|
||||||
DEFAULT_BRANCH="master"
|
|
||||||
|
|
||||||
_working_branch="$(git branch --show-current)"
|
|
||||||
|
|
||||||
_check_src() {
|
_check_src() {
|
||||||
if [[ ! -f $1 && ! -d $1 ]]; then
|
if [[ ! -f $1 && ! -d $1 ]]; then
|
||||||
echo -e "Error: Missing file \"$1\"!\n"
|
echo -e "Error: Missing file \"$1\"!\n"
|
||||||
@@ -55,12 +41,6 @@ check() {
|
|||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ensure working on default branch or running in 'manual' mode
|
|
||||||
if [[ $_working_branch != $DEFAULT_BRANCH && $opt_manual == "false" ]]; then
|
|
||||||
echo "Error: This operation must be performed on the 'master' branch or '--manual' mode!"
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for i in "${!ASSETS[@]}"; do
|
for i in "${!ASSETS[@]}"; do
|
||||||
_check_src "${ASSETS[$i]}"
|
_check_src "${ASSETS[$i]}"
|
||||||
done
|
done
|
||||||
@@ -98,77 +78,6 @@ bump() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
build_gem() {
|
|
||||||
rm -f ./*.gem
|
|
||||||
gem build "$GEM_SPEC"
|
|
||||||
}
|
|
||||||
|
|
||||||
release() {
|
|
||||||
_version="$1"
|
|
||||||
_major=""
|
|
||||||
_minor=""
|
|
||||||
_new_release_branch=false
|
|
||||||
|
|
||||||
IFS='.' read -r -a array <<< "$_version"
|
|
||||||
|
|
||||||
for elem in "${array[@]}"; do
|
|
||||||
if [[ -z $_major ]]; then
|
|
||||||
_major="$elem"
|
|
||||||
elif [[ -z $_minor ]]; then
|
|
||||||
_minor="$elem"
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
_release_branch="$_major-$_minor-stable"
|
|
||||||
|
|
||||||
if $opt_manual; then
|
|
||||||
echo -e "Bump version to $_version (manual release)\n"
|
|
||||||
bump "$_version"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $(git branch -v | grep "$_release_branch") ]]; then
|
|
||||||
git checkout -b "$_release_branch"
|
|
||||||
_new_release_branch=true
|
|
||||||
else
|
|
||||||
git checkout "$_release_branch"
|
|
||||||
# cherry-pick the latest commit from master branch to release branch
|
|
||||||
git cherry-pick "$(git rev-parse $DEFAULT_BRANCH)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "Bump version to $_version\n"
|
|
||||||
bump "$_version"
|
|
||||||
|
|
||||||
echo -e "Create tag v$_version\n"
|
|
||||||
git tag "v$_version"
|
|
||||||
|
|
||||||
echo -e "Build the gem pakcage for v$_version\n"
|
|
||||||
build_gem
|
|
||||||
|
|
||||||
# head back to working branch
|
|
||||||
git checkout "$_working_branch"
|
|
||||||
|
|
||||||
if [[ $_working_branch == $DEFAULT_BRANCH ]]; then
|
|
||||||
if $_new_release_branch; then
|
|
||||||
git merge "$_release_branch"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
help() {
|
|
||||||
echo "Bump new version to Chirpy project"
|
|
||||||
echo "Usage:"
|
|
||||||
echo
|
|
||||||
echo " bash /path/to/bump.sh [options]"
|
|
||||||
echo
|
|
||||||
echo "Options:"
|
|
||||||
echo " -m, --manual Manual relase, bump version only."
|
|
||||||
echo " -h, --help Print this help information."
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
check
|
check
|
||||||
|
|
||||||
@@ -185,7 +94,8 @@ main() {
|
|||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
release "$_version"
|
echo -e "Bump version to $_version\n"
|
||||||
|
bump "$_version"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@@ -194,22 +104,4 @@ main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (($#)); do
|
|
||||||
opt="$1"
|
|
||||||
case $opt in
|
|
||||||
-m | --manual)
|
|
||||||
opt_manual=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-h | --help)
|
|
||||||
help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unknown option '$opt'!"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
107
tools/deploy.sh
107
tools/deploy.sh
@@ -1,22 +1,80 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Deploy the content of _site to 'origin/<pages_branch>'
|
# Build, test and then deploy the site content to 'origin/<pages_branch>'
|
||||||
|
#
|
||||||
|
# Requirement: html-proofer, jekyll
|
||||||
|
#
|
||||||
|
# Usage: See help information
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
PAGES_BRANCH="gh-pages"
|
PAGES_BRANCH="gh-pages"
|
||||||
|
|
||||||
_no_branch=false
|
SITE_DIR="_site"
|
||||||
|
|
||||||
|
_opt_dry_run=false
|
||||||
|
|
||||||
|
_config="_config.yml"
|
||||||
|
|
||||||
|
_no_pages_branch=false
|
||||||
|
|
||||||
_backup_dir="$(mktemp -d)"
|
_backup_dir="$(mktemp -d)"
|
||||||
|
|
||||||
|
_baseurl=""
|
||||||
|
|
||||||
|
help() {
|
||||||
|
echo "Build, test and then deploy the site content to 'origin/<pages_branch>'"
|
||||||
|
echo
|
||||||
|
echo "Usage:"
|
||||||
|
echo
|
||||||
|
echo " bash ./tools/deploy.sh [options]"
|
||||||
|
echo
|
||||||
|
echo "Options:"
|
||||||
|
echo ' -c, --config "<config_a[,config_b[...]]>" Specify config file(s)'
|
||||||
|
echo " --dry-run Build site and test, but not deploy"
|
||||||
|
echo " -h, --help Print this information."
|
||||||
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
if [[ -z ${GITHUB_ACTION+x} ]]; then
|
if [[ -z ${GITHUB_ACTION+x} && $_opt_dry_run == 'false' ]]; then
|
||||||
echo "ERROR: This script is not allowed to run outside of GitHub Action."
|
echo "ERROR: It is not allowed to deploy outside of the GitHub Action envrionment."
|
||||||
|
echo "Type option '-h' to see the help information."
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
_baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
# clean up
|
||||||
|
if [[ -d $SITE_DIR ]]; then
|
||||||
|
rm -rf "$SITE_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# build
|
||||||
|
JEKYLL_ENV=production bundle exec jekyll b -d "$SITE_DIR$_baseurl" --config "$_config"
|
||||||
|
}
|
||||||
|
|
||||||
|
test() {
|
||||||
|
bundle exec htmlproofer \
|
||||||
|
--disable-external \
|
||||||
|
--check-html \
|
||||||
|
--allow_hash_href \
|
||||||
|
"$SITE_DIR"
|
||||||
|
}
|
||||||
|
|
||||||
|
resume_site_dir() {
|
||||||
|
if [[ -n $_baseurl ]]; then
|
||||||
|
# Move the site file to the regular directory '_site'
|
||||||
|
mv "$SITE_DIR$_baseurl" "${SITE_DIR}-rename"
|
||||||
|
rm -rf "$SITE_DIR"
|
||||||
|
mv "${SITE_DIR}-rename" "$SITE_DIR"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_gh() {
|
||||||
if [[ -z $(git branch -av | grep "$PAGES_BRANCH") ]]; then
|
if [[ -z $(git branch -av | grep "$PAGES_BRANCH") ]]; then
|
||||||
_no_branch=true
|
_no_pages_branch=true
|
||||||
git checkout -b "$PAGES_BRANCH"
|
git checkout -b "$PAGES_BRANCH"
|
||||||
else
|
else
|
||||||
git checkout "$PAGES_BRANCH"
|
git checkout "$PAGES_BRANCH"
|
||||||
@@ -24,7 +82,7 @@ init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
backup() {
|
backup() {
|
||||||
mv _site/* "$_backup_dir"
|
mv "$SITE_DIR"/* "$_backup_dir"
|
||||||
mv .git "$_backup_dir"
|
mv .git "$_backup_dir"
|
||||||
|
|
||||||
# When adding custom domain from Github website,
|
# When adding custom domain from Github website,
|
||||||
@@ -40,6 +98,7 @@ flush() {
|
|||||||
|
|
||||||
shopt -s dotglob nullglob
|
shopt -s dotglob nullglob
|
||||||
mv "$_backup_dir"/* .
|
mv "$_backup_dir"/* .
|
||||||
|
[[ -f ".nojekyll" ]] || echo "" >".nojekyll"
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
@@ -50,7 +109,7 @@ deploy() {
|
|||||||
git add -A
|
git add -A
|
||||||
git commit -m "[Automation] Site update No.${GITHUB_RUN_NUMBER}"
|
git commit -m "[Automation] Site update No.${GITHUB_RUN_NUMBER}"
|
||||||
|
|
||||||
if $_no_branch; then
|
if $_no_pages_branch; then
|
||||||
git push -u origin "$PAGES_BRANCH"
|
git push -u origin "$PAGES_BRANCH"
|
||||||
else
|
else
|
||||||
git push -f
|
git push -f
|
||||||
@@ -59,9 +118,43 @@ deploy() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
init
|
init
|
||||||
|
build
|
||||||
|
test
|
||||||
|
resume_site_dir
|
||||||
|
|
||||||
|
if $_opt_dry_run; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
setup_gh
|
||||||
backup
|
backup
|
||||||
flush
|
flush
|
||||||
deploy
|
deploy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (($#)); do
|
||||||
|
opt="$1"
|
||||||
|
case $opt in
|
||||||
|
-c | --config)
|
||||||
|
_config="$2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--dry-run)
|
||||||
|
# build & test, but not deploy
|
||||||
|
_opt_dry_run=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-h | --help)
|
||||||
|
help
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# unknown option
|
||||||
|
help
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ set -eu
|
|||||||
|
|
||||||
ACTIONS_WORKFLOW=pages-deploy.yml
|
ACTIONS_WORKFLOW=pages-deploy.yml
|
||||||
|
|
||||||
|
TEMP_SUFFIX="to-delete" # temporary file suffixes that make `sed -i` compatible with BSD and Linux
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo
|
echo
|
||||||
@@ -16,6 +18,13 @@ help() {
|
|||||||
echo " -h, --help Print this help information."
|
echo " -h, --help Print this help information."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_status() {
|
||||||
|
if [[ -n $(git status . -s) ]]; then
|
||||||
|
echo "Error: Commit unstaged files first, and then run this tool againt."
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_init() {
|
check_init() {
|
||||||
local _has_inited=false
|
local _has_inited=false
|
||||||
|
|
||||||
@@ -40,25 +49,48 @@ check_init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
init_files() {
|
init_files() {
|
||||||
|
|
||||||
if $_no_gh; then
|
if $_no_gh; then
|
||||||
rm -rf .github
|
rm -rf .github
|
||||||
else
|
else
|
||||||
|
## Change the files of `.github`
|
||||||
|
|
||||||
mv .github/workflows/$ACTIONS_WORKFLOW.hook .
|
mv .github/workflows/$ACTIONS_WORKFLOW.hook .
|
||||||
rm -rf .github
|
rm -rf .github
|
||||||
mkdir -p .github/workflows
|
mkdir -p .github/workflows
|
||||||
mv ./${ACTIONS_WORKFLOW}.hook .github/workflows/${ACTIONS_WORKFLOW}
|
mv ./${ACTIONS_WORKFLOW}.hook .github/workflows/${ACTIONS_WORKFLOW}
|
||||||
|
|
||||||
|
## Ensure the gh-actions trigger branch
|
||||||
|
|
||||||
|
_workflow=".github/workflows/${ACTIONS_WORKFLOW}"
|
||||||
|
_default_branch="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
|
||||||
|
_lineno="$(sed -n "/branches:/=" "$_workflow")"
|
||||||
|
|
||||||
|
sed -i.$TEMP_SUFFIX "$((_lineno + 1))s/- .*/- ${_default_branch}/" "$_workflow"
|
||||||
|
rm -f "$_workflow.$TEMP_SUFFIX"
|
||||||
|
|
||||||
|
## Cleanup image settings in site config
|
||||||
|
sed -i.$TEMP_SUFFIX "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml
|
||||||
|
rm -f _config.yml.$TEMP_SUFFIX
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# trace the gem lockfile on user-end
|
||||||
|
sed -i.$TEMP_SUFFIX "/Gemfile.lock/d" .gitignore
|
||||||
|
rm -f ".gitignore.$TEMP_SUFFIX"
|
||||||
|
|
||||||
|
# remove the other fies
|
||||||
rm -f .travis.yml
|
rm -f .travis.yml
|
||||||
rm -rf _posts/* docs
|
rm -rf _posts/* docs
|
||||||
|
|
||||||
git add -A && git add .github -f
|
# save changes
|
||||||
|
git add -A
|
||||||
git commit -m "[Automation] Initialize the environment." -q
|
git commit -m "[Automation] Initialize the environment." -q
|
||||||
|
|
||||||
echo "[INFO] Initialization successful!"
|
echo "[INFO] Initialization successful!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_status
|
||||||
|
|
||||||
check_init
|
check_init
|
||||||
|
|
||||||
_no_gh=false
|
_no_gh=false
|
||||||
|
|||||||
73
tools/release.sh
Executable file
73
tools/release.sh
Executable file
@@ -0,0 +1,73 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# According to the GitLab flow release branching model,
|
||||||
|
# cherry-pick the last commit on the main branch to the release branch,
|
||||||
|
# and then create a tag and gem package on the release branch (naming format: 'release/<X.Y>').
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# It can be run on main branch, and it should be used after just finishing the last feature in the version plan,
|
||||||
|
# or just after merging the hotfix to the main branch.
|
||||||
|
#
|
||||||
|
# Requires: Git, Gulp
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
GEM_SPEC="jekyll-theme-chirpy.gemspec"
|
||||||
|
|
||||||
|
check() {
|
||||||
|
if [[ -n $(git status . -s) ]]; then
|
||||||
|
echo "Error: Commit unstaged files first, and then run this tool againt."
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f $GEM_SPEC ]]; then
|
||||||
|
echo -e "Error: Missing file \"$GEM_SPEC\"!\n"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## Remove unnecessary theme settings
|
||||||
|
cleanup_config() {
|
||||||
|
cp _config.yml _config.yml.bak
|
||||||
|
sed -i "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml
|
||||||
|
}
|
||||||
|
|
||||||
|
resume_config() {
|
||||||
|
mv _config.yml.bak _config.yml
|
||||||
|
}
|
||||||
|
|
||||||
|
release() {
|
||||||
|
_default_branch="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
|
||||||
|
_version="$(grep "spec.version" jekyll-theme-chirpy.gemspec | sed 's/.*= "//;s/".*//')" # X.Y.Z
|
||||||
|
_release_branch="release/${_version%.*}"
|
||||||
|
|
||||||
|
if [[ -z $(git branch -v | grep "$_release_branch") ]]; then
|
||||||
|
# create a new release branch
|
||||||
|
git checkout -b "$_release_branch"
|
||||||
|
else
|
||||||
|
# cherry-pick the latest commit from default branch to release branch
|
||||||
|
_last_commit="$(git rev-parse "$_default_branch")"
|
||||||
|
git checkout "$_release_branch"
|
||||||
|
git cherry-pick "$_last_commit" -m 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create new tag
|
||||||
|
echo -e "Create tag v$_version\n"
|
||||||
|
git tag "v$_version"
|
||||||
|
|
||||||
|
# build a gem package
|
||||||
|
echo -e "Build the gem pakcage for v$_version\n"
|
||||||
|
cleanup_config
|
||||||
|
rm -f ./*.gem
|
||||||
|
gem build "$GEM_SPEC"
|
||||||
|
resume_config
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
check
|
||||||
|
release
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Using HTML-proofer to test site.
|
|
||||||
#
|
|
||||||
# Requirement: https://github.com/gjtorikian/html-proofer
|
|
||||||
#
|
|
||||||
# Usage: bash /path/to/test.sh [indicated path]
|
|
||||||
|
|
||||||
DEST=_site
|
|
||||||
|
|
||||||
_build=false
|
|
||||||
|
|
||||||
help() {
|
|
||||||
echo "Usage:"
|
|
||||||
echo
|
|
||||||
echo " bash ./tools/test.sh [options]"
|
|
||||||
echo
|
|
||||||
echo "Options:"
|
|
||||||
echo " --build Run Jekyll build before test."
|
|
||||||
echo " -d, --dir <path> Specify the test path."
|
|
||||||
echo " -h, --help Print this information."
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ -n $1 && -d $1 ]]; then
|
|
||||||
DEST=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
while (($#)); do
|
|
||||||
opt="$1"
|
|
||||||
case $opt in
|
|
||||||
--build)
|
|
||||||
_build=true
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-d | --dir)
|
|
||||||
if [[ ! -d $2 ]]; then
|
|
||||||
echo -e "Error: path '$2' doesn't exist\n"
|
|
||||||
help
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
DEST=$2
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-h | --help)
|
|
||||||
help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# unknown option
|
|
||||||
help
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if $_build; then
|
|
||||||
JEKYLL_ENV=production bundle exec jekyll b
|
|
||||||
fi
|
|
||||||
|
|
||||||
bundle exec htmlproofer "$DEST" \
|
|
||||||
--disable-external \
|
|
||||||
--check-html \
|
|
||||||
--allow_hash_href
|
|
||||||
Reference in New Issue
Block a user