mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 14:14:17 +00:00
Compare commits
166 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
493e1d934b | ||
|
|
b9104d0f4c | ||
|
|
3c72298563 | ||
|
|
ca2194770c | ||
|
|
08fbd06c63 | ||
|
|
a20fd5bf6f | ||
|
|
7a88347c63 | ||
|
|
813443b206 | ||
|
|
c381353f86 | ||
|
|
aa6c33526a | ||
|
|
081e77d462 | ||
|
|
bca7a2a634 | ||
|
|
505da84a26 | ||
|
|
dfba411d61 | ||
|
|
fa310d3190 | ||
|
|
ef0c9ce770 | ||
|
|
7429ef3539 | ||
|
|
6d4abcc437 | ||
|
|
5bdea71622 | ||
|
|
8e0004146b | ||
|
|
557413cc4c | ||
|
|
6dc6f2a7cf | ||
|
|
8e5d8b8931 | ||
|
|
260a906b11 | ||
|
|
5ffbfaec26 | ||
|
|
b9ffe15ffb | ||
|
|
87ba30a393 | ||
|
|
cb984aa021 | ||
|
|
0225d28fd3 | ||
|
|
aba3d25d7a | ||
|
|
dc88321ed5 | ||
|
|
cc24af11fc | ||
|
|
d70354021c | ||
|
|
d61446fafc | ||
|
|
d0a8d072fd | ||
|
|
9d59461632 | ||
|
|
cea339088b | ||
|
|
07d29ec9bf | ||
|
|
464fa001b2 | ||
|
|
53a98feff3 | ||
|
|
b8ee5a7b0c | ||
|
|
289ce1263d | ||
|
|
63f57fbc12 | ||
|
|
cdaa79cf80 | ||
|
|
d53769e52b | ||
|
|
7de13415e7 | ||
|
|
d196645d88 | ||
|
|
4d2f13c0d7 | ||
|
|
5ed39300cb | ||
|
|
d7d3bc9947 | ||
|
|
cf3943342a | ||
|
|
59deef469d | ||
|
|
bb13b52d44 | ||
|
|
8d4c555638 | ||
|
|
cbf707dc56 | ||
|
|
6335991164 | ||
|
|
5d6014ecee | ||
|
|
13aca77275 | ||
|
|
1172f1646d | ||
|
|
e27825d3eb | ||
|
|
36c4f32b17 | ||
|
|
6a326dc8e0 | ||
|
|
20c14c0207 | ||
|
|
575b5c292a | ||
|
|
479bd72c9d | ||
|
|
f2efae8b01 | ||
|
|
8b2e6d1bf5 | ||
|
|
0250a9c9f4 | ||
|
|
bbfbda7562 | ||
|
|
a33b2d78b0 | ||
|
|
1280f89217 | ||
|
|
83bfd32807 | ||
|
|
4ea320b250 | ||
|
|
8909438267 | ||
|
|
9482249999 | ||
|
|
43d4036941 | ||
|
|
a410600205 | ||
|
|
864119e3cc | ||
|
|
4702244ae8 | ||
|
|
b985965bc9 | ||
|
|
a5b002b2d8 | ||
|
|
270d3ba499 | ||
|
|
1f2ed3db60 | ||
|
|
08354cc4f5 | ||
|
|
ea56a900a0 | ||
|
|
8fa1f3b497 | ||
|
|
10bc44367a | ||
|
|
1889b6b4e0 | ||
|
|
aac29d43e5 | ||
|
|
c340199191 | ||
|
|
c7241ba611 | ||
|
|
d7f351b143 | ||
|
|
62aef9f850 | ||
|
|
7d128769f6 | ||
|
|
8d4c1deb15 | ||
|
|
57a4bfdb82 | ||
|
|
5741aa4e18 | ||
|
|
ad5b614304 | ||
|
|
4f1735aad6 | ||
|
|
38b87cfdd7 | ||
|
|
bf8996fb8b | ||
|
|
2bd99ffd33 | ||
|
|
46a8efb38a | ||
|
|
b9fb716e6a | ||
|
|
154fb04987 | ||
|
|
a95d6d7101 | ||
|
|
c98fd19900 | ||
|
|
3c2675c4a1 | ||
|
|
db5a58638d | ||
|
|
2a2bc1ee65 | ||
|
|
e806a8556b | ||
|
|
049b486f82 | ||
|
|
8f11f91677 | ||
|
|
d314c02a13 | ||
|
|
ea5b6cf1f6 | ||
|
|
cb908bbb2b | ||
|
|
c221a3e0bc | ||
|
|
ddc1149fb5 | ||
|
|
944d0ad724 | ||
|
|
67d962d707 | ||
|
|
04ad7bf432 | ||
|
|
a0f80debb1 | ||
|
|
f932cf0d00 | ||
|
|
8484a34195 | ||
|
|
2cf5a58adf | ||
|
|
6f7ca13507 | ||
|
|
766e597a3b | ||
|
|
d0d1e02763 | ||
|
|
643c8177be | ||
|
|
092ab5bbdb | ||
|
|
e47f73f772 | ||
|
|
2d8854ba74 | ||
|
|
36fab37225 | ||
|
|
13abcd5958 | ||
|
|
9dcab7ac1f | ||
|
|
d78f034f5d | ||
|
|
c473771af4 | ||
|
|
252e33b502 | ||
|
|
232dd36b78 | ||
|
|
2d7df50774 | ||
|
|
31656e8cda | ||
|
|
e96f9051c0 | ||
|
|
cb461df071 | ||
|
|
e439e65258 | ||
|
|
3a449672cb | ||
|
|
7bb861b573 | ||
|
|
f0b4e30363 | ||
|
|
717a501c36 | ||
|
|
3ddf5047b5 | ||
|
|
31ac709e04 | ||
|
|
a1b2c71b89 | ||
|
|
e9c29aa1b5 | ||
|
|
f947c3f3d3 | ||
|
|
78e8ffd7ba | ||
|
|
60a8a2fa41 | ||
|
|
9e14673349 | ||
|
|
10ab9d3364 | ||
|
|
038bccb3ca | ||
|
|
9b35380849 | ||
|
|
a8f8bbaa1c | ||
|
|
188d8ffc69 | ||
|
|
0809e2b132 | ||
|
|
ab0adc36cf | ||
|
|
d4397dff08 | ||
|
|
db06610fd6 | ||
|
|
c242cf8455 |
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
# 2 space indentation
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
16
.gitattributes
vendored
Normal file
16
.gitattributes
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Force bash scripts to always use LF line endings so that if a repo is accessed
|
||||||
|
# in Unix via a file share from Windows, the scripts will work.
|
||||||
|
*.sh text eol=lf
|
||||||
|
|
||||||
|
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
|
||||||
|
# in Windows via a file share from Linux, the scripts will work.
|
||||||
|
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||||
|
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||||
|
|
||||||
|
# Denote all files that are truly binary and should not be modified.
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.ico binary
|
||||||
19
.github/CODE_OF_CONDUCT.md
vendored
19
.github/CODE_OF_CONDUCT.md
vendored
@@ -11,8 +11,7 @@ appearance, race, religion, or sexual identity and orientation.
|
|||||||
|
|
||||||
## Our Standards
|
## Our Standards
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment include:
|
||||||
include:
|
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
* Using welcoming and inclusive language
|
||||||
* Being respectful of differing viewpoints and experiences
|
* Being respectful of differing viewpoints and experiences
|
||||||
@@ -22,12 +21,10 @@ include:
|
|||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||||
advances
|
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
* Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||||
address, without explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
@@ -55,7 +52,7 @@ further defined and clarified by project maintainers.
|
|||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported by contacting the project team at cotes.chung@gmail.com. All
|
reported by contacting the project team at `cotes.chung@gmail.com`. All
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
@@ -68,9 +65,9 @@ members of the project's leadership.
|
|||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see
|
For answers to common questions about this code of conduct, see
|
||||||
https://www.contributor-covenant.org/faq
|
<https://www.contributor-covenant.org/faq>
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@@ -7,15 +7,9 @@ To ensure that the blog design is not confused, this project does not accept sug
|
|||||||
Generally, contribute to the project by:
|
Generally, contribute to the project by:
|
||||||
|
|
||||||
1. Fork this project on GitHub and clone it locally.
|
1. Fork this project on GitHub and clone it locally.
|
||||||
2. Create a new branch named `feature/my-feature` (or `feature/fix-a-bug`), which branch from `develop`:
|
2. Create a new branch from `master` and give it a descriptive name (e.g., `my-new-feature`, `fix-a-bug`).
|
||||||
|
|
||||||
```console
|
|
||||||
$ git checkout -b feature/<my-feature> develop
|
|
||||||
```
|
|
||||||
> Please note that the new branch name must include the prefix `feature/`.
|
|
||||||
|
|
||||||
3. After completing the development, commit and push to remote.
|
3. After completing the development, commit and push to remote.
|
||||||
4. Submit a new **pull request** to the `develop` branch of upstream, i.e., `cotes2020/jekyll-theme-chirpy:develop`.
|
4. Submit a new pull request.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,10 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Bug Report
|
name: Bug Report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
labels: bug
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Note: Please follow the template to open a new issue, otherwise your question will probably be ignored. -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||||
@@ -12,38 +11,44 @@ labels: bug
|
|||||||
- [ ] There are no similar reports on existing issues (including closed ones).
|
- [ ] There are no similar reports on existing issues (including closed ones).
|
||||||
- [ ] I found the bug on the latest code of `master` branch.
|
- [ ] I found the bug on the latest code of `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
|
||||||
|
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
|
<!--
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
2. Click on '....'
|
2. Click on '....'
|
||||||
3. Scroll down to '....'
|
3. Scroll down to '....'
|
||||||
4. See error
|
4. See error
|
||||||
|
-->
|
||||||
|
|
||||||
|
### Expected behavior
|
||||||
**Expected behavior**
|
|
||||||
<!-- A clear and concise description of what you expected to happen. -->
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
**Screenshots**
|
### Screenshots
|
||||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||||
|
|
||||||
**Desktop**
|
### Software
|
||||||
<!-- Please complete the following information -->
|
<!-- Please complete the following information -->
|
||||||
- OS: [e.g. iOS]
|
- Ruby version: <!-- by running: `ruby -v` -->
|
||||||
- Browser: [e.g. chrome, safari]
|
- Gem version: <!-- by running: `gem -v`-->
|
||||||
- Version: [e.g. 22]
|
- Bundler version: <!-- by running: `bundle -v`-->
|
||||||
|
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
|
||||||
|
|
||||||
**Smartphone**
|
### Desktop
|
||||||
<!-- please complete the following information -->
|
<!-- If necessary, uncomment and fill in the following list:
|
||||||
- Device: [e.g. iPhone6]
|
- OS: [e.g. macOS 10.15.6]
|
||||||
- OS: [e.g. iOS8.1]
|
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
|
||||||
- Browser: [e.g. stock browser, safari]
|
-->
|
||||||
- Version: [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
### Smartphone
|
||||||
|
<!-- If necessary, uncomment and fill in the following list:
|
||||||
|
- Device: [e.g. iPhone 6]
|
||||||
|
- OS: [e.g. iOS 13.6.1]
|
||||||
|
- Browser: [e.g. Chrome 22]
|
||||||
|
-->
|
||||||
|
|
||||||
|
### Additional context
|
||||||
<!-- Add any other context about the problem here. -->
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -4,14 +4,14 @@ about: Suggest an idea for this project
|
|||||||
labels: enhancement
|
labels: enhancement
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Note: Please follow the template to open a new issue, otherwise your question will probably be ignored. -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||||
- [ ] 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 are no similar request on existing issues (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 `develop` 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
|
||||||
|
|||||||
5
.github/ISSUE_TEMPLATE/question.md
vendored
5
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -4,7 +4,7 @@ about: Ask what ever you want
|
|||||||
labels: question
|
labels: question
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Note: Please follow the template to open a new issue, otherwise your question will probably be ignored. -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
@@ -15,6 +15,5 @@ labels: question
|
|||||||
- [ ] I searched the Internet for related problems, but still couldn't solve it.
|
- [ ] I searched the Internet for related problems, but still couldn't solve it.
|
||||||
- [ ] My question is based on the latest code of `master` branch.
|
- [ ] My question is based on the latest code of `master` branch.
|
||||||
|
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
<!-- Please describe your question. -->
|
<!-- Please describe your question in detial. -->
|
||||||
|
|||||||
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -16,25 +16,24 @@ Please select the desired item checkbox and change it to "[x]", then delete opti
|
|||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||||
- [ ] Documentation update
|
- [ ] Documentation update
|
||||||
|
|
||||||
## How has this been tested?
|
## How has this been tested
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- [ ] I have run `bash ./tools/build.sh && bash ./tools/test.sh` (at the root of the project) locally and passed
|
- [ ] I have run `bash ./tools/test.sh --build` (at the root of the project) locally and passed
|
||||||
- [ ] I have tested this feature in the browser
|
- [ ] I have tested this feature in the browser
|
||||||
|
|
||||||
**Test Configuration**
|
### Test Configuration
|
||||||
|
|
||||||
* Browerser type & version:
|
- Browerser type & version:
|
||||||
* Operating system:
|
- Operating system:
|
||||||
* Bundler version:
|
- Bundler version:
|
||||||
* Ruby version:
|
- Ruby version:
|
||||||
* Jekyll version:
|
- Jekyll version:
|
||||||
|
|
||||||
|
### 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/)
|
- [ ] My code follows the [Google style guidelines](https://google.github.io/styleguide/)
|
||||||
- [ ] I have performed a self-review of my own code
|
- [ ] I have performed a self-review of my own code
|
||||||
@@ -42,4 +41,4 @@ Please describe the tests that you ran to verify your changes. Provide instructi
|
|||||||
- [ ] I have made corresponding changes to the documentation
|
- [ ] I have made corresponding changes to the documentation
|
||||||
- [ ] My changes generate no new warnings
|
- [ ] My changes generate no new warnings
|
||||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
- [ ] I have added tests that prove my fix is effective or that my feature works
|
||||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
- [ ] Any dependent changes have been merged and published in downstream modules
|
||||||
|
|||||||
17
.github/stale.yml
vendored
Normal file
17
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Clean up the stale issues
|
||||||
|
|
||||||
|
daysUntilStale: 30
|
||||||
|
daysUntilClose: 1
|
||||||
|
|
||||||
|
exemptLabels:
|
||||||
|
- in progress
|
||||||
|
- pending
|
||||||
|
|
||||||
|
staleLabel: stale
|
||||||
|
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
|
||||||
|
closeComment: false
|
||||||
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: 'Continuous Integration'
|
name: 'Continuous Integration'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches-ignore:
|
||||||
- '*'
|
- 'production'
|
||||||
tags-ignore:
|
tags-ignore:
|
||||||
- '*'
|
- '*'
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
@@ -24,47 +24,38 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
|
||||||
steps:
|
env:
|
||||||
- uses: actions/setup-ruby@v1
|
GEMS_PATH: ~/vendor/bundle
|
||||||
with:
|
|
||||||
ruby-version: '2.6.x'
|
|
||||||
|
|
||||||
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # for posts's lastmod
|
||||||
|
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: actions/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.7
|
||||||
|
|
||||||
- name: Bundle Caching
|
- name: Bundle Caching
|
||||||
id: bundle-cache
|
uses: actions/cache@v2
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
with:
|
||||||
path: vendor/bundle
|
path: ${{ env.GEMS_PATH }}
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gems-
|
${{ runner.os }}-gems-
|
||||||
|
|
||||||
- name: Install GNU-Coreutils(for macOS)
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
|
||||||
brew install coreutils
|
|
||||||
|
|
||||||
- name: Bundle config
|
|
||||||
run: |
|
|
||||||
bundle config path vendor/bundle
|
|
||||||
|
|
||||||
- name: Bundle Install
|
- name: Bundle Install
|
||||||
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
run: |
|
||||||
bundle install
|
bundle config path ${{ env.GEMS_PATH }}
|
||||||
|
bundle install --jobs 4 --retry 3
|
||||||
- name: Bundle Install locally
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
|
||||||
run: |
|
|
||||||
bundle install --local
|
|
||||||
|
|
||||||
- name: Build Site
|
- name: Build Site
|
||||||
|
env:
|
||||||
|
JEKYLL_ENV: production
|
||||||
run: |
|
run: |
|
||||||
bash tools/build.sh
|
bundle exec jekyll b
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
20
.github/workflows/issue-pr-interceptor.yml
vendored
Normal file
20
.github/workflows/issue-pr-interceptor.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: "Intercept bad issue/PRs"
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened, reopened]
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
autoclose:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Auto close issues/pr that did not follow template
|
||||||
|
uses: roots/issue-closer@v1.1
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
issue-pattern: "\\[x\\] I have read"
|
||||||
|
issue-close-message: ":wave: Hi @${issue.user.login},\n\nThis issue is being automatically closed because it does not follow the issue template."
|
||||||
|
pr-pattern: "\\[x\\] Bug|\\[x\\] New feat|\\[x\\] Break|\\[x\\] Doc"
|
||||||
|
pr-close-message: ":wave: Hi @${pull_request.user.login},\n\nThis PR is being automatically closed because it does not follow the PR template."
|
||||||
24
.github/workflows/issues-cleaner.yml
vendored
24
.github/workflows/issues-cleaner.yml
vendored
@@ -1,24 +0,0 @@
|
|||||||
name: "Close stale issues"
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- env:
|
|
||||||
DAYS_TO_STALE: ${{ 5 }}
|
|
||||||
DAYS_TO_CLOSE: ${{ 2 }}
|
|
||||||
uses: actions/stale@v3
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
stale-issue-message: 'This issue is stale because it has been open ${{ env.DAYS_TO_STALE }} days with no activity. Remove stale label or comment or this will be closed in ${{ env.DAYS_TO_CLOSE }} days'
|
|
||||||
stale-issue-label: 'stale'
|
|
||||||
exempt-issue-labels: 'pending, in progress'
|
|
||||||
stale-pr-message: 'This PR is stale because it has been open ${{ env.DAYS_TO_STALE }} days with no activity. Remove stale label or comment or this will be closed in ${{ env.DAYS_TO_CLOSE }} days'
|
|
||||||
stale-pr-label: 'stale'
|
|
||||||
exempt-pr-labels: 'pending, in progress'
|
|
||||||
days-before-stale: ${{ env.DAYS_TO_STALE }}
|
|
||||||
days-before-close: ${{ env.DAYS_TO_CLOSE }}
|
|
||||||
# debug-only: true
|
|
||||||
97
.github/workflows/pages-deploy.yml.hook
vendored
97
.github/workflows/pages-deploy.yml.hook
vendored
@@ -4,96 +4,65 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.gitignore'
|
- .gitignore
|
||||||
- 'README.md'
|
- README.md
|
||||||
- 'LICENSE'
|
- LICENSE
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-n-test:
|
continuous-delivery:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
env:
|
||||||
- uses: actions/setup-ruby@v1
|
GEMS_PATH: ~/vendor/bundle
|
||||||
with:
|
|
||||||
ruby-version: '2.6.x'
|
|
||||||
|
|
||||||
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # for posts's lastmod
|
||||||
|
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: actions/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.7
|
||||||
|
|
||||||
- name: Bundle Caching
|
- name: Bundle Caching
|
||||||
id: bundle-cache
|
uses: actions/cache@v2
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
with:
|
||||||
path: vendor/bundle
|
path: ${{ env.GEMS_PATH }}
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gems-
|
${{ runner.os }}-gems-
|
||||||
|
|
||||||
- name: Bundle config
|
|
||||||
run: |
|
|
||||||
bundle config path vendor/bundle
|
|
||||||
|
|
||||||
- name: Bundle Install
|
- name: Bundle Install
|
||||||
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
run: |
|
||||||
bundle install
|
bundle config path ${{ env.GEMS_PATH }}
|
||||||
|
bundle install --jobs 4 --retry 3
|
||||||
|
|
||||||
- name: Bundle Install locally
|
- name: Check baseurl
|
||||||
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
bundle install --local
|
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
|
||||||
|
if [[ -n $baseurl ]]; then
|
||||||
|
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build Site
|
- name: Build Site
|
||||||
|
env:
|
||||||
|
JEKYLL_ENV: production
|
||||||
run: |
|
run: |
|
||||||
bash tools/build.sh -b ""
|
bundle exec jekyll b -d "_site$BASE_URL"
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: |
|
run: |
|
||||||
bash tools/test.sh
|
bash tools/test.sh
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build-n-test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: '2.6.x'
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Bundle Caching
|
|
||||||
id: bundle-cache
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: vendor/bundle
|
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gems-
|
|
||||||
|
|
||||||
- name: Bundle config
|
|
||||||
run: |
|
|
||||||
bundle config path vendor/bundle
|
|
||||||
|
|
||||||
- name: Bundle Install
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
bundle install
|
|
||||||
|
|
||||||
- name: Bundle Install locally
|
|
||||||
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
|
||||||
run: |
|
|
||||||
bundle install --local
|
|
||||||
|
|
||||||
- name: Build site
|
|
||||||
run: |
|
|
||||||
bash tools/build.sh
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n $BASE_URL ]]; then
|
||||||
|
mv _site$BASE_URL _site-rename
|
||||||
|
rm -rf _site
|
||||||
|
mv _site-rename _site
|
||||||
|
fi
|
||||||
|
|
||||||
bash tools/deploy.sh
|
bash tools/deploy.sh
|
||||||
|
|||||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,17 +1,7 @@
|
|||||||
# hidden files
|
# hidden files
|
||||||
.*
|
.*
|
||||||
|
!.github
|
||||||
|
|
||||||
# python compiled files
|
# jekyll cache
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# jekyll debug
|
|
||||||
_site
|
_site
|
||||||
|
|
||||||
# Jeykll Gemfile.lock
|
|
||||||
Gemfile.lock
|
|
||||||
|
|
||||||
# yui-compressor
|
|
||||||
*.jar
|
|
||||||
|
|
||||||
# bundle cache
|
|
||||||
vendor
|
vendor
|
||||||
|
|||||||
25
.travis.yml
25
.travis.yml
@@ -2,36 +2,25 @@ os: linux
|
|||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
||||||
language: ruby
|
language: ruby
|
||||||
rvm: 2.6.5
|
rvm: 2.7.0
|
||||||
|
|
||||||
before_install:
|
cache: bundler
|
||||||
- bundle config path 'vendor/bundle'
|
|
||||||
|
|
||||||
install:
|
|
||||||
- bundle install --quiet
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
|
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- >-
|
- git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
|
||||||
git clone https://${GH_PAT}@github.com/${GH_USER}/${BUILDER_REPO}.git
|
- eval "$BUILD_CMD"
|
||||||
${HOME}/${BUILDER_REPO} --depth=1 -q
|
|
||||||
- cp -r ${HOME}/${BUILDER_REPO}/framework/* .
|
|
||||||
- bash _cibuild.sh
|
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: production
|
||||||
|
|
||||||
git:
|
git:
|
||||||
depth: false # for posts lastmod
|
depth: false # for posts lastmod
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $TRAVIS_BUILD_DIR/vendor/bundle
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
recipients:
|
recipients:
|
||||||
@@ -40,4 +29,4 @@ notifications:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
|
||||||
|
|||||||
18
Gemfile
18
Gemfile
@@ -1,14 +1,26 @@
|
|||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "jekyll", ">=3.8.6"
|
gem "jekyll", ">= 4.1.0", "< 5.0"
|
||||||
|
|
||||||
# Official Plugins
|
# plugins
|
||||||
group :jekyll_plugins do
|
group :jekyll_plugins do
|
||||||
gem "jekyll-paginate"
|
gem "jekyll-paginate"
|
||||||
gem "jekyll-redirect-from"
|
gem "jekyll-redirect-from"
|
||||||
gem "jekyll-seo-tag", "~> 2.6.1"
|
gem "jekyll-seo-tag"
|
||||||
|
gem "jekyll-archives"
|
||||||
|
gem "jekyll-sitemap"
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem "html-proofer"
|
gem "html-proofer"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
|
# and associated library.
|
||||||
|
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
|
||||||
|
gem "tzinfo", "~> 1.2"
|
||||||
|
gem "tzinfo-data"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Performance-booster for watching directories on Windows
|
||||||
|
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
|
||||||
|
|||||||
111
Gemfile.lock
Normal file
111
Gemfile.lock
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
addressable (2.7.0)
|
||||||
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
|
colorator (1.1.0)
|
||||||
|
concurrent-ruby (1.1.7)
|
||||||
|
em-websocket (0.5.2)
|
||||||
|
eventmachine (>= 0.12.9)
|
||||||
|
http_parser.rb (~> 0.6.0)
|
||||||
|
ethon (0.12.0)
|
||||||
|
ffi (>= 1.3.0)
|
||||||
|
eventmachine (1.2.7)
|
||||||
|
ffi (1.14.2)
|
||||||
|
forwardable-extended (2.6.0)
|
||||||
|
html-proofer (3.18.3)
|
||||||
|
addressable (~> 2.3)
|
||||||
|
mercenary (~> 0.3)
|
||||||
|
nokogumbo (~> 2.0)
|
||||||
|
parallel (~> 1.3)
|
||||||
|
rainbow (~> 3.0)
|
||||||
|
typhoeus (~> 1.3)
|
||||||
|
yell (~> 2.0)
|
||||||
|
http_parser.rb (0.6.0)
|
||||||
|
i18n (1.8.5)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
jekyll (4.2.0)
|
||||||
|
addressable (~> 2.4)
|
||||||
|
colorator (~> 1.0)
|
||||||
|
em-websocket (~> 0.5)
|
||||||
|
i18n (~> 1.0)
|
||||||
|
jekyll-sass-converter (~> 2.0)
|
||||||
|
jekyll-watch (~> 2.0)
|
||||||
|
kramdown (~> 2.3)
|
||||||
|
kramdown-parser-gfm (~> 1.0)
|
||||||
|
liquid (~> 4.0)
|
||||||
|
mercenary (~> 0.4.0)
|
||||||
|
pathutil (~> 0.9)
|
||||||
|
rouge (~> 3.0)
|
||||||
|
safe_yaml (~> 1.0)
|
||||||
|
terminal-table (~> 2.0)
|
||||||
|
jekyll-archives (2.2.1)
|
||||||
|
jekyll (>= 3.6, < 5.0)
|
||||||
|
jekyll-paginate (1.1.0)
|
||||||
|
jekyll-redirect-from (0.16.0)
|
||||||
|
jekyll (>= 3.3, < 5.0)
|
||||||
|
jekyll-sass-converter (2.1.0)
|
||||||
|
sassc (> 2.0.1, < 3.0)
|
||||||
|
jekyll-seo-tag (2.7.1)
|
||||||
|
jekyll (>= 3.8, < 5.0)
|
||||||
|
jekyll-sitemap (1.4.0)
|
||||||
|
jekyll (>= 3.7, < 5.0)
|
||||||
|
jekyll-watch (2.2.1)
|
||||||
|
listen (~> 3.0)
|
||||||
|
kramdown (2.3.0)
|
||||||
|
rexml
|
||||||
|
kramdown-parser-gfm (1.1.0)
|
||||||
|
kramdown (~> 2.0)
|
||||||
|
liquid (4.0.3)
|
||||||
|
listen (3.3.3)
|
||||||
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
|
mercenary (0.4.0)
|
||||||
|
mini_portile2 (2.4.0)
|
||||||
|
nokogiri (1.10.10)
|
||||||
|
mini_portile2 (~> 2.4.0)
|
||||||
|
nokogumbo (2.0.4)
|
||||||
|
nokogiri (~> 1.8, >= 1.8.4)
|
||||||
|
parallel (1.20.1)
|
||||||
|
pathutil (0.16.2)
|
||||||
|
forwardable-extended (~> 2.6)
|
||||||
|
public_suffix (4.0.6)
|
||||||
|
rainbow (3.0.0)
|
||||||
|
rb-fsevent (0.10.4)
|
||||||
|
rb-inotify (0.10.1)
|
||||||
|
ffi (~> 1.0)
|
||||||
|
rexml (3.2.4)
|
||||||
|
rouge (3.26.0)
|
||||||
|
safe_yaml (1.0.5)
|
||||||
|
sassc (2.4.0)
|
||||||
|
ffi (~> 1.9)
|
||||||
|
terminal-table (2.0.0)
|
||||||
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||||
|
thread_safe (0.3.6)
|
||||||
|
typhoeus (1.4.0)
|
||||||
|
ethon (>= 0.9.0)
|
||||||
|
tzinfo (1.2.9)
|
||||||
|
thread_safe (~> 0.1)
|
||||||
|
tzinfo-data (1.2020.6)
|
||||||
|
tzinfo (>= 1.0.0)
|
||||||
|
unicode-display_width (1.7.0)
|
||||||
|
wdm (0.1.1)
|
||||||
|
yell (2.2.2)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
html-proofer
|
||||||
|
jekyll (>= 4.1.0, < 5.0)
|
||||||
|
jekyll-archives
|
||||||
|
jekyll-paginate
|
||||||
|
jekyll-redirect-from
|
||||||
|
jekyll-seo-tag
|
||||||
|
jekyll-sitemap
|
||||||
|
tzinfo (~> 1.2)
|
||||||
|
tzinfo-data
|
||||||
|
wdm (~> 0.1.1)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
2.1.4
|
||||||
158
README.md
158
README.md
@@ -1,54 +1,55 @@
|
|||||||
# Chirpy
|
# Chirpy
|
||||||
|
|
||||||
🌏 English • [简体中文](docs/README_zh-CN.md)
|
Language: English | [简体中文](docs/README.zh-CN.md)
|
||||||
|
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
|
[](https://app.codacy.com/manual/cotes2020/jekyll-theme-chirpy?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade_Dashboard)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[](https://996.icu)
|
[](https://996.icu)
|
||||||
|
|
||||||
A minimal, sidebar, responsive web design Jekyll theme, focusing on text presentation, aim to help you easily record and share your knowledge. [Live Demo »](https://chirpy.cotes.info)
|
A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation. Designed to help you record and share your knowledge easily. [Live Demo »](https://chirpy.cotes.info)
|
||||||
|
|
||||||
[](https://chirpy.cotes.info)
|
[](https://chirpy.cotes.info)
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
* [Features](#features)
|
- [Features](#features)
|
||||||
* [Installation](#installation)
|
- [Installation](#installation)
|
||||||
* [Usage](#usage)
|
- [Usage](#usage)
|
||||||
* [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
* [Credits](#credits)
|
- [Credits](#credits)
|
||||||
* [Support](#support)
|
- [Supporting](#supporting)
|
||||||
* [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Pinned Posts
|
- Pinned Posts
|
||||||
* Configurable theme mode
|
- Configurable theme mode
|
||||||
* Double-level Categories
|
- Double-level Categories
|
||||||
* Last modified date for posts
|
- Last modified date for posts
|
||||||
* Table of Contents
|
- Table of Contents
|
||||||
* Automatically recommend related posts
|
- Automatically recommend related posts
|
||||||
* Syntax highlighting
|
- Syntax highlighting
|
||||||
* Mathematical expressions
|
- Mathematical expressions
|
||||||
* Search
|
- Mermaid diagram & flowchart
|
||||||
* Atom Feeds
|
- Search
|
||||||
* Disqus Comments
|
- Atom Feeds
|
||||||
* Google Analytics
|
- Disqus Comments
|
||||||
* GA Pageviews reporting (Advanced)
|
- Google Analytics
|
||||||
* SEO and Performance Optimization
|
- GA Pageviews reporting (Advanced)
|
||||||
|
- SEO and Performance Optimization
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub, and clone the fork to local by:
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub, rename the repository to `USERNAME.github.io` (where `USERNAME` is your GitHub username), and then open terminal and clone the fork to local by:
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ git clone git@github.com:<username>/jekyll-theme-chirpy -b master --single-branch
|
$ git clone https://github.com/USERNAME/USERNAME.github.io.git -b master --single-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up the local envrionment
|
### Setting up the local envrionment
|
||||||
|
|
||||||
If you would like to run or build the project on your local machine, please follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems` and `Bundler`.
|
If you would like to run or build the project on your local machine, please follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`.
|
||||||
|
|
||||||
Before running or building for the first time, please complete the installation of the Jekyll plugins. Go to the root directory of project and run:
|
Before running or building for the first time, please complete the installation of the Jekyll plugins. Go to the root directory of project and run:
|
||||||
|
|
||||||
@@ -58,25 +59,16 @@ $ bundle install
|
|||||||
|
|
||||||
`bundle` will automatically install all the dependencies specified by `Gemfile`.
|
`bundle` will automatically install all the dependencies specified by `Gemfile`.
|
||||||
|
|
||||||
What's more, in order to generate some extra files (*categories*, *tags* and *last modified list*), we need to use some tool scripts. If your machine is running Debian or macOS, make sure that [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, install by:
|
### Setting up Docker environment (optional)
|
||||||
|
|
||||||
* Debian
|
If you're a loyal fan of [**Docker**](https://www.docker.com/) or just too lazy to install the packages mentioned in [_Setting up the local envrionment_](#setting-up-the-local-envrionment), please make sure you have **Docker Engine** installed and running, and then get Docker image `jekyll/jekyll` from Docker Hub by the following command:
|
||||||
|
|
||||||
```console
|
|
||||||
$ sudo apt-get install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
* macOS
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ brew install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker pull jekyll/jekyll
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Running [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) requires some extra files, which cannot be generated by Jekyll native commands, so please strictly follow the methods mentioned below to run or deploy your website.
|
|
||||||
|
|
||||||
### Initialization
|
### Initialization
|
||||||
|
|
||||||
Go to the root directory of the project and start initialization:
|
Go to the root directory of the project and start initialization:
|
||||||
@@ -85,91 +77,88 @@ Go to the root directory of the project and start initialization:
|
|||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> If you not intend to deploy it on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
> **Note**: If you not intend to deploy it on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
||||||
|
|
||||||
What it does is:
|
What it does is:
|
||||||
|
|
||||||
1. Remove some files or directories from your repository:
|
1. Remove some files or directories from your repository:
|
||||||
- `.travis.yml`
|
|
||||||
- everything under `.github/`
|
|
||||||
- files under `_posts/`
|
|
||||||
- folder `docs/`
|
|
||||||
|
|
||||||
2. Unless the option `--no-gh` was enabled, setup the GitHub action workflow by renaming `pages-deploy.yml.hook` of directory `.github/workflows/` to `pages-deploy.yml`.
|
- `.travis.yml`
|
||||||
|
- files under `_posts`
|
||||||
|
- folder `docs`
|
||||||
|
|
||||||
|
2. If you use the `--no-gh` option, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in folder `.github`.
|
||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Automatically create a commit to save the changes.
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
|
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
|
||||||
* `url`
|
|
||||||
* `avatar`
|
|
||||||
* `timezone`
|
|
||||||
* `theme_mode`
|
|
||||||
|
|
||||||
|
- `url`
|
||||||
|
- `avatar`
|
||||||
|
- `timezone`
|
||||||
|
- `theme_mode`
|
||||||
|
|
||||||
### Run Locally
|
### Run Locally
|
||||||
|
|
||||||
You may want to preview the site contents before publishing, so just run it by:
|
You may want to preview the site contents before publishing, so just run it by:
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ bash tools/run.sh
|
$ bundle exec jekyll s
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open a browser and visit to <http://localhost:4000>.
|
Then open a browser and visit to <http://localhost:4000>.
|
||||||
|
|
||||||
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
|
### Run on Docker
|
||||||
|
|
||||||
|
Run the site on Docker with the following command:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
$ docker run -it --rm \
|
||||||
|
--volume="$PWD:/srv/jekyll" \
|
||||||
|
-p 4000:4000 jekyll/jekyll \
|
||||||
|
jekyll serve
|
||||||
|
```
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [_project site_](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash. For example, `/project`.
|
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [_project site_](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash. For example, `/project`.
|
||||||
|
|
||||||
Assuming you have already gone through the [initialization](#initialization), you can now choose any of the following methods to deploy your website.
|
Assuming you have already gone through the [initialization](#initialization), you can now choose ONE of the following methods to deploy your website.
|
||||||
|
|
||||||
#### Deploy on GitHub Pages
|
#### Deploy on GitHub Pages
|
||||||
|
|
||||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using tool scripts to generate additional page files. Therefore, we can use GitHub Actions to build the site, store the built site files on a new branch, and use that branch as the source of the Pages service.
|
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the Pages service.
|
||||||
|
|
||||||
1. Push any commit to `origin/master` to trigger the GitHub Actions workflow. Once the build is complete, a new remote branch called `gh-pages` will appear, which is used to store the built site files.
|
1. Push any commit to `origin/master` to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
||||||
|
|
||||||
2. Unless you prefer to project sites, rename your repository to `<username>.github.io` on GitHub.
|
2. Browse to your repo's landing page on GitHub and select the branch `gh-pages` as the [publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) throught _Settings_ → _Options_ → _GitHub Pages_:
|
||||||
|

|
||||||
|
|
||||||
3. Choose branch `gh-pages` as your GitHub Pages source.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
4. Visit your website at the address indicated by GitHub.
|
|
||||||
|
|
||||||
#### Deploy on Other Platforms
|
#### Deploy on Other Platforms
|
||||||
|
|
||||||
On platforms other than GitHub, e.g. GitLab, we cannot enjoy the convenience of **GitHub Actions**. However, we have a tool to make up for this shortcoming.
|
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.
|
||||||
|
|
||||||
Commit the changes of your repository first, then run the publish script:
|
Go to the root of the source project, build your site by:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/publish.sh
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
> Please note that the *Recent Update* list requires the latest git-log date of posts, thus make sure the changes in `_posts` have been committed before running this command.
|
Or, build the site with Docker by:
|
||||||
|
|
||||||
It will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts and submit a commit, then push to `origin/master`. Its output is similar to the following log:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
[INFO] Success to update lastmod for 4 post(s).
|
$ docker run -it --rm \
|
||||||
[INFO] Succeed! 3 category-pages created.
|
--env JEKYLL_ENV=production \
|
||||||
[INFO] Succeed! 4 tag-pages created.
|
--volume="$PWD:/srv/jekyll" \
|
||||||
[INFO] Published successfully!
|
jekyll/jekyll \
|
||||||
|
jekyll build
|
||||||
```
|
```
|
||||||
|
|
||||||
Lastly, enable the pages service according to the instructions of the platform you choose.
|
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.
|
||||||
|
|
||||||
#### Deploy on Private Server
|
|
||||||
|
|
||||||
In the root of the source project, build your site by:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bash tools/build.sh -d /path/to/site/
|
|
||||||
```
|
|
||||||
|
|
||||||
The generated site files will be placed in the root of `/path/to/site/`. Now you should upload those files to your web server, such as Nginx.
|
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
@@ -179,19 +168,16 @@ For more details and the better reading experience, please check out the [tutori
|
|||||||
|
|
||||||
The old saying, "Two heads are better than one." Consequently, welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
|
The old saying, "Two heads are better than one." Consequently, welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
|
||||||
|
|
||||||
|
|
||||||
## 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).
|
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).
|
||||||
|
|
||||||
: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.
|
||||||
|
|
||||||
|
## Supporting
|
||||||
## Support
|
|
||||||
|
|
||||||
If you enjoy this theme or find it helpful, please consider becoming my sponsor, I'd really appreciate it! Click the button <kbd>:heart: Sponsor</kbd> at the top of the [Home Page](https://github.com/cotes2020/jekyll-theme-chirpy) and choose a link that suits you to donate; this will encourage and help me better maintain the project.
|
If you enjoy this theme or find it helpful, please consider becoming my sponsor, I'd really appreciate it! Click the button <kbd>:heart: Sponsor</kbd> at the top of the [Home Page](https://github.com/cotes2020/jekyll-theme-chirpy) and choose a link that suits you to donate; this will encourage and help me better maintain the project.
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
|
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
|
||||||
|
|||||||
88
_config.yml
88
_config.yml
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
||||||
#--------------------------
|
# --------------------------
|
||||||
|
|
||||||
title: Chirpy # the main title
|
title: Chirpy # the main title
|
||||||
|
|
||||||
tagline: A text-focused Jekyll theme. # it will display as the sub-title
|
tagline: A text-focused Jekyll theme. # it will display as the sub-title
|
||||||
@@ -17,8 +16,8 @@ description: >- # used by seo meta and the atom feed
|
|||||||
bootstrap Jekyll theme with responsive web design
|
bootstrap Jekyll theme with responsive web design
|
||||||
and focuses on text presentation.
|
and focuses on text presentation.
|
||||||
|
|
||||||
# Replace with the website url, e.g. 'https://username.github.io'
|
# fill in the base hostname & protocol for your site, e.g., 'https://username.github.io'
|
||||||
url: 'protocol://domain'
|
url: ''
|
||||||
|
|
||||||
author: your_full_name # change to your full name
|
author: your_full_name # change to your full name
|
||||||
|
|
||||||
@@ -42,8 +41,7 @@ social:
|
|||||||
# - https://www.linkedin.com/in/username
|
# - https://www.linkedin.com/in/username
|
||||||
|
|
||||||
google_site_verification: google_meta_tag_verification # change to your verification string
|
google_site_verification: google_meta_tag_verification # change to your verification string
|
||||||
|
# --------------------------
|
||||||
#--------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
|
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
|
||||||
@@ -69,31 +67,29 @@ disqus:
|
|||||||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||||
|
|
||||||
|
|
||||||
# Prefer color scheme setting, available values:
|
# Prefer color scheme setting.
|
||||||
#
|
#
|
||||||
# dual - Follow the system prefer color by default, and a toggle will display
|
# Note: Keep empty will follow the system prefer color by default,
|
||||||
# in the left bottom of Sidebar, which used for switch the theme between dark and light.
|
# and there will be a toggle to switch the theme between dark and light
|
||||||
|
# on the bottom left of the sidebar.
|
||||||
|
#
|
||||||
|
# Available options:
|
||||||
#
|
#
|
||||||
# light - Use the light color scheme
|
# light - Use the light color scheme
|
||||||
#
|
#
|
||||||
# dark - Use the dark color scheme
|
# dark - Use the dark color scheme
|
||||||
#
|
#
|
||||||
theme_mode: dual
|
theme_mode: # <light|dark>
|
||||||
|
|
||||||
# boolean type, global switch for ToC in posts.
|
# boolean type, the global switch for ToC in posts.
|
||||||
toc: true
|
toc: true
|
||||||
|
|
||||||
paginate: 10
|
paginate: 10
|
||||||
|
|
||||||
markdown: kramdown
|
|
||||||
|
|
||||||
highlighter: rouge
|
|
||||||
|
|
||||||
kramdown:
|
kramdown:
|
||||||
input: GFM
|
|
||||||
syntax_highlighter: rouge
|
syntax_highlighter: rouge
|
||||||
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
||||||
css_class: 'highlight'
|
css_class: highlight
|
||||||
# default_lang: console
|
# default_lang: console
|
||||||
span:
|
span:
|
||||||
line_numbers: false
|
line_numbers: false
|
||||||
@@ -105,16 +101,21 @@ kramdown:
|
|||||||
# or you think you're smart enough to change other relevant URLs within this template.
|
# or you think you're smart enough to change other relevant URLs within this template.
|
||||||
permalink: /posts/:title/
|
permalink: /posts/:title/
|
||||||
|
|
||||||
|
collections:
|
||||||
|
tabs:
|
||||||
|
output: true
|
||||||
|
sort_by: order
|
||||||
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: "" # An empty string here means all files in the project
|
path: '' # An empty string here means all files in the project
|
||||||
type: posts
|
type: posts
|
||||||
values:
|
values:
|
||||||
layout: post
|
layout: post
|
||||||
comments: true # Enable comments in posts.
|
comments: true # Enable comments in posts.
|
||||||
toc: true # Display TOC column in posts.
|
toc: true # Display TOC column in posts.
|
||||||
location: Post
|
|
||||||
breadcrumb:
|
breadcrumb:
|
||||||
-
|
-
|
||||||
label: Posts
|
label: Posts
|
||||||
@@ -124,12 +125,17 @@ defaults:
|
|||||||
path: _drafts
|
path: _drafts
|
||||||
values:
|
values:
|
||||||
comments: false
|
comments: false
|
||||||
|
-
|
||||||
|
scope:
|
||||||
|
path: index.html
|
||||||
|
values:
|
||||||
|
breadcrumb:
|
||||||
|
-
|
||||||
|
label: Posts
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: tags
|
path: tags
|
||||||
values:
|
values:
|
||||||
tab_active: Tags
|
|
||||||
location: Tag
|
|
||||||
breadcrumb:
|
breadcrumb:
|
||||||
-
|
-
|
||||||
label: Home
|
label: Home
|
||||||
@@ -141,8 +147,6 @@ defaults:
|
|||||||
scope:
|
scope:
|
||||||
path: categories
|
path: categories
|
||||||
values:
|
values:
|
||||||
tab_active: Categories
|
|
||||||
location: Category
|
|
||||||
breadcrumb:
|
breadcrumb:
|
||||||
-
|
-
|
||||||
label: Home
|
label: Home
|
||||||
@@ -152,7 +156,8 @@ defaults:
|
|||||||
url: /tabs/categories/
|
url: /tabs/categories/
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
path: tabs
|
path: ''
|
||||||
|
type: tabs # see `site.collections`
|
||||||
values:
|
values:
|
||||||
layout: page
|
layout: page
|
||||||
dynamic_title: true # Hide title in mobile screens.
|
dynamic_title: true # Hide title in mobile screens.
|
||||||
@@ -161,24 +166,21 @@ defaults:
|
|||||||
label: Home
|
label: Home
|
||||||
url: /
|
url: /
|
||||||
|
|
||||||
|
|
||||||
sass:
|
sass:
|
||||||
sass_dir: /assets/css
|
sass_dir: /assets/css
|
||||||
style: compressed
|
style: compressed
|
||||||
|
|
||||||
compress_html:
|
compress_html:
|
||||||
clippings: all
|
clippings: all
|
||||||
comments: ["<!-- ", " -->"]
|
comments: all
|
||||||
endings: [html, head, body, dt, dd, rt, rp,
|
endings: all
|
||||||
optgroup, option, colgroup, caption,
|
|
||||||
thead, tbody, tfoot, tr, td, th]
|
|
||||||
profile: false
|
profile: false
|
||||||
blanklines: false
|
blanklines: false
|
||||||
ignore:
|
ignore:
|
||||||
envs: []
|
envs: [development]
|
||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
- vendor # Avoid Jekyll mistakenly read the vendor directory on Travis-CI's VM .
|
- vendor
|
||||||
- Gemfile.lock
|
- Gemfile.lock
|
||||||
- Gemfile
|
- Gemfile
|
||||||
- tools
|
- tools
|
||||||
@@ -186,17 +188,11 @@ exclude:
|
|||||||
- README.md
|
- README.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
|
||||||
sitemap_exclude: # Sitemap will exclude the following items.
|
jekyll-archives:
|
||||||
fuzzy:
|
enabled: [categories, tags]
|
||||||
- /assets/
|
layouts:
|
||||||
accurate:
|
category: category
|
||||||
- /norobots/
|
tag: tag
|
||||||
- /tabs/
|
permalinks:
|
||||||
- /categories/
|
tag: /tags/:name/
|
||||||
- /tags/
|
category: /categories/:name/
|
||||||
- /posts/
|
|
||||||
- 404.html
|
|
||||||
- feed.xml
|
|
||||||
- sitemap.xml
|
|
||||||
- robots.txt
|
|
||||||
- redirects.json
|
|
||||||
|
|||||||
@@ -21,11 +21,14 @@
|
|||||||
|
|
||||||
# Uncomment and complete the url below to enable more contact options
|
# Uncomment and complete the url below to enable more contact options
|
||||||
# -
|
# -
|
||||||
|
# type: mastodon
|
||||||
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
|
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
|
||||||
# url: '' # Fill with your mastodon account page
|
# url: '' # Fill with your mastodon account page
|
||||||
# -
|
# -
|
||||||
|
# type: linkedin
|
||||||
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
|
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
|
||||||
# url: '' # Fill with your Linkedin homepage
|
# url: '' # Fill with your Linkedin homepage
|
||||||
# -
|
# -
|
||||||
|
# type: stack-overflow
|
||||||
# icon: 'fab fa-stack-overflow'
|
# icon: 'fab fa-stack-overflow'
|
||||||
# url: '' # Fill with your stackoverflow homepage
|
# url: '' # Fill with your stackoverflow homepage
|
||||||
|
|||||||
@@ -4,16 +4,17 @@
|
|||||||
# © 2017-2019 Cotes Chung
|
# © 2017-2019 Cotes Chung
|
||||||
# MIT Licensed
|
# MIT Licensed
|
||||||
|
|
||||||
|
|
||||||
panel:
|
panel:
|
||||||
lastmod: "Recent Update"
|
lastmod: Recent Update
|
||||||
trending_tags: "Trending Tags"
|
trending_tags: Trending Tags
|
||||||
toc: "Contents"
|
toc: Contents
|
||||||
|
|
||||||
post:
|
post:
|
||||||
relate_posts: "Further Reading"
|
relate_posts: Further Reading
|
||||||
button:
|
button:
|
||||||
next: Newer
|
next: Newer
|
||||||
previous: Older
|
previous: Older
|
||||||
|
|
||||||
search_hint: "Search" # text show on search bar
|
search_hint: Search # text show on search bar
|
||||||
|
|
||||||
|
pin_prompt: Pinned # pinned prompt
|
||||||
|
|||||||
3
_data/meta.yml
Normal file
3
_data/meta.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
name: Chirpy
|
||||||
|
version: 2.7.2
|
||||||
|
homepage: https://github.com/cotes2020/jekyll-theme-chirpy/
|
||||||
7
_data/read_time.yml
Normal file
7
_data/read_time.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# words per minute
|
||||||
|
wpm: 180
|
||||||
|
|
||||||
|
# minimum value
|
||||||
|
min_time: 1
|
||||||
|
|
||||||
|
prompt: min
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# The tab data.
|
|
||||||
# v2.1
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
name: Home
|
|
||||||
icon: "fas fa-home"
|
|
||||||
-
|
|
||||||
name: Categories
|
|
||||||
icon: "fas fa-stream"
|
|
||||||
path: tabs
|
|
||||||
url: categories
|
|
||||||
-
|
|
||||||
name: "Tags"
|
|
||||||
icon: "fas fa-tags"
|
|
||||||
path: tabs
|
|
||||||
url: tags
|
|
||||||
-
|
|
||||||
name: "Archives"
|
|
||||||
path: tabs
|
|
||||||
url: archives
|
|
||||||
icon: "fas fa-archive"
|
|
||||||
-
|
|
||||||
name: "About"
|
|
||||||
icon: "fas fa-info"
|
|
||||||
path: tabs
|
|
||||||
url: about
|
|
||||||
@@ -6,49 +6,21 @@
|
|||||||
MIT Licensed
|
MIT Licensed
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% if page.layout == 'home' %}
|
|
||||||
<link rel="preload" href="{{ '/assets/css/home.css' | relative_url }}" as="style">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/home.css' | relative_url }}">
|
|
||||||
|
|
||||||
{% elsif page.layout == 'page' %}
|
{% if page.layout == 'category' or page.layout == 'tag' %}
|
||||||
|
{% assign style = 'category-tag' %}
|
||||||
|
{% else %}
|
||||||
|
{% assign style = page.layout %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if page.type == 'categories' %}
|
{% assign src = style | prepend: '/assets/css/' | append: '.css' | relative_url %}
|
||||||
|
|
||||||
<link rel="preload" href="{{ '/assets/css/categories.css' | relative_url }}" as="style">
|
<link rel="preload" href="{{ src }}" as="style">
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/categories.css' | relative_url }}">
|
<link rel="stylesheet" href="{{ src }}">
|
||||||
|
|
||||||
{% elsif page.type == 'tags' %}
|
|
||||||
|
|
||||||
<link rel="preload" href="{{ '/assets/css/tags.css' | relative_url }}" as="style">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/tags.css' | relative_url }}">
|
|
||||||
|
|
||||||
{% elsif page.type == 'archives' %}
|
|
||||||
|
|
||||||
<link rel="preload" href="{{ '/assets/css/archives.css' | relative_url }}" as="style">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/archives.css' | relative_url }}">
|
|
||||||
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
<link rel="preload" href="{{ '/assets/css/page.css' | relative_url }}" as="style">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/page.css' | relative_url }}">
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
|
||||||
|
|
||||||
<link rel="preload" href="{{ '/assets/css/category-tag.css' | relative_url }}" as="style">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/category-tag.css' | relative_url }}">
|
|
||||||
|
|
||||||
{% elsif page.layout == 'post' %}
|
|
||||||
|
|
||||||
<link rel="preload" as="style" href="{{ '/assets/css/post.css' | relative_url }}">
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/post.css' | relative_url }}">
|
|
||||||
|
|
||||||
|
{% if page.layout == 'post' %}
|
||||||
{% if site.toc and page.toc %}
|
{% if site.toc and page.toc %}
|
||||||
|
|
||||||
<link rel="preload" as="style" href="{{ '/assets/css/lib/bootstrap-toc.min.css' | relative_url }}">
|
<link rel="preload" as="style" href="{{ '/assets/css/lib/bootstrap-toc.min.css' | relative_url }}">
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/lib/bootstrap-toc.min.css' | relative_url }}" />
|
<link rel="stylesheet" href="{{ '/assets/css/lib/bootstrap-toc.min.css' | relative_url }}" />
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<!--
|
|
||||||
Fixed kramdown code highlight rendering:
|
|
||||||
https://github.com/penibelst/jekyll-compress-html/issues/101
|
|
||||||
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
|
||||||
-->
|
|
||||||
{% if include.content contains '<pre class="highlight">' %}
|
|
||||||
{% assign content = include.content | replace: '<pre class="highlight"><code', '<code' %}
|
|
||||||
{% assign content = content | replace: '</code></pre>', '</code>' %}
|
|
||||||
{{ content }}
|
|
||||||
{% else %}
|
|
||||||
{{ include.content }}
|
|
||||||
{% endif %}
|
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
<div class="footer-right">
|
<div class="footer-right">
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
Powered by
|
Powered by
|
||||||
<a href="https://jekyllrb.com" target="_blank">Jekyll</a>
|
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
|
||||||
with
|
with
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/">Chirpy</a>
|
<a href="{{ site.data.meta.homepage }}" target="_blank" rel="noopener">{{ site.data.meta.name }}</a>
|
||||||
theme.
|
theme.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,12 +5,14 @@
|
|||||||
© 2017-2019 Cotes Chung
|
© 2017-2019 Cotes Chung
|
||||||
MIT License
|
MIT License
|
||||||
-->
|
-->
|
||||||
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
|
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
window.dataLayer = window.dataLayer || [];
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
function gtag(){dataLayer.push(arguments);}
|
||||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
||||||
|
|
||||||
ga('create', '{{ site.google_analytics.id }}', 'auto');
|
gtag('js', new Date());
|
||||||
ga('send', 'pageview');
|
gtag('config', '{{ site.google_analytics.id }}');
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="theme" content="{{ site.data.meta.name }} v{{ site.data.meta.version }}">
|
||||||
|
|
||||||
|
{% seo title=false %}
|
||||||
|
|
||||||
<title>
|
<title>
|
||||||
{%- unless page.layout == "home" -%}
|
{%- unless page.layout == "home" -%}
|
||||||
@@ -17,8 +20,6 @@
|
|||||||
{{ site.title }}
|
{{ site.title }}
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
{% seo title=false %}
|
|
||||||
|
|
||||||
{% include favicons.html %}
|
{% include favicons.html %}
|
||||||
|
|
||||||
<!-- Google Fonts -->
|
<!-- Google Fonts -->
|
||||||
@@ -44,10 +45,6 @@
|
|||||||
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
||||||
|
|
||||||
<!-- Bootstrap -->
|
<!-- Bootstrap -->
|
||||||
<link rel="preload" as="style"
|
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
|
||||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin>
|
|
||||||
|
|
||||||
<link rel="stylesheet"
|
<link rel="stylesheet"
|
||||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
||||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
||||||
@@ -62,14 +59,11 @@
|
|||||||
|
|
||||||
<!-- JavaScripts -->
|
<!-- JavaScripts -->
|
||||||
|
|
||||||
<link rel="preload" as="script" href="https://cdn.jsdelivr.net/npm/jquery@3.4.1"
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
||||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1"
|
<script defer
|
||||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.15.0,npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" async></script>
|
|
||||||
|
|
||||||
{% include js-selector.html %}
|
{% include js-selector.html %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -6,36 +6,29 @@
|
|||||||
MIT Licensed
|
MIT Licensed
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% if page.layout == 'home' %}
|
{% if page.layout == 'home' or page.layout == 'post' or page.layout == 'categories' %}
|
||||||
|
{% assign js = page.layout %}
|
||||||
<script src="{{ '/assets/js/home.min.js' | relative_url }}" async></script>
|
|
||||||
|
|
||||||
{% elsif page.layout == 'post' %}
|
|
||||||
|
|
||||||
<script src="{{ '/assets/js/post.min.js' | relative_url }}" async></script>
|
|
||||||
|
|
||||||
{% if page.math %}
|
|
||||||
<!-- MathJax -->
|
|
||||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% elsif page.layout == 'page' %}
|
|
||||||
|
|
||||||
{% if page.type == 'categories' %}
|
|
||||||
<script src="{{ '/assets/js/categories.min.js' | relative_url }}" async></script>
|
|
||||||
{% else %}
|
|
||||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
{% assign js = "page" %}
|
||||||
<script src="{{ '/assets/js/page.min.js' | relative_url }}" async></script>
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign js_src = js | prepend: '/assets/js/' | append: '.min.js' | relative_url %}
|
||||||
|
|
||||||
|
<script async src="{{ js_src }}"></script>
|
||||||
|
|
||||||
|
{% if page.math %}
|
||||||
|
<!-- MathJax -->
|
||||||
|
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||||
|
<script defer src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- PWA -->
|
|
||||||
{% if jekyll.environment == 'production' %}
|
{% if jekyll.environment == 'production' %}
|
||||||
<script src="{{ '/app.js' | relative_url }}" defer></script>
|
<!-- PWA -->
|
||||||
|
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
||||||
|
|
||||||
|
<!-- GA -->
|
||||||
|
{% if site.google_analytics.id %}
|
||||||
|
{% include google-analytics.html %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
28
_includes/mermaid.html
Normal file
28
_includes/mermaid.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!--
|
||||||
|
mermaid-js loader
|
||||||
|
-->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
let initTheme = "default";
|
||||||
|
|
||||||
|
if ($("html[mode=dark]").length > 0
|
||||||
|
|| ($("html[mode]").length == 0
|
||||||
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
|
||||||
|
initTheme = "dark";
|
||||||
|
}
|
||||||
|
|
||||||
|
let mermaidConf = {
|
||||||
|
theme: initTheme /* <default|dark|forest|neutral> */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Markdown converts to HTML */
|
||||||
|
$("pre").has("code.language-mermaid").each(function() {
|
||||||
|
let svgCode = $(this).children().html();
|
||||||
|
$(this).addClass("unloaded");
|
||||||
|
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
|
||||||
|
});
|
||||||
|
|
||||||
|
mermaid.initialize(mermaidConf);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -7,8 +7,7 @@
|
|||||||
MIT License
|
MIT License
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<i class="mode-toggle fas fa-sun" dark-mode-invisible></i>
|
<i class="mode-toggle fas fa-adjust"></i>
|
||||||
<i class="mode-toggle fas fa-moon" light-mode-invisible></i>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@@ -18,8 +17,8 @@
|
|||||||
static get LIGHT_MODE() { return "light"; }
|
static get LIGHT_MODE() { return "light"; }
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (this.mode != null) {
|
if (this.hasMode) {
|
||||||
if (this.mode == ModeToggle.DARK_MODE) {
|
if (this.isDarkMode) {
|
||||||
if (!this.isSysDarkPrefer) {
|
if (!this.isSysDarkPrefer) {
|
||||||
this.setDark();
|
this.setDark();
|
||||||
}
|
}
|
||||||
@@ -34,8 +33,8 @@
|
|||||||
|
|
||||||
/* always follow the system prefers */
|
/* always follow the system prefers */
|
||||||
this.sysDarkPrefers.addListener(function() {
|
this.sysDarkPrefers.addListener(function() {
|
||||||
if (self.mode != null) {
|
if (self.hasMode) {
|
||||||
if (self.mode == ModeToggle.DARK_MODE) {
|
if (self.isDarkMode) {
|
||||||
if (!self.isSysDarkPrefer) {
|
if (!self.isSysDarkPrefer) {
|
||||||
self.setDark();
|
self.setDark();
|
||||||
}
|
}
|
||||||
@@ -48,6 +47,8 @@
|
|||||||
|
|
||||||
self.clearMode();
|
self.clearMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.updateMermaid();
|
||||||
});
|
});
|
||||||
|
|
||||||
} /* constructor() */
|
} /* constructor() */
|
||||||
@@ -74,16 +75,43 @@
|
|||||||
|
|
||||||
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
||||||
|
|
||||||
get isLightkMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
||||||
|
|
||||||
get hasMode() { return this.mode != null; }
|
get hasMode() { return this.mode != null; }
|
||||||
|
|
||||||
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
||||||
|
|
||||||
|
/* get the current mode on screen */
|
||||||
|
get modeStatus() {
|
||||||
|
if (this.isDarkMode
|
||||||
|
|| (!this.hasMode && this.isSysDarkPrefer) ) {
|
||||||
|
return ModeToggle.DARK_MODE;
|
||||||
|
} else {
|
||||||
|
return ModeToggle.LIGHT_MODE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateMermaid() {
|
||||||
|
if (typeof mermaid !== "undefined") {
|
||||||
|
let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
|
||||||
|
let config = { theme: expectedTheme };
|
||||||
|
|
||||||
|
/* re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
||||||
|
$(".mermaid").each(function() {
|
||||||
|
let svgCode = $(this).prev().children().html();
|
||||||
|
$(this).removeAttr("data-processed");
|
||||||
|
$(this).html(svgCode);
|
||||||
|
});
|
||||||
|
|
||||||
|
mermaid.initialize(config);
|
||||||
|
mermaid.init(undefined, ".mermaid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flipMode() {
|
flipMode() {
|
||||||
if (this.hasMode) {
|
if (this.hasMode) {
|
||||||
if (this.isSysDarkPrefer) {
|
if (this.isSysDarkPrefer) {
|
||||||
if (this.isLightkMode) {
|
if (this.isLightMode) {
|
||||||
this.clearMode();
|
this.clearMode();
|
||||||
} else {
|
} else {
|
||||||
this.setLight();
|
this.setLight();
|
||||||
@@ -105,6 +133,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.updateMermaid();
|
||||||
|
|
||||||
} /* flipMode() */
|
} /* flipMode() */
|
||||||
|
|
||||||
} /* ModeToggle */
|
} /* ModeToggle */
|
||||||
@@ -112,7 +142,9 @@
|
|||||||
let toggle = new ModeToggle();
|
let toggle = new ModeToggle();
|
||||||
|
|
||||||
$(".mode-toggle").click(function() {
|
$(".mode-toggle").click(function() {
|
||||||
|
|
||||||
toggle.flipMode();
|
toggle.flipMode();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -10,61 +10,50 @@
|
|||||||
|
|
||||||
<div class="access">
|
<div class="access">
|
||||||
|
|
||||||
{% if site.data.updates %}
|
{% include update-list.html %}
|
||||||
|
|
||||||
{% include update-list.html %}
|
{% if update_list.size > 0 %}
|
||||||
|
|
||||||
{% if update_list.size > 0 %}
|
|
||||||
|
|
||||||
<div id="access-lastmod" class="post">
|
<div id="access-lastmod" class="post">
|
||||||
<h3 data-toc-skip>
|
<span>{{- site.data.label.panel.lastmod -}}</span>
|
||||||
{{- site.data.label.panel.lastmod -}}
|
|
||||||
</h3>
|
|
||||||
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
||||||
|
|
||||||
{% for item in update_list %}
|
{% for item in update_list %}
|
||||||
{% assign post_url = item | split: "::" | last | url_encode | prepend: "/posts/" | append: "/" %}
|
{% assign index = item | split: "::" | last | plus: 0 %}
|
||||||
{% assign post = site.posts | where: "url", post_url | first %}
|
{% assign post = site.posts[index] %}
|
||||||
|
{% assign url = post.url | relative_url %}
|
||||||
{% if post %}
|
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
||||||
{% assign url = post.url | relative_url %}
|
|
||||||
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div><!-- #access-lastmod -->
|
</div> <!-- #access-lastmod -->
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %} <!-- site.data.updates -->
|
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
|
|
||||||
{% if trending_tags.size > 0 %}
|
{% if trending_tags.size > 0 %}
|
||||||
<div id="access-tags">
|
<div id="access-tags">
|
||||||
<h3 data-toc-skip>
|
<span>{{- site.data.label.panel.trending_tags -}}</span>
|
||||||
{{- site.data.label.panel.trending_tags -}}
|
|
||||||
</h3>
|
|
||||||
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
||||||
|
|
||||||
{% for tag in trending_tags %}
|
{% for tag_name in trending_tags %}
|
||||||
{% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
|
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div> <!-- .access -->
|
</div> <!-- .access -->
|
||||||
|
|
||||||
{% if page.layout == 'post' and site.toc and page.toc %}
|
{% if include.toc %}
|
||||||
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
||||||
<h3 data-toc-skip class="pl-3 pt-2 mb-2">
|
<span class="pl-3 pt-2 mb-2">
|
||||||
{{- site.data.label.panel.toc -}}
|
{{- site.data.label.panel.toc -}}
|
||||||
</h3>
|
</span>
|
||||||
<nav id="toc" data-toggle="toc"></nav>
|
<nav id="toc" data-toggle="toc"></nav>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div> <!-- #panel-wrapper -->
|
</div> <!-- #panel-wrapper -->
|
||||||
|
|||||||
@@ -10,17 +10,15 @@
|
|||||||
<ul class="pagination mt-4 mb-0 pl-lg-2">
|
<ul class="pagination mt-4 mb-0 pl-lg-2">
|
||||||
<!-- left arrow -->
|
<!-- left arrow -->
|
||||||
{% if paginator.previous_page %}
|
{% if paginator.previous_page %}
|
||||||
<li class="page-item">
|
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
||||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}{{ paginator.previous_page_path }}">
|
{% else %}
|
||||||
|
{% assign prev_url = "#" %}
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
|
||||||
|
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
|
||||||
<i class="fas fa-angle-left"></i>
|
<i class="fas fa-angle-left"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
|
||||||
<li class="page-item disabled">
|
|
||||||
<a class="page-link btn-box-shadow" href="#"><i class="fas fa-angle-left"></i></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
<!-- endof left arrow -->
|
|
||||||
|
|
||||||
<!-- page numbers -->
|
<!-- page numbers -->
|
||||||
{% assign left_ellipsis = false %}
|
{% assign left_ellipsis = false %}
|
||||||
@@ -51,38 +49,37 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if show %}
|
{% if show %}
|
||||||
<!-- show number -->
|
<!-- show number -->
|
||||||
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
<li class="page-item {% if i == paginator.page %} active{% endif %}">
|
||||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
|
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<!-- hide number -->
|
||||||
|
{% if i < pre and left_ellipsis == false %}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<span class="page-link btn-box-shadow">...</span>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% assign left_ellipsis = true %}
|
||||||
<!-- hide number -->
|
{% elsif i > next and right_ellipsis == false %}
|
||||||
{% if i < pre and left_ellipsis == false %}
|
<li class="page-item disabled">
|
||||||
<li class="page-item disabled">
|
<span class="page-link btn-box-shadow">...</span>
|
||||||
<span class="page-link btn-box-shadow">...</span>
|
</li>
|
||||||
</li>
|
{% assign right_ellipsis = true %}
|
||||||
{% assign left_ellipsis = true %}
|
|
||||||
{% elsif i > next and right_ellipsis == false %}
|
|
||||||
<li class="page-item disabled">
|
|
||||||
<span class="page-link btn-box-shadow">...</span>
|
|
||||||
</li>
|
|
||||||
{% assign right_ellipsis = true %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<!-- right arrow -->
|
<!-- right arrow -->
|
||||||
{% if paginator.next_page %}
|
{% if paginator.next_page_path %}
|
||||||
<li class="page-item">
|
{% assign next_url = paginator.next_page_path | relative_url %}
|
||||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}{{ paginator.next_page_path }}">
|
{% else %}
|
||||||
|
{% assign next_url = "#" %}
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
|
||||||
|
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
|
||||||
<i class="fas fa-angle-right"></i>
|
<i class="fas fa-angle-right"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
|
||||||
<li class="page-item disabled">
|
|
||||||
<a class="page-link btn-box-shadow" href="#"><i class="fas fa-angle-right"></i></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</ul> <!-- .pagination -->
|
</ul> <!-- .pagination -->
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
{% for share in site.data.share.platforms %}
|
{% for share in site.data.share.platforms %}
|
||||||
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
||||||
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
||||||
title="{{ share.type }}" target="_blank">
|
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
||||||
<i class="fa-fw {{ share.icon }}"></i>
|
<i class="fa-fw {{ share.icon }}"></i>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -25,4 +25,4 @@
|
|||||||
data-toggle="tooltip" data-placement="top" title="Copy link"></i>
|
data-toggle="tooltip" data-placement="top" title="Copy link"></i>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
15
_includes/read-time.html
Normal file
15
_includes/read-time.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<!--
|
||||||
|
Calculate the post's reading time, and display the word count in tooltip
|
||||||
|
-->
|
||||||
|
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
||||||
|
|
||||||
|
{% assign read_time = words | divided_by: site.data.read_time.wpm %}
|
||||||
|
|
||||||
|
{% unless read_time > 0 %}
|
||||||
|
{% assign read_time = site.data.read_time.min_time %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
<!-- return element -->
|
||||||
|
<span class="readtime" data-toggle="tooltip" data-placement="bottom" title="{{ words }} words">
|
||||||
|
{{- read_time -}}{{" "}}{{- site.data.read_time.prompt -}}
|
||||||
|
</span>
|
||||||
39
_includes/refactor-content.html
Normal file
39
_includes/refactor-content.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<!--
|
||||||
|
Refactor the HTML structure.
|
||||||
|
-->
|
||||||
|
|
||||||
|
{% assign _content = include.content %}
|
||||||
|
|
||||||
|
<!--
|
||||||
|
In order to allow a wide table to scroll horizontally,
|
||||||
|
we suround the markdown table with `<div class="table-wrapper">` and `</div>`
|
||||||
|
-->
|
||||||
|
{% if _content contains '<table>' %}
|
||||||
|
{% assign _content = _content
|
||||||
|
| replace: '<table>', '<div class="table-wrapper"><table>'
|
||||||
|
| replace: '</table>', '</table></div>'
|
||||||
|
| replace: '</table></div></code>', '</table></code>'
|
||||||
|
%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Fixed kramdown code highlight rendering:
|
||||||
|
https://github.com/penibelst/jekyll-compress-html/issues/101
|
||||||
|
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
||||||
|
-->
|
||||||
|
{% if _content contains '<pre class="highlight">' %}
|
||||||
|
{% assign _content = _content
|
||||||
|
| replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code'
|
||||||
|
| replace: '</code></pre></div>', '</code></div>'
|
||||||
|
%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Add attribute 'hide-bullet' to the checkbox list -->
|
||||||
|
{% if _content contains '<li class="task-list-item"><' %}
|
||||||
|
{% assign _content = _content
|
||||||
|
| replace: '"task-list-item"><', '"task-list-item" hide-bullet><'
|
||||||
|
%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- return -->
|
||||||
|
{{ _content }}
|
||||||
@@ -13,11 +13,11 @@
|
|||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
|
|
||||||
{% for tag in trending_tags %}
|
{% for tag in trending_tags %}
|
||||||
{% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
|
{% capture url %}/tags/{{ tag | slugify | url_encode }}/{% endcapture %}
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,10 +6,11 @@
|
|||||||
MIT License
|
MIT License
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="nav-wrapper">
|
<div id="sidebar" class="d-flex flex-column align-items-end">
|
||||||
<div id="profile-wrapper" class="d-flex flex-column">
|
|
||||||
<div id="avatar" class="d-flex justify-content-center">
|
<div class="profile-wrapper text-center">
|
||||||
<a href="{{ site.baseurl }}/" alt="avatar">
|
<div id="avatar">
|
||||||
|
<a href="{{ site.baseurl }}/" alt="avatar" class="mx-auto">
|
||||||
{% assign avatar_url = site.avatar %}
|
{% assign avatar_url = site.avatar %}
|
||||||
{% capture start %}{{ site.avatar | slice: 0 }}{% endcapture %}
|
{% capture start %}{{ site.avatar | slice: 0 }}{% endcapture %}
|
||||||
{% if start == '/' %}
|
{% if start == '/' %}
|
||||||
@@ -19,72 +20,72 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-text mt-3">
|
<div class="site-title mt-3">
|
||||||
<div class="site-title">
|
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
|
||||||
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
|
|
||||||
</div>
|
|
||||||
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="nav flex-column">
|
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
|
||||||
{% assign page_urls = page.url | split: "/" %}
|
|
||||||
|
|
||||||
{% for item in site.data.tabs %}
|
</div><!-- .profile-wrapper -->
|
||||||
{% assign ref = site.baseurl | append: "/" %}
|
|
||||||
|
|
||||||
{% if item.path %}
|
<ul class="w-100">
|
||||||
{% assign ref = ref | append: item.path | append: "/" %}
|
<!-- home -->
|
||||||
{% if item.url %}
|
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
||||||
{% assign ref = ref | append: item.url | append: "/" %}
|
<a href="{{ '/' | relative_url }}" class="nav-link">
|
||||||
{% endif %}
|
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
{% endif %}
|
<span>{{ "HOME" }}</span>
|
||||||
|
</a>
|
||||||
<li class="nav-item d-flex justify-content-center
|
</li>
|
||||||
{% if item.url == page_urls.last
|
<!-- the real tabs -->
|
||||||
or item.name == page.tab_active
|
{% for tab in site.tabs %}
|
||||||
or item.name == "Home" and page.layout == "home" %}active{% endif %}">
|
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
|
||||||
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
|
<a href="{{ tab.url | relative_url }}" class="nav-link">
|
||||||
<i class="fa-fw {{ item.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
<span>{{ item.name | upcase }}</span>
|
<span>{{ tab.title | upcase }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li> <!-- .nav-item -->
|
</li> <!-- .nav-item -->
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</ul> <!-- ul.nav.flex-column -->
|
</ul> <!-- ul.nav.flex-column -->
|
||||||
|
|
||||||
</div><!-- #nav-wrapper -->
|
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center">
|
||||||
|
|
||||||
<div class="sidebar-bottom d-flex flex-wrap justify-content-around mt-4">
|
{% for entry in site.data.contact %}
|
||||||
|
{% capture url %}
|
||||||
|
{%- if entry.type == 'github' -%}
|
||||||
|
https://github.com/{{ site.github.username }}
|
||||||
|
{%- elsif entry.type == 'twitter' -%}
|
||||||
|
https://twitter.com/{{ site.twitter.username }}
|
||||||
|
{%- elsif entry.type == 'email' -%}
|
||||||
|
{% assign email = site.social.email | split: '@' %}
|
||||||
|
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
|
||||||
|
{%- elsif entry.type == 'rss' -%}
|
||||||
|
{{ "/feed.xml" | relative_url }}
|
||||||
|
{%- else -%}
|
||||||
|
{{ entry.url }}
|
||||||
|
{%- endif -%}
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
{% if site.theme_mode == "dual" %}
|
{% if url %}
|
||||||
<span id="mode-toggle-wrapper">
|
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
||||||
{% include mode-toggle.html %}
|
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
|
||||||
</span>
|
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
||||||
<span class="icon-border"></span>
|
<i class="{{ entry.icon }}"></i>
|
||||||
{% endif %}
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for entry in site.data.contact %}
|
{% endfor %}
|
||||||
{% capture url %}
|
|
||||||
{%- if entry.type == 'github' -%}
|
|
||||||
https://github.com/{{ site.github.username }}
|
|
||||||
{%- elsif entry.type == 'twitter' -%}
|
|
||||||
https://twitter.com/{{ site.twitter.username }}
|
|
||||||
{%- elsif entry.type == 'email' -%}
|
|
||||||
{% assign email = site.social.email | split: '@' %}
|
|
||||||
javascript:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))
|
|
||||||
{%- elsif entry.type == 'rss' -%}
|
|
||||||
{{ "/feed.xml" | relative_url }}
|
|
||||||
{%- else -%}
|
|
||||||
{{ entry.url }}
|
|
||||||
{%- endif -%}
|
|
||||||
{% endcapture %}
|
|
||||||
|
|
||||||
{% if url != '' %}
|
{% unless site.theme_mode %}
|
||||||
<a href="{{ url }}" {% unless entry.noblank %}target="_blank"{% endunless %}>
|
{% if site.data.contact.size > 0 %}
|
||||||
<i class="{{ entry.icon }}"></i>
|
<span class="icon-border order-2"></span>
|
||||||
</a>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
<span id="mode-toggle-wrapper" class="order-1">
|
||||||
|
{% include mode-toggle.html %}
|
||||||
|
</span>
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
</div> <!-- .sidebar-bottom -->
|
||||||
|
|
||||||
|
</div><!-- #sidebar -->
|
||||||
|
|||||||
@@ -29,22 +29,23 @@
|
|||||||
<i id="sidebar-trigger" class="fas fa-bars fa-fw"></i>
|
<i id="sidebar-trigger" class="fas fa-bars fa-fw"></i>
|
||||||
|
|
||||||
<div id="topbar-title">
|
<div id="topbar-title">
|
||||||
{% if page.location %}
|
{% if page.layout == 'home' %}
|
||||||
{{- page.location -}}
|
{{- site.title -}}
|
||||||
{% elsif page.layout == "home" %}
|
{% elsif page.dynamic_title %}
|
||||||
{{- site.title -}}
|
{{- page.title -}}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{- page.title -}}
|
{{- page.layout | capitalize -}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<i id="search-trigger" class="fas fa-search fa-fw"></i>
|
<i id="search-trigger" class="fas fa-search fa-fw"></i>
|
||||||
<span id="search-wrapper" class="align-items-center">
|
<span id="search-wrapper" class="align-items-center">
|
||||||
<i class="fas fa-search fa-fw"></i>
|
<i class="fas fa-search fa-fw"></i>
|
||||||
<input class="form-control" id="search-input" type="search" placeholder="{{ site.data.label.search_hint }}...">
|
<input class="form-control" id="search-input" type="search"
|
||||||
|
aria-label="search" placeholder="{{ site.data.label.search_hint }}...">
|
||||||
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
|
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
|
||||||
</span>
|
</span>
|
||||||
<span id="search-cancel" >Cancel</span>
|
<span id="search-cancel" >Cancel</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,24 +8,33 @@
|
|||||||
|
|
||||||
{% assign MAX = 10 %}
|
{% assign MAX = 10 %}
|
||||||
|
|
||||||
{% capture tags_array %}
|
{% assign size_list = "" | split: "" %}
|
||||||
{% for tag in site.tags %}
|
{% assign tag_list = "" | split: "" %}
|
||||||
{{ tag[1] | size }}::{{ tag[0] | replace: ' ', '-' }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endcapture %}
|
|
||||||
|
|
||||||
{% assign all_tags = tags_array | split: " " | sort | reverse %}
|
{% for tag in site.tags %}
|
||||||
{% assign count = 0 %}
|
{% assign size = tag | last | size %}
|
||||||
|
{% assign size_list = size_list | push: size %}
|
||||||
|
|
||||||
|
{% assign tag_str = tag | first | append: "::" | append: size %}
|
||||||
|
{% assign tag_list = tag_list | push: tag_str %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign size_list = size_list | sort | reverse %}
|
||||||
|
|
||||||
|
{% assign tag_list = tag_list | sort_natural %}
|
||||||
|
|
||||||
{% assign trending_tags = "" | split: "" %}
|
{% assign trending_tags = "" | split: "" %}
|
||||||
|
|
||||||
{% for iter in all_tags %}
|
{% for size in size_list limit: MAX %}
|
||||||
{% assign count = count | plus: 1 %}
|
{% for tag_str in tag_list %}
|
||||||
{% assign tag = iter | split: "::" | last %}
|
{% assign tag = tag_str | split: "::" %}
|
||||||
|
{% assign tag_name = tag | first %}
|
||||||
{% assign trending_tags = trending_tags | push: tag %}
|
{% assign tag_size = tag | last | plus: 0 %}
|
||||||
|
{% if tag_size == size %}
|
||||||
{% if count >= MAX %}
|
{% unless trending_tags contains tag_name %}
|
||||||
{% break %}
|
{% assign trending_tags = trending_tags | push: tag_name %}
|
||||||
{% endif %}
|
{% break %}
|
||||||
|
{% endunless %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -10,11 +10,13 @@
|
|||||||
|
|
||||||
{% assign all_list = "" | split: "" %}
|
{% assign all_list = "" | split: "" %}
|
||||||
|
|
||||||
{% for entry in site.data.updates %}
|
{% for post in site.posts %}
|
||||||
{% capture elem %}
|
{% if post.last_modified_at %}
|
||||||
{{- entry.lastmod -}}::{{- entry.filename -}}
|
{% capture elem %}
|
||||||
{% endcapture %}
|
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
||||||
{% assign all_list = all_list | push: elem %}
|
{% endcapture %}
|
||||||
|
{% assign all_list = all_list | push: elem %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% assign all_list = all_list | sort | reverse %}
|
{% assign all_list = all_list | sort | reverse %}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Archives
|
layout: page
|
||||||
type: archives
|
|
||||||
# The Archives of posts.
|
# The Archives of posts.
|
||||||
# v2.0
|
# v2.0
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||||
@@ -8,6 +8,7 @@ type: archives
|
|||||||
# MIT License
|
# MIT License
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
<div id="archives" class="pl-xl-2">
|
<div id="archives" class="pl-xl-2">
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
||||||
@@ -37,4 +38,4 @@ type: archives
|
|||||||
{% assign last_month = "" %}
|
{% assign last_month = "" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Categories
|
layout: page
|
||||||
type: categories
|
|
||||||
# All the Categories of posts
|
# All the Categories of posts
|
||||||
# v2.0
|
# v2.0
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||||
@@ -8,6 +8,7 @@ type: categories
|
|||||||
# MIT License
|
# MIT License
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
{% assign HEAD_PREFIX = "h_" %}
|
{% assign HEAD_PREFIX = "h_" %}
|
||||||
{% assign LIST_PREFIX = "l_" %}
|
{% assign LIST_PREFIX = "l_" %}
|
||||||
|
|
||||||
@@ -45,7 +46,7 @@ type: categories
|
|||||||
{% else %}
|
{% else %}
|
||||||
<i class="far fa-folder fa-fw"></i>
|
<i class="far fa-folder fa-fw"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ site.baseurl }}/categories/{{ category_name | replace: ' ', '-' | downcase | url_encode }}/"
|
<a href="{{ site.baseurl }}/categories/{{ category_name | slugify | url_encode }}/"
|
||||||
class="ml-1 mr-2">
|
class="ml-1 mr-2">
|
||||||
{{ category_name }}
|
{{ category_name }}
|
||||||
</a>
|
</a>
|
||||||
@@ -64,8 +65,9 @@ type: categories
|
|||||||
|
|
||||||
<!-- arrow -->
|
<!-- arrow -->
|
||||||
{% if sub_categories_size > 0%}
|
{% if sub_categories_size > 0%}
|
||||||
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse" aria-expanded="true"
|
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse"
|
||||||
class="category-trigger hide-border-bottom">
|
aria-expanded="true" aria-label="{{ HEAD_PREFIX }}{{ group_index }}-trigger"
|
||||||
|
class="category-trigger hide-border-bottom">
|
||||||
<i class="fas fa-fw fa-angle-down"></i>
|
<i class="fas fa-fw fa-angle-down"></i>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -83,7 +85,7 @@ type: categories
|
|||||||
{% for sub_category in sub_categories %}
|
{% for sub_category in sub_categories %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<i class="far fa-folder fa-fw"></i>
|
<i class="far fa-folder fa-fw"></i>
|
||||||
<a href="{{ site.baseurl }}/categories/{{ sub_category | replace: ' ', '-' | downcase | url_encode }}/"
|
<a href="{{ site.baseurl }}/categories/{{ sub_category | slugify | url_encode }}/"
|
||||||
class="ml-1 mr-2">{{ sub_category }}</a>
|
class="ml-1 mr-2">{{ sub_category }}</a>
|
||||||
{% assign posts_size = site.categories[sub_category] | size %}
|
{% assign posts_size = site.categories[sub_category] | size %}
|
||||||
<span class="text-muted small font-weight-light">{{ posts_size }}
|
<span class="text-muted small font-weight-light">{{ posts_size }}
|
||||||
@@ -10,11 +10,11 @@ layout: page
|
|||||||
<h1 class="pl-lg-2">
|
<h1 class="pl-lg-2">
|
||||||
<i class="far fa-folder-open fa-fw text-muted"></i>
|
<i class="far fa-folder-open fa-fw text-muted"></i>
|
||||||
{{ page.title }}
|
{{ page.title }}
|
||||||
<span class="lead text-muted pl-2">{{ site.categories[page.category] | size }}</span>
|
<span class="lead text-muted pl-2">{{ page.posts | size }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<ul class="post-content pl-0">
|
<ul class="post-content pl-0">
|
||||||
{% for post in site.categories[page.category] %}
|
{% for post in page.posts %}
|
||||||
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
||||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
<span class="dash flex-grow-1"></span>
|
<span class="dash flex-grow-1"></span>
|
||||||
@@ -22,4 +22,4 @@ layout: page
|
|||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,34 +9,26 @@ layout: compress
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
{% if site.lang %}
|
|
||||||
{% assign lang = site.lang | split: "_" | first %}
|
|
||||||
{% else %}
|
|
||||||
{% assign lang = 'en' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% capture prefer_mode %}
|
{% capture prefer_mode %}
|
||||||
{% if site.theme_mode != "dual" %}
|
{% if site.theme_mode %}
|
||||||
mode="{{ site.theme_mode }}"
|
mode="{{ site.theme_mode }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<html lang="{{ lang }}" {{ prefer_mode }} >
|
<html lang="{{ site.lang | split: "_" | first | default: "en" }}" {{ prefer_mode }}>
|
||||||
|
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
|
|
||||||
<body data-spy="scroll" data-target="#toc">
|
<body data-spy="scroll" data-target="#toc">
|
||||||
|
|
||||||
<div id="sidebar" class="d-flex flex-column">
|
{% include sidebar.html %}
|
||||||
{% include sidebar.html %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include topbar.html %}
|
{% include topbar.html %}
|
||||||
|
|
||||||
<div id="main-wrapper">
|
<div id="main-wrapper">
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
{% include fixlinenos.html content=content %}
|
{% include refactor-content.html content=content %}
|
||||||
|
|
||||||
{% include footer.html %}
|
{% include footer.html %}
|
||||||
|
|
||||||
@@ -46,18 +38,18 @@ layout: compress
|
|||||||
|
|
||||||
</div> <!-- #main-wrapper -->
|
</div> <!-- #main-wrapper -->
|
||||||
|
|
||||||
|
{% if page.mermaid %}
|
||||||
|
{% include mermaid.html %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div id="mask"></div>
|
<div id="mask"></div>
|
||||||
|
|
||||||
<a id="back-to-top" href="#" class="btn btn-lg btn-box-shadow" role="button">
|
<a id="back-to-top" href="#" aria-label="back-to-top" class="btn btn-lg btn-box-shadow" role="button">
|
||||||
<i class="fas fa-angle-up"></i>
|
<i class="fas fa-angle-up"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% if jekyll.environment == 'production' %}
|
|
||||||
{% include google-analytics.html %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% include search-loader.html %}
|
{% include search-loader.html %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ layout: page
|
|||||||
|
|
||||||
|
|
||||||
{% assign pinned = site.posts | where_exp: "item", "item.pin == true" %}
|
{% assign pinned = site.posts | where_exp: "item", "item.pin == true" %}
|
||||||
{% assign default = site.posts | where_exp: "item", "item.pin == nil " %}
|
{% assign default = site.posts | where_exp: "item", "item.pin != true" %}
|
||||||
{% assign posts = "" | split: "" %}
|
{% assign posts = "" | split: "" %}
|
||||||
|
|
||||||
<!-- Get pinned posts -->
|
<!-- Get pinned posts -->
|
||||||
@@ -49,13 +49,10 @@ layout: page
|
|||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
|
|
||||||
<div class="post-preview">
|
<div class="post-preview">
|
||||||
<div class="d-flex justify-content-between pr-xl-2">
|
<h1>
|
||||||
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
{% if post.pin %}
|
</h1>
|
||||||
<i class="fas fa-thumbtack fa-fw text-muted mt-1 ml-2 mt-xl-2" data-toggle="tooltip" data-placement="left"
|
|
||||||
title="Pinned"></i>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<p>
|
<p>
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
@@ -63,19 +60,35 @@ layout: page
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-meta text-muted">
|
<div class="post-meta text-muted d-flex justify-content-between">
|
||||||
<!-- posted date -->
|
|
||||||
<i class="far fa-clock fa-fw"></i>
|
|
||||||
{% include timeago.html date=post.date tooltip=true %}
|
|
||||||
|
|
||||||
<!-- page views -->
|
<div>
|
||||||
{% if site.google_analytics.pv.enabled %}
|
<!-- posted date -->
|
||||||
<i class="far fa-eye fa-fw"></i>
|
<i class="far fa-calendar fa-fw"></i>
|
||||||
<span id="pv_{{-post.title-}}" class="pageviews">
|
{% include timeago.html date=post.date tooltip=true %}
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
|
||||||
</span>
|
<!-- time to read -->
|
||||||
|
<i class="far fa-clock fa-fw"></i>
|
||||||
|
{% include read-time.html content=post.content %}
|
||||||
|
|
||||||
|
<!-- page views -->
|
||||||
|
{% if site.google_analytics.pv.enabled %}
|
||||||
|
<i class="far fa-eye fa-fw"></i>
|
||||||
|
<span id="pv_{{-post.title-}}" class="pageviews">
|
||||||
|
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if post.pin %}
|
||||||
|
<div class="pin">
|
||||||
|
<i class="fas fa-thumbtack fa-fw"></i>
|
||||||
|
<span>{{ site.data.label.pin_prompt }}</span>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
</div> <!-- .post-review -->
|
</div> <!-- .post-review -->
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -18,55 +18,47 @@ layout: default
|
|||||||
<div class="post-meta text-muted d-flex flex-column">
|
<div class="post-meta text-muted d-flex flex-column">
|
||||||
<!-- Published date and author -->
|
<!-- Published date and author -->
|
||||||
<div>
|
<div>
|
||||||
Posted
|
|
||||||
{% include timeago.html date=page.date tooltip=true %}
|
{% include timeago.html date=page.date tooltip=true %}
|
||||||
by
|
by
|
||||||
<span class="author">
|
<span class="author">
|
||||||
{% if page.author %}
|
{{ page.author | default: site.author }}
|
||||||
{{ page.author }}
|
|
||||||
{% else %}
|
|
||||||
{{ site.author }}
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- lastmod -->
|
<div>
|
||||||
{%- capture filename -%}
|
<!-- lastmod -->
|
||||||
{{ page.url | split: "/" | last }}
|
{% if page.last_modified_at %}
|
||||||
{%- endcapture -%}
|
<span>
|
||||||
|
Updated
|
||||||
{% for item in site.data.updates %}
|
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
|
||||||
{% assign encode_filename = item.filename | url_encode %}
|
</span>
|
||||||
{% if filename == encode_filename %}
|
|
||||||
{% assign lastmod = item.lastmod %}
|
|
||||||
{% break %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% if lastmod %}
|
<!-- read time -->
|
||||||
<div>
|
{% include read-time.html content=content %}
|
||||||
Updated
|
|
||||||
{% include timeago.html date=lastmod class="lastmod" tooltip=true %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- page views -->
|
<!-- page views -->
|
||||||
{% if site.google_analytics.pv.enabled %}
|
{% if site.google_analytics.pv.enabled %}
|
||||||
<div>
|
|
||||||
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span>
|
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span>
|
||||||
views
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div> <!-- .post-meta -->
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
{%- capture img_placehodler -%}
|
||||||
|
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
{% if page.image %}
|
{% if page.image %}
|
||||||
<img src="{{ page.image }}">
|
<img src="{{ img_placehodler }}" data-src="{{ page.image }}" class="preview-img">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||||
{% if content contains '<img src=' %}
|
{% if content contains '<img src=' %}
|
||||||
{{ content | replace: '<img src=', '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src=' }}
|
{% assign replacement = '<img src="' | append: img_placehodler | append: '" data-src=' %}
|
||||||
|
{{ content | replace: '<img src=', replacement }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ content }}
|
{{ content }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -79,7 +71,7 @@ layout: default
|
|||||||
<div class="post-meta mb-3">
|
<div class="post-meta mb-3">
|
||||||
<i class="far fa-folder-open fa-fw mr-1"></i>
|
<i class="far fa-folder-open fa-fw mr-1"></i>
|
||||||
{% for category in page.categories %}
|
{% for category in page.categories %}
|
||||||
<a href='{{ site.baseurl }}/categories/{{ category | replace: ' ', '-' | downcase | url_encode }}/'>{{ category }}</a>
|
<a href='{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/'>{{ category }}</a>
|
||||||
{%- unless forloop.last -%}, {%- endunless -%}
|
{%- unless forloop.last -%}, {%- endunless -%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -90,7 +82,7 @@ layout: default
|
|||||||
<div class="post-tags">
|
<div class="post-tags">
|
||||||
<i class="fa fa-tags fa-fw mr-1"></i>
|
<i class="fa fa-tags fa-fw mr-1"></i>
|
||||||
{% for tag in page.tags %}
|
{% for tag in page.tags %}
|
||||||
<a href="{{ site.baseurl }}/tags/{{ tag | replace: ' ', '-' | downcase | url_encode }}/"
|
<a href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
|
||||||
class="post-tag no-text-decoration" >
|
class="post-tag no-text-decoration" >
|
||||||
{{- tag -}}
|
{{- tag -}}
|
||||||
</a>
|
</a>
|
||||||
@@ -119,7 +111,15 @@ layout: default
|
|||||||
|
|
||||||
</div> <!-- #post-wrapper -->
|
</div> <!-- #post-wrapper -->
|
||||||
|
|
||||||
{% include panel.html %}
|
{% assign enable_toc = false %}
|
||||||
|
|
||||||
|
{% if site.toc and page.toc %}
|
||||||
|
{% if content contains '<h2' or content contains '<h3' %}
|
||||||
|
{% assign enable_toc = true %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% include panel.html toc=enable_toc %}
|
||||||
|
|
||||||
</div> <!-- .row -->
|
</div> <!-- .row -->
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ layout: page
|
|||||||
<h1 class="pl-lg-2">
|
<h1 class="pl-lg-2">
|
||||||
<i class="fa fa-tag fa-fw text-muted"></i>
|
<i class="fa fa-tag fa-fw text-muted"></i>
|
||||||
{{ page.title }}
|
{{ page.title }}
|
||||||
<span class="lead text-muted pl-2">{{ site.tags[page.tag] | size }}</span>
|
<span class="lead text-muted pl-2">{{ page.posts | size }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
<ul class="post-content pl-0">
|
<ul class="post-content pl-0">
|
||||||
{% for post in site.tags[page.tag] %}
|
{% for post in page.posts %}
|
||||||
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
||||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
<span class="dash flex-grow-1"></span>
|
<span class="dash flex-grow-1"></span>
|
||||||
@@ -22,4 +22,4 @@ layout: page
|
|||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
26
_layouts/tags.html
Normal file
26
_layouts/tags.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
layout: page
|
||||||
|
|
||||||
|
# All the Tags of posts.
|
||||||
|
# v2.0
|
||||||
|
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||||
|
# © 2017-2019 Cotes Chung
|
||||||
|
# MIT License
|
||||||
|
---
|
||||||
|
|
||||||
|
<div id="tags" class="d-flex flex-wrap ml-xl-2 mr-xl-2">
|
||||||
|
|
||||||
|
{% assign tags = "" | split: "" %}
|
||||||
|
{% for t in site.tags %}
|
||||||
|
{% assign tags = tags | push: t[0] %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign sorted_tags = tags | sort_natural %}
|
||||||
|
|
||||||
|
{% for t in sorted_tags %}
|
||||||
|
<div>
|
||||||
|
<a class="tag" href="{{ site.baseurl }}/tags/{{ t | slugify | url_encode }}/">{{ t }}<span class="text-muted">{{ site.tags[t].size }}</span></a>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</div>
|
||||||
11
_plugins/posts-lastmod-hook.rb
Normal file
11
_plugins/posts-lastmod-hook.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Check for changed posts
|
||||||
|
Jekyll::Hooks.register :posts, :post_init do |post|
|
||||||
|
|
||||||
|
commit_num = `git rev-list --count HEAD "#{ post.path }"`
|
||||||
|
|
||||||
|
if commit_num.to_i > 1
|
||||||
|
lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"`
|
||||||
|
post.data['last_modified_at'] = lastmod_date
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -5,22 +5,24 @@ date: 2019-08-08 11:33:00 +0800
|
|||||||
categories: [Blogging, Demo]
|
categories: [Blogging, Demo]
|
||||||
tags: [typography]
|
tags: [typography]
|
||||||
math: true
|
math: true
|
||||||
|
mermaid: true
|
||||||
|
image: /assets/img/sample/devices-mockup.png
|
||||||
---
|
---
|
||||||
|
|
||||||
This Jekyll template totally compatible with Markdown syntax. Now, let's take a look for the text and typography in here.
|
This post is to show Markdown syntax rendering on [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork), you can also use it as an example of writing. Now, let's start looking at text and typography.
|
||||||
|
|
||||||
|
|
||||||
## Titles
|
## Titles
|
||||||
|
---
|
||||||
|
# H1 - heading
|
||||||
|
|
||||||
***
|
<h2 data-toc-skip>H2 - heading</h2>
|
||||||
# H1
|
|
||||||
|
|
||||||
<h2 data-toc-skip>H2</h2>
|
<h3 data-toc-skip>H3 - heading</h3>
|
||||||
|
|
||||||
<h3 data-toc-skip>H3</h3>
|
<h4>H4 - heading</h4>
|
||||||
|
---
|
||||||
#### H4
|
<br>
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
## Paragraph
|
## Paragraph
|
||||||
|
|
||||||
@@ -36,36 +38,107 @@ Beside the lake, beneath the trees,
|
|||||||
|
|
||||||
Fluttering and dancing in the breeze.
|
Fluttering and dancing in the breeze.
|
||||||
|
|
||||||
|
## Lists
|
||||||
|
|
||||||
|
### Ordered list
|
||||||
|
|
||||||
|
1. Firstly
|
||||||
|
2. Secondly
|
||||||
|
3. Thirdly
|
||||||
|
|
||||||
|
### Unordered list
|
||||||
|
|
||||||
|
- Chapter
|
||||||
|
- Setcion
|
||||||
|
- Paragraph
|
||||||
|
|
||||||
|
### Task list
|
||||||
|
|
||||||
|
- [ ] TODO
|
||||||
|
- [x] Completed
|
||||||
|
- Hold on
|
||||||
|
- [ ] Defeat COVID-19
|
||||||
|
- [x] Vaccine production
|
||||||
|
- [ ] Economic recovery
|
||||||
|
- [ ] People smile again
|
||||||
|
|
||||||
|
### Description list
|
||||||
|
|
||||||
|
Sun
|
||||||
|
: the star around which the earth orbits
|
||||||
|
|
||||||
|
Moon
|
||||||
|
: the natural satellite of the earth, visible by reflected light from the sun
|
||||||
|
|
||||||
|
|
||||||
## Block Quote
|
## Block Quote
|
||||||
|
|
||||||
> This line to shows the Block Quote.
|
> This line to shows the Block Quote.
|
||||||
|
|
||||||
## Tables
|
## Tables
|
||||||
|
|
||||||
|Company|Contact|Country|
|
| Company | Contact | Country |
|
||||||
|:---|:--|---:|
|
|:-----------------------------|:-----------------|--------:|
|
||||||
|Alfreds Futterkiste | Maria Anders | Germany
|
| Alfreds Futterkiste | Maria Anders | Germany |
|
||||||
|Island Trading | Helen Bennett | UK
|
| Island Trading | Helen Bennett | UK |
|
||||||
|Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy
|
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
|
||||||
|
|
||||||
## Link
|
## Links
|
||||||
|
|
||||||
<http://127.0.0.1:4000>
|
<http://127.0.0.1:4000>
|
||||||
|
|
||||||
|
|
||||||
## Footnote
|
## Footnote
|
||||||
|
|
||||||
Click the hook will locate the footnote[^footnote].
|
Click the hook will locate the footnote[^footnote], and here is another footnote[^fn-nth-2].
|
||||||
|
|
||||||
|
|
||||||
## Image
|
## Images
|
||||||
|
|
||||||

|
- Default (with caption)
|
||||||
|
|
||||||
|

|
||||||
|
_Full screen width and center alignment_
|
||||||
|
|
||||||
## Inline code
|
<br>
|
||||||
|
|
||||||
|
- Specify width
|
||||||
|
|
||||||
|
{: width="400"}
|
||||||
|
_400px image width_
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
- Left aligned
|
||||||
|
|
||||||
|
{: width="350" .normal}
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
- Float to left
|
||||||
|
|
||||||
|
{: width="240" .left}
|
||||||
|
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
- Float to right
|
||||||
|
|
||||||
|
{: width="240" .right}
|
||||||
|
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
## Mermaid SVG
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
gantt
|
||||||
|
title Adding GANTT diagram functionality to mermaid
|
||||||
|
apple :a, 2017-07-20, 1w
|
||||||
|
banana :crit, b, 2017-07-23, 1d
|
||||||
|
cherry :active, c, after b a, 1d
|
||||||
|
```
|
||||||
|
|
||||||
This is an example of `Inline Code`.
|
|
||||||
|
|
||||||
## Mathematics
|
## Mathematics
|
||||||
|
|
||||||
@@ -77,7 +150,13 @@ When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they
|
|||||||
|
|
||||||
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
||||||
|
|
||||||
## Code Snippet
|
|
||||||
|
## Inline code
|
||||||
|
|
||||||
|
This is an example of `Inline Code`.
|
||||||
|
|
||||||
|
|
||||||
|
## Code block
|
||||||
|
|
||||||
### Common
|
### Common
|
||||||
|
|
||||||
@@ -90,14 +169,6 @@ This is a common code snippet, without syntax highlight and line number.
|
|||||||
#### Console
|
#### Console
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ date
|
|
||||||
Sun Nov 3 15:11:12 CST 2019
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### Terminal
|
|
||||||
|
|
||||||
```terminal
|
|
||||||
$ env |grep SHELL
|
$ env |grep SHELL
|
||||||
SHELL=/usr/local/bin/bash
|
SHELL=/usr/local/bin/bash
|
||||||
PYENV_SHELL=bash
|
PYENV_SHELL=bash
|
||||||
@@ -131,38 +202,18 @@ fi;
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
#### HTML
|
#### Java
|
||||||
|
|
||||||
```html
|
```java
|
||||||
<div class="sidenav">
|
private void writeObject(java.io.ObjectOutputStream s)
|
||||||
<a href="#contact">Contact</a>
|
throws java.io.IOException {
|
||||||
<button class="dropdown-btn">Dropdown
|
// Write out any hidden serialization magic
|
||||||
<i class="fa fa-caret-down"></i>
|
s.defaultWriteObject();
|
||||||
</button>
|
for (E e: map.keySet()) s.writeObject(e);
|
||||||
<div class="dropdown-container">
|
}
|
||||||
<a href="#">Link 1</a>
|
|
||||||
<a href="#">Link 2</a>
|
|
||||||
<a href="#">Link 3</a>
|
|
||||||
</div>
|
|
||||||
<a href="#contact">Search</a>
|
|
||||||
</div>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Horizontal Scrolling**
|
|
||||||
|
|
||||||
```html
|
|
||||||
<div class="panel-group">
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-heading" id="{{ category_name }}">
|
|
||||||
<i class="far fa-folder"></i>
|
|
||||||
<p>This is a very long long long long long long long long long long long long long long long long long long long long long line.</p>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Reverse Footnote
|
## Reverse Footnote
|
||||||
|
|
||||||
[^footnote]: The footnote source.
|
[^footnote]: The footnote source
|
||||||
|
[^fn-nth-2]: The 2nd footnote source
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ tags: [writing]
|
|||||||
|
|
||||||
## Naming and Path
|
## Naming and Path
|
||||||
|
|
||||||
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_post/` of the root directory. The `EXTENSION` must be one of `md` and `markdown`. From `v2.4.1`, you can create sub-directories under `_posts/` to categorize posts.
|
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_posts/` of the root directory. Please note that the `EXTENSION` must be one of `md` and `markdown`.
|
||||||
|
|
||||||
## Front Matter
|
## Front Matter
|
||||||
|
|
||||||
@@ -31,67 +31,13 @@ In order to accurately record the release date of a post, you should not only se
|
|||||||
|
|
||||||
### Categories and Tags
|
### Categories and Tags
|
||||||
|
|
||||||
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity.
|
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity. For instance:
|
||||||
|
|
||||||
The list of posts belonging to the same _category_/_tag_ is recorded on a separate page. At the same time, the number of these _category_/_tag_ type pages is equal to the number of `categories` / `tags` elements for all posts, which means that the two number must be exactly the same.
|
|
||||||
|
|
||||||
For instance, let's say there is a post with front matter:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
categories: [Animal, Insect]
|
categories: [Animal, Insect]
|
||||||
tags: bee
|
tags: [bee]
|
||||||
```
|
```
|
||||||
|
|
||||||
Then we should have two _category_ type pages placed in folder `categories` of root and one _tag_ type page placed in folder `tags` of root:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
.
|
|
||||||
├── categories
|
|
||||||
│ ├── animal.html # a category type page
|
|
||||||
│ └── insect.html
|
|
||||||
├── tags
|
|
||||||
│ └── bee.html # a tag type page
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
and the content of a _category_ type page is
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
layout: category
|
|
||||||
title: CATEGORY_NAME # e.g. Insect
|
|
||||||
category: CATEGORY_NAME # e.g. Insect
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
the content of a _tag_ type page is
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
layout: tag
|
|
||||||
title: TAG_NAME # e.g. bee
|
|
||||||
tag: TAG_NAME # e.g. bee
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
With the increasing number of posts, the number of categories and tags will increase several times! If we still manually create these *category*/_tag_ type files, it will obviously be a super time-consuming job, and it is very likely to miss some of them, i.e., when you click on the missing `category` or `tag` link from a post or somewhere, the browser will complain to you "404 Not Found". The good news is we got a lovely script tool `_scripts/sh/create_pages.sh` to finish the boring tasks. Basically we will use it via `run.sh`, `build.sh`, `deploy.sh` or `publish.sh` that placed in `tools/` instead of running it separately. Check out its use case [here]({{ "/posts/getting-started/#deployment" | relative_url }}).
|
|
||||||
|
|
||||||
## Last modified date
|
|
||||||
|
|
||||||
The last modified date of a post is obtained according to the post's latest git commit date, and the modified date of all posts are designed to be stored in the file `_data/updates.yml`. Then contents of that file may be as follows:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
-
|
|
||||||
filename: getting-started # the post filename without date and extension
|
|
||||||
lastmod: 2020-04-13 00:38:56 +0800 # the post last modified date
|
|
||||||
-
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
You can choose to create this file manually, But the better approach is to let it be automatically generated by a script tool, and `_scripts/sh/dump_lastmod.sh` was born for this! Similar to the other script (`create_pages.sh`) mentioned above, it is also be called from the other superior tools, so it doesn't have to be used separately.
|
|
||||||
|
|
||||||
When some posts have been modified since their published date and also the file `_data/updates.yml` was created correctly, a list with the label **Recent Updates** will be displayed in the right panel of the desktop view, which records the five most recently modified posts.
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the value of variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the value of variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
||||||
@@ -102,7 +48,6 @@ toc: false
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Comments
|
## Comments
|
||||||
|
|
||||||
Similar to TOC, the [Disqus](https://disqus.com/) comments is loaded by default in each post, and the global switch is defined by variable `comments` in file `_config.yml` . If you want to close the comment for specific post, add the following to the **Front Matter** of the post:
|
Similar to TOC, the [Disqus](https://disqus.com/) comments is loaded by default in each post, and the global switch is defined by variable `comments` in file `_config.yml` . If you want to close the comment for specific post, add the following to the **Front Matter** of the post:
|
||||||
@@ -113,7 +58,6 @@ comments: false
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Mathematics
|
## Mathematics
|
||||||
|
|
||||||
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:
|
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:
|
||||||
@@ -124,6 +68,72 @@ math: true
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Mermaid
|
||||||
|
|
||||||
|
[**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagrams generation tool. To enable it on your post, add the following to the YAML block:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
---
|
||||||
|
mermaid: true
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you can use it like other markdown language: surround the graph code with ```` ```mermaid ```` and ```` ``` ````.
|
||||||
|
|
||||||
|
## Images
|
||||||
|
|
||||||
|
### Preview image
|
||||||
|
|
||||||
|
If you want to add an image to the top of the post contents, specify the url for the image by:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
image: /path/to/image-file
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image caption
|
||||||
|
|
||||||
|
Add italics to the next line of an image,then it will become the caption and appear at the bottom of the image:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|

|
||||||
|
_Image Caption_
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image size
|
||||||
|
|
||||||
|
You can specify the width (and height) of a image with `width`:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: width="400"}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image position
|
||||||
|
|
||||||
|
By default, the image is centered, but you can specify the position by using one of class `normal` , `left` and `right`. For example:
|
||||||
|
|
||||||
|
- **Normal position**
|
||||||
|
|
||||||
|
Image will be left aligned in below sample:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: width="350" .normal}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Float to the left**
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: width="240" .left}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Float to the right**
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: width="240" .right}
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Limitation**: Once you specify the position of an image, it is forbidden to add the image caption.
|
||||||
|
|
||||||
## Pinned Posts
|
## Pinned Posts
|
||||||
|
|
||||||
@@ -135,10 +145,9 @@ pin: true
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Code Block
|
## Code Block
|
||||||
|
|
||||||
Markdown symbols <code class="highlighter-rouge">```</code> can easily create a code block as following examples.
|
Markdown symbols ```` ``` ```` can easily create a code block as following examples.
|
||||||
|
|
||||||
```
|
```
|
||||||
This is a common code snippet, without syntax highlight and line number.
|
This is a common code snippet, without syntax highlight and line number.
|
||||||
@@ -146,7 +155,7 @@ This is a common code snippet, without syntax highlight and line number.
|
|||||||
|
|
||||||
## Specific Language
|
## Specific Language
|
||||||
|
|
||||||
Using <code class="highlighter-rouge">```Language</code> you will get code snippets with line Numbers and syntax highlight.
|
Using ```` ```language ```` you will get code snippets with line numbers and syntax highlight.
|
||||||
|
|
||||||
> **Note**: The Jekyll style `{% raw %}{%{% endraw %} highlight LANGUAGE {% raw %}%}{% endraw %}` or `{% raw %}{%{% endraw %} highlight LANGUAGE linenos {% raw %}%}{% endraw %}` are not allowed to be used in this theme !
|
> **Note**: The Jekyll style `{% raw %}{%{% endraw %} highlight LANGUAGE {% raw %}%}{% endraw %}` or `{% raw %}{%{% endraw %} highlight LANGUAGE linenos {% raw %}%}{% endraw %}` are not allowed to be used in this theme !
|
||||||
|
|
||||||
@@ -159,7 +168,7 @@ items:
|
|||||||
quantity: 4
|
quantity: 4
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 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 %}{%{% endraw %} raw {%raw%}%}{%endraw%}` and `{% raw %}{%{% endraw %} endraw {%raw%}%}{%endraw%}` .
|
||||||
|
|
||||||
@@ -171,7 +180,6 @@ If you want to display the **Liquid** snippet, surround the liquid code with `{%
|
|||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
|
|
||||||
## 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/).
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ pin: true
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub, and clone the fork to local by:
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub, rename the repository to `USERNAME.github.io` (where `USERNAME` is your GitHub username), and then open terminal and clone the fork to local by:
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ git clone git@github.com:<username>/jekyll-theme-chirpy -b master --single-branch
|
$ git clone https://github.com/USERNAME/USERNAME.github.io.git -b master --single-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up the local envrionment
|
### Setting up the local envrionment
|
||||||
|
|
||||||
If you would like to run or build the project on your local machine, please follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems` and `Bundler`.
|
If you would like to run or build the project on your local machine, please follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`.
|
||||||
|
|
||||||
Before running or building for the first time, please complete the installation of the Jekyll plugins. Go to the root directory of project and run:
|
Before running or building for the first time, please complete the installation of the Jekyll plugins. Go to the root directory of project and run:
|
||||||
|
|
||||||
@@ -28,25 +28,16 @@ $ bundle install
|
|||||||
|
|
||||||
`bundle` will automatically install all the dependencies specified by `Gemfile`.
|
`bundle` will automatically install all the dependencies specified by `Gemfile`.
|
||||||
|
|
||||||
What's more, in order to generate some extra files (*categories*, *tags* and *last modified list*), we need to use some tool scripts. If your machine is running Debian or macOS, make sure that [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, install by:
|
### Setting up Docker environment (optional)
|
||||||
|
|
||||||
* Debian
|
If you're a loyal fan of [**Docker**](https://www.docker.com/) or just too lazy to install the packages mentioned in [_Setting up the local envrionment_](#setting-up-the-local-envrionment), please make sure you have **Docker Engine** installed and running, and then get Docker image `jekyll/jekyll` from Docker Hub by the following command:
|
||||||
|
|
||||||
```console
|
|
||||||
$ sudo apt-get install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
* macOS
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ brew install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker pull jekyll/jekyll
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Running [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) requires some extra files, which cannot be generated by Jekyll native commands, so please strictly follow the methods mentioned below to run or deploy your website.
|
|
||||||
|
|
||||||
### Initialization
|
### Initialization
|
||||||
|
|
||||||
Go to the root directory of the project and start initialization:
|
Go to the root directory of the project and start initialization:
|
||||||
@@ -55,88 +46,86 @@ Go to the root directory of the project and start initialization:
|
|||||||
$ bash tools/init.sh
|
$ bash tools/init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
> If you not intend to deploy it on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
> **Note**: If you not intend to deploy it on GitHub Pages, append parameter option `--no-gh` at the end of the above command.
|
||||||
|
|
||||||
What it does is:
|
What it does is:
|
||||||
|
|
||||||
1. Remove some files or directories from your repository:
|
1. Remove some files or directories from your repository:
|
||||||
- `.travis.yml`
|
|
||||||
- everything under `.github/`
|
|
||||||
- files under `_posts/`
|
|
||||||
- folder `docs/`
|
|
||||||
|
|
||||||
2. Unless the option `--no-gh` was enabled, setup the GitHub action workflow by renaming `pages-deploy.yml.hook` of directory `.github/workflows/` to `pages-deploy.yml`.
|
- `.travis.yml`
|
||||||
|
- files under `_posts`
|
||||||
|
- folder `docs`
|
||||||
|
|
||||||
|
2. If you use the `--no-gh` option, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in folder `.github`.
|
||||||
|
|
||||||
3. Automatically create a commit to save the changes.
|
3. Automatically create a commit to save the changes.
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
|
Generally, go to `_config.yml` and configure the variables as needed. Some of them are typical options:
|
||||||
* `url`
|
|
||||||
* `avatar`
|
|
||||||
* `timezone`
|
|
||||||
* `theme_mode`
|
|
||||||
|
|
||||||
|
- `url`
|
||||||
|
- `avatar`
|
||||||
|
- `timezone`
|
||||||
|
- `theme_mode`
|
||||||
|
|
||||||
### Run Locally
|
### Run Locally
|
||||||
|
|
||||||
You may want to preview the site contents before publishing, so just run it by:
|
You may want to preview the site contents before publishing, so just run it by:
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ bash tools/run.sh
|
$ bundle exec jekyll s
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open a browser and visit to <http://localhost:4000>.
|
Then open a browser and visit to <http://localhost:4000>.
|
||||||
|
|
||||||
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
|
### Run on Docker
|
||||||
|
|
||||||
|
Run the site on Docker with the following command:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
$ docker run --rm -it \
|
||||||
|
--volume="$PWD:/srv/jekyll" \
|
||||||
|
-p 4000:4000 jekyll/jekyll \
|
||||||
|
jekyll serve
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [_project site_](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash. For example, `/project`.
|
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [_project site_](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base url on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash. For example, `/project`.
|
||||||
|
|
||||||
Assuming you have already gone through the [initialization](#initialization), you can now choose any of the following methods to deploy your website.
|
Assuming you have already gone through the [initialization](#initialization), you can now choose ONE of the following methods to deploy your website.
|
||||||
|
|
||||||
#### Deploy on GitHub Pages
|
#### Deploy on GitHub Pages
|
||||||
|
|
||||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using tool scripts to generate additional page files. Therefore, we can use GitHub Actions to build the site, store the built site files on a new branch, and use that branch as the source of the Pages service.
|
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the Pages service.
|
||||||
|
|
||||||
1. Push any commit to `origin/master` to trigger the GitHub Actions workflow. Once the build is complete, a new remote branch called `gh-pages` will appear, which is used to store the built site files.
|
1. Push any commit to `origin/master` to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
||||||
|
|
||||||
2. Unless you prefer to project sites, rename your repository to `<username>.github.io` on GitHub.
|
2. Browse to your repo's landing page on GitHub and select the branch `gh-pages` as the [publishing source](https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) throught _Settings_ → _Options_ → _GitHub Pages_:
|
||||||
|
{: width="650" class="normal"}
|
||||||
|
|
||||||
3. Choose branch `gh-pages` as your GitHub Pages source.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
4. Visit your website at the address indicated by GitHub.
|
|
||||||
|
|
||||||
#### Deploy on Other Platforms
|
#### Deploy on Other Platforms
|
||||||
|
|
||||||
On platforms other than GitHub, e.g. GitLab, we cannot enjoy the convenience of **GitHub Actions**. However, we have a tool to make up for this shortcoming.
|
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.
|
||||||
|
|
||||||
Commit the changes of your repository first, then run the publish script:
|
Go to the root of the source project, build your site by:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/publish.sh
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
> Please note that the *Recent Update* list requires the latest git-log date of posts, thus make sure the changes in `_posts` have been committed before running this command.
|
Or, build the site with Docker by:
|
||||||
|
|
||||||
It will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts and submit a commit, then push to `origin/master`. Its output is similar to the following log:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
[INFO] Success to update lastmod for 4 post(s).
|
$ docker run -it --rm \
|
||||||
[INFO] Succeed! 3 category-pages created.
|
--env JEKYLL_ENV=production \
|
||||||
[INFO] Succeed! 4 tag-pages created.
|
--volume="$PWD:/srv/jekyll" \
|
||||||
[INFO] Published successfully!
|
jekyll/jekyll \
|
||||||
|
jekyll build
|
||||||
```
|
```
|
||||||
|
|
||||||
Lastly, enable the pages service according to the instructions of the platform you choose.
|
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.
|
||||||
|
|
||||||
#### Deploy on Private Server
|
|
||||||
|
|
||||||
In the root of the source project, build your site by:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bash tools/build.sh -d /path/to/site/
|
|
||||||
```
|
|
||||||
|
|
||||||
The generated site files will be placed in the root of `/path/to/site/`. Now you should upload those files to your web server, such as Nginx.
|
|
||||||
|
|||||||
@@ -11,17 +11,29 @@ In [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/), the image fi
|
|||||||
|
|
||||||
With a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
|
With a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
|
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
|
||||||
|
|
||||||

|
{: width="600"}
|
||||||
|
|
||||||
Download the generated package, unzip and delete the following two from the extracted files:
|
Download the generated package, unzip and delete the following two from the extracted files:
|
||||||
|
|
||||||
- browserconfig.xml
|
- browserconfig.xml
|
||||||
- manifest.json
|
- manifest.json
|
||||||
|
|
||||||
Now, copy the rest image files (`.PNG` and `.ICO`) to cover the original one in folder `assets/img/favicons/`.
|
Now, copy the remaining image files (`.PNG` and `.ICO`) from the extracted `.zip` file to cover the original files in the folder `assets/img/favicons/`.
|
||||||
|
|
||||||
Lastly, don't forget to rebuild your site so that the icon becomes your custom edition.
|
The following table helps you understand the changes to the icon file:
|
||||||
|
|
||||||
|
> ✓ means keep, ✗ means delete.
|
||||||
|
|
||||||
|
| File(s) | From Favicon & App Icon Generator | From Chirpy |
|
||||||
|
|---------------------|:---------------------------------:|:-----------:|
|
||||||
|
| `*.PNG` | ✓ | ✗ |
|
||||||
|
| `*.ICO` | ✓ | ✗ |
|
||||||
|
| `browserconfig.xml` | ✗ | ✓ |
|
||||||
|
| `manifest.json` | ✗ | ✓ |
|
||||||
|
|
||||||
|
|
||||||
|
The next time you build the site, the icon will be replaced with a customized edition.
|
||||||
|
|||||||
@@ -1,162 +0,0 @@
|
|||||||
#!/usr/local/bin/bash
|
|
||||||
#
|
|
||||||
# Create HTML pages for Categories and Tags in posts.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# Call from the '_posts' sibling directory.
|
|
||||||
#
|
|
||||||
# v2.2
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# Published under MIT License
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
TYPE_CATEGORY=0
|
|
||||||
TYPE_TAG=1
|
|
||||||
|
|
||||||
category_count=0
|
|
||||||
tag_count=0
|
|
||||||
|
|
||||||
|
|
||||||
_read_yaml() {
|
|
||||||
local _endline=$(grep -n "\-\-\-" $1 | cut -d: -f 1 | sed -n '2p')
|
|
||||||
head -$_endline $1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
read_categories() {
|
|
||||||
local _yaml=$(_read_yaml $1)
|
|
||||||
local _categories=$(echo "$_yaml" | grep "^categories:")
|
|
||||||
local _category=$(echo "$_yaml" | grep "^category:")
|
|
||||||
|
|
||||||
if [[ ! -z "$_categories" ]]; then
|
|
||||||
echo "$_categories" | sed "s/categories: *//;s/\[//;s/\].*//;s/, */,/g;s/\"//g;s/'//g"
|
|
||||||
elif [[ ! -z "_category" ]]; then
|
|
||||||
echo "$_category" | sed "s/category: *//;s/\[//;s/\].*//;s/, */,/g;s/\"//g;s/'//g"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
read_tags() {
|
|
||||||
local _yaml=$(_read_yaml $1)
|
|
||||||
echo "$_yaml" | grep "^tags:" | sed "s/tags: *//;s/\[//;s/\].*//;s/, */,/g;s/\"//g;s/'//g"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
init() {
|
|
||||||
|
|
||||||
if [[ -d categories ]]; then
|
|
||||||
rm -rf categories
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -d tags ]]; then
|
|
||||||
rm -rf tags
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d _posts ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir categories tags
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
create_category() {
|
|
||||||
if [[ ! -z $1 ]]; then
|
|
||||||
local _name=$1
|
|
||||||
local _filepath="categories/$(echo $_name | sed 's/ /-/g' | awk '{print tolower($0)}').html"
|
|
||||||
|
|
||||||
if [[ ! -f $_filepath ]]; then
|
|
||||||
echo "---" > $_filepath
|
|
||||||
echo "layout: category" >> $_filepath
|
|
||||||
echo "title: $_name" >> $_filepath
|
|
||||||
echo "category: $_name" >> $_filepath
|
|
||||||
echo "---" >> $_filepath
|
|
||||||
|
|
||||||
((category_count=category_count+1))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
create_tag() {
|
|
||||||
if [[ ! -z $1 ]]; then
|
|
||||||
local _name=$1
|
|
||||||
local _filepath="tags/$( echo $_name | sed "s/ /-/g;s/'//g" | awk '{print tolower($0)}' ).html"
|
|
||||||
|
|
||||||
if [[ ! -f $_filepath ]]; then
|
|
||||||
|
|
||||||
echo "---" > $_filepath
|
|
||||||
echo "layout: tag" >> $_filepath
|
|
||||||
echo "title: $_name" >> $_filepath
|
|
||||||
echo "tag: $_name" >> $_filepath
|
|
||||||
echo "---" >> $_filepath
|
|
||||||
|
|
||||||
((tag_count=tag_count+1))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#########################################
|
|
||||||
# Create HTML pages for Categories/Tags.
|
|
||||||
# Arguments:
|
|
||||||
# $1 - an array string
|
|
||||||
# $2 - type specified option
|
|
||||||
#########################################
|
|
||||||
create_pages() {
|
|
||||||
if [[ ! -z $1 ]]; then
|
|
||||||
# split string to array
|
|
||||||
IFS_BAK=$IFS
|
|
||||||
IFS=','
|
|
||||||
local _string=$1
|
|
||||||
|
|
||||||
case $2 in
|
|
||||||
|
|
||||||
$TYPE_CATEGORY)
|
|
||||||
for i in ${_string#,}; do
|
|
||||||
create_category $i
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
$TYPE_TAG)
|
|
||||||
for i in ${_string#,}; do
|
|
||||||
create_tag $i
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
IFS=$IFS_BAK
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
|
|
||||||
init
|
|
||||||
|
|
||||||
for _file in $(find "_posts" -type f \( -iname \*.md -o -iname \*.markdown \))
|
|
||||||
do
|
|
||||||
local _categories=$(read_categories "$_file")
|
|
||||||
local _tags=$(read_tags "$_file")
|
|
||||||
|
|
||||||
create_pages "$_categories" $TYPE_CATEGORY
|
|
||||||
create_pages "$_tags" $TYPE_TAG
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $category_count -gt 0 ]]; then
|
|
||||||
echo "[INFO] Succeed! $category_count category-pages created."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $tag_count -gt 0 ]]; then
|
|
||||||
echo "[INFO] Succeed! $tag_count tag-pages created."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Find out the posts that have been modified and record
|
|
||||||
# its lastmod information to file '_data/updates.yml'
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# Call from the '_posts' sibling directory.
|
|
||||||
#
|
|
||||||
# v2.2
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2020 Cotes Chung
|
|
||||||
# Published under MIT License
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
POST_DIR=_posts
|
|
||||||
OUTPUT_DIR=_data
|
|
||||||
OUTPUT_FILE=updates.yml
|
|
||||||
|
|
||||||
|
|
||||||
_init() {
|
|
||||||
|
|
||||||
if [[ ! -d "$OUTPUT_DIR" ]]; then
|
|
||||||
mkdir "$OUTPUT_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$OUTPUT_DIR/$OUTPUT_FILE" ]]; then
|
|
||||||
rm -f "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d $POST_DIR ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_has_changed() {
|
|
||||||
local _log_count=`git log --pretty=%ad $1 | wc -l | sed 's/ *//'`
|
|
||||||
_log_count=$(($_log_count + 0))
|
|
||||||
|
|
||||||
if [[ $_log_count > 1 ]]; then
|
|
||||||
return 0 # true
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 1 # false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
###################################
|
|
||||||
# Storage the posts' lastmod.
|
|
||||||
#
|
|
||||||
# Args:
|
|
||||||
# - $1 the post's filename
|
|
||||||
# - $2 the post's filepath
|
|
||||||
# Output:
|
|
||||||
# the file '_data/updates.yml'
|
|
||||||
###################################
|
|
||||||
_dump() {
|
|
||||||
local _lasmod="`git log -1 --pretty=%ad --date=iso $2`"
|
|
||||||
|
|
||||||
if [[ ! -f "$OUTPUT_DIR/$OUTPUT_FILE" ]]; then
|
|
||||||
touch "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "-" >> "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
echo " filename: '$1'" >> "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
echo " lastmod: '$_lasmod'" >> "$OUTPUT_DIR/$OUTPUT_FILE"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
|
|
||||||
_init
|
|
||||||
|
|
||||||
local _count=0
|
|
||||||
|
|
||||||
for _file in $(find ${POST_DIR} -type f \( -iname \*.md -o -iname \*.markdown \))
|
|
||||||
do
|
|
||||||
_filename=$(basename $_file | sed 's/[0-9]\([0-9]*-\)//g;s/\..*//' ) # remove date and extension
|
|
||||||
|
|
||||||
if _has_changed "$_file"; then
|
|
||||||
_dump "$_filename" "$_file"
|
|
||||||
((_count=_count+1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $_count > 0 ]]; then
|
|
||||||
echo "[INFO] Success to update lastmod for $_count post(s)."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Files sync monitor
|
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# MIT Licensed
|
|
||||||
|
|
||||||
# $1 -> the origin file with absolute path.
|
|
||||||
# $2 -> the origin sync directory
|
|
||||||
# $3 -> the destination sync directory
|
|
||||||
|
|
||||||
# Omit the system temp file
|
|
||||||
if [[ ! -f $1 ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
src_dir=`dirname $(realpath $1)`
|
|
||||||
|
|
||||||
dir_prefix="$(realpath $2)/"
|
|
||||||
|
|
||||||
related_dir="${src_dir:${#dir_prefix}}"
|
|
||||||
|
|
||||||
|
|
||||||
dest="$(realpath $3)/${related_dir}"
|
|
||||||
|
|
||||||
if [[ ! -d "$dest" ]]; then
|
|
||||||
mkdir -p "$dest"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -f "$1" ]]; then
|
|
||||||
cp $1 $dest
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $related_dir == "_posts" ]]; then
|
|
||||||
bash $3/_scripts/sh/create_pages.sh
|
|
||||||
bash $3/_scripts/sh/dump_lastmod.sh
|
|
||||||
fi
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: About
|
title: About
|
||||||
|
icon: fas fa-info
|
||||||
|
order: 4
|
||||||
|
|
||||||
# The About page
|
# The About page
|
||||||
# v2.0
|
# v2.0
|
||||||
@@ -8,4 +10,5 @@ title: About
|
|||||||
# MIT License
|
# MIT License
|
||||||
---
|
---
|
||||||
|
|
||||||
> **Note**: Add Markdown syntax content to file `tabs/about.md` and it will show up on this page.
|
|
||||||
|
> **Note**: Add Markdown syntax content to file `_tabs/about.md` and it will show up on this page.
|
||||||
7
_tabs/archives.md
Normal file
7
_tabs/archives.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
layout: archives
|
||||||
|
title: Archives
|
||||||
|
icon: fas fa-archive
|
||||||
|
order: 3
|
||||||
|
---
|
||||||
|
|
||||||
6
_tabs/categories.md
Normal file
6
_tabs/categories.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
layout: categories
|
||||||
|
title: Categories
|
||||||
|
icon: fas fa-stream
|
||||||
|
order: 1
|
||||||
|
---
|
||||||
6
_tabs/tags.md
Normal file
6
_tabs/tags.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
layout: tags
|
||||||
|
title: Tags
|
||||||
|
icon: fas fa-tags
|
||||||
|
order: 2
|
||||||
|
---
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
* The field 'font-display' is added for Google-fonts.
|
|
||||||
*
|
|
||||||
* See: <https://fonts.google.com/>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
@import url('https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed:400,700|Source+Sans+Pro:400,600,700,900&display=swap');
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*---------- scss placeholder ---------*/
|
/* ---------- scss placeholder --------- */
|
||||||
|
|
||||||
%tag-hover {
|
%tag-hover {
|
||||||
background: var(--tag-hover);
|
background: var(--tag-hover);
|
||||||
@@ -15,12 +15,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%table-cell {
|
%table-cell {
|
||||||
padding: .35rem .8rem;
|
padding: 0.4rem 1rem;
|
||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
%link-hover {
|
%link-hover {
|
||||||
color: #d2603a!important;
|
color: #d2603a !important;
|
||||||
border-bottom: 1px solid #d2603a;
|
border-bottom: 1px solid #d2603a;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
margin-top: -2.5rem;
|
margin-top: -2.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------- scss mixin ---------*/
|
/* ---------- scss mixin --------- */
|
||||||
|
|
||||||
@mixin no-text-decoration {
|
@mixin no-text-decoration {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -64,7 +65,6 @@
|
|||||||
color: $color;
|
color: $color;
|
||||||
transition: color 0.35s ease-in-out;
|
transition: color 0.35s ease-in-out;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
margin: 0 .25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin icon-round($diameter) {
|
@mixin icon-round($diameter) {
|
||||||
@@ -96,5 +96,23 @@
|
|||||||
color: $color;
|
color: $color;
|
||||||
font-size: $font-size;
|
font-size: $font-size;
|
||||||
font-weight: $font-weight;
|
font-weight: $font-weight;
|
||||||
font-family: 'Roboto Condensed', 'Microsoft Yahei', sans-serif;
|
}
|
||||||
|
|
||||||
|
@mixin panel-label {
|
||||||
|
@include label(inherit);
|
||||||
|
display: block;
|
||||||
|
line-height: 1.2;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin align-center {
|
||||||
|
position: relative;
|
||||||
|
left: 50%;
|
||||||
|
-webkit-transform: translateX(-50%);
|
||||||
|
-ms-transform: translateX(-50%);
|
||||||
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
@import "_colors/light-syntax";
|
@import "_colors/light-syntax";
|
||||||
@import "_colors/dark-syntax";
|
@import "_colors/dark-syntax";
|
||||||
|
|
||||||
|
html:not([mode]),
|
||||||
html:not([mode]), html[mode=light] {
|
html[mode=light] {
|
||||||
@include light-syntax;
|
@include light-syntax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ html[mode=dark] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
html:not([mode]), html[mode=dark] {
|
html:not([mode]),
|
||||||
|
html[mode=dark] {
|
||||||
@include dark-syntax;
|
@include dark-syntax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,33 +29,49 @@ html[mode=dark] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-- Codes Snippet --*/
|
/* -- Codes Snippet -- */
|
||||||
|
|
||||||
%highlight-pre-bg {
|
%code-snippet-bg {
|
||||||
background: var(--highlight-bg-color);
|
background: var(--highlight-bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
%code-snippet-radius {
|
%code-snippet-radius {
|
||||||
border-radius: 5px;
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
%code-snippet-padding {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
$code-font-size: 0.85rem;
|
||||||
|
|
||||||
|
div > pre {
|
||||||
|
@extend %code-snippet-bg;
|
||||||
|
@extend %code-snippet-radius;
|
||||||
|
@extend %code-snippet-padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlighter-rouge {
|
.highlighter-rouge {
|
||||||
background-color: var(--highlight-bg-color);
|
@extend %code-snippet-bg;
|
||||||
@extend %code-snippet-radius;
|
@extend %code-snippet-radius;
|
||||||
|
|
||||||
color: var(--highlighter-rouge-color);
|
color: var(--highlighter-rouge-color);
|
||||||
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
@extend %code-snippet-radius;
|
@extend %code-snippet-radius;
|
||||||
background: var(--highlight-bg-color);
|
@extend %code-snippet-bg;
|
||||||
|
|
||||||
@at-root figure#{&} {
|
@at-root figure#{&} {
|
||||||
background: var(--highlight-bg-color);
|
@extend %code-snippet-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
.lineno {
|
.lineno {
|
||||||
margin: .8rem 0rem;
|
margin-left: 0.2rem;
|
||||||
padding: 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);
|
||||||
@@ -66,6 +83,12 @@ html[mode=dark] {
|
|||||||
-o-user-select: none;
|
-o-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
pre {
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: $code-font-size;
|
||||||
|
line-height: 1.4rem;
|
||||||
|
word-wrap: normal; /* Fixed Safari overflow-x */
|
||||||
|
}
|
||||||
table {
|
table {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
@@ -78,14 +101,6 @@ html[mode=dark] {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
pre {
|
|
||||||
margin-bottom: 0;
|
|
||||||
font-size: .85rem;
|
|
||||||
line-height: 1.4rem;
|
|
||||||
word-wrap: normal;
|
|
||||||
/* Fixed Safari overflow-x */
|
|
||||||
}
|
|
||||||
|
|
||||||
} //.highlight
|
} //.highlight
|
||||||
|
|
||||||
code {
|
code {
|
||||||
@@ -93,27 +108,30 @@ code {
|
|||||||
-ms-hyphens: none;
|
-ms-hyphens: none;
|
||||||
-moz-hyphens: none;
|
-moz-hyphens: none;
|
||||||
hyphens: none;
|
hyphens: none;
|
||||||
|
|
||||||
&.highlighter-rouge {
|
&.highlighter-rouge {
|
||||||
|
font-size: $code-font-size;
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
margin: 0 .15rem;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inline-code-bg);
|
background-color: var(--inline-code-bg);
|
||||||
}
|
}
|
||||||
@at-root a>&.highlighter-rouge {
|
|
||||||
|
@at-root 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 {
|
|
||||||
|
@at-root a:hover > &.highlighter-rouge {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote &.highlighter-rouge {
|
blockquote &.highlighter-rouge {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
padding-left: 1rem;
|
padding: 1.5rem 1.5rem 1.5rem 1rem;
|
||||||
padding-right: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide line numbers for default, console, and terminal code snippets */
|
/* Hide line numbers for default, console, and terminal code snippets */
|
||||||
@@ -126,7 +144,24 @@ div {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
padding: .8rem 1rem;
|
@extend %code-snippet-padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div[class^='language-']::before {
|
||||||
|
content: attr(lang);
|
||||||
|
position: absolute;
|
||||||
|
right: 1.8rem;
|
||||||
|
margin-top: 3px;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--highlight-lineno-color);
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
div[class^='language-']::before {
|
||||||
|
right: 3.1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*--- ↓ width and height ----*/
|
/* --- ↓ width and height ---- */
|
||||||
|
|
||||||
$tab-height: 3.3rem;
|
$tab-height: 3.2rem;
|
||||||
$tab-cursor-height: 1.6rem;
|
$tab-cursor-height: 1.6rem;
|
||||||
|
|
||||||
$sidebar-width-small: 210px;
|
$sidebar-width-small: 210px;
|
||||||
|
|||||||
@@ -7,87 +7,82 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@mixin dark-syntax {
|
@mixin dark-syntax {
|
||||||
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
/* ----- My styles ------ */
|
||||||
.highlight pre { background-color: #272822; }
|
--highlight-bg-color: #252525;
|
||||||
.highlight .hll { background-color: #272822; }
|
|
||||||
.highlight .c { color: #75715e } /* Comment */
|
|
||||||
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
|
|
||||||
.highlight .k { color: #66d9ef } /* Keyword */
|
|
||||||
.highlight .l { color: #ae81ff } /* Literal */
|
|
||||||
.highlight .n { color: #f8f8f2 } /* Name */
|
|
||||||
.highlight .o { color: #f92672 } /* Operator */
|
|
||||||
.highlight .p { color: #f8f8f2 } /* Punctuation */
|
|
||||||
.highlight .cm { color: #75715e } /* Comment.Multiline */
|
|
||||||
.highlight .cp { color: #75715e } /* Comment.Preproc */
|
|
||||||
.highlight .c1 { color: #75715e } /* Comment.Single */
|
|
||||||
.highlight .cs { color: #75715e } /* Comment.Special */
|
|
||||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
|
||||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
|
||||||
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
|
|
||||||
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
|
|
||||||
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
|
|
||||||
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
|
|
||||||
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
|
|
||||||
.highlight .kt { color: #66d9ef } /* Keyword.Type */
|
|
||||||
.highlight .ld { color: #e6db74 } /* Literal.Date */
|
|
||||||
.highlight .m { color: #ae81ff } /* Literal.Number */
|
|
||||||
.highlight .s { color: #e6db74 } /* Literal.String */
|
|
||||||
.highlight .na { color: #a6e22e } /* Name.Attribute */
|
|
||||||
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
|
|
||||||
.highlight .nc { color: #a6e22e } /* Name.Class */
|
|
||||||
.highlight .no { color: #66d9ef } /* Name.Constant */
|
|
||||||
.highlight .nd { color: #a6e22e } /* Name.Decorator */
|
|
||||||
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
|
|
||||||
.highlight .ne { color: #a6e22e } /* Name.Exception */
|
|
||||||
.highlight .nf { color: #a6e22e } /* Name.Function */
|
|
||||||
.highlight .nl { color: #f8f8f2 } /* Name.Label */
|
|
||||||
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
|
|
||||||
.highlight .nx { color: #a6e22e } /* Name.Other */
|
|
||||||
.highlight .py { color: #f8f8f2 } /* Name.Property */
|
|
||||||
.highlight .nt { color: #f92672 } /* Name.Tag */
|
|
||||||
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
|
|
||||||
.highlight .ow { color: #f92672 } /* Operator.Word */
|
|
||||||
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
|
|
||||||
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
|
|
||||||
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
|
|
||||||
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
|
|
||||||
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
|
|
||||||
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
|
|
||||||
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
|
|
||||||
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
|
|
||||||
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
|
|
||||||
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
|
|
||||||
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
|
|
||||||
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
|
|
||||||
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
|
|
||||||
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
|
|
||||||
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
|
|
||||||
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
|
|
||||||
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
|
|
||||||
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
|
|
||||||
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
|
|
||||||
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
|
|
||||||
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
|
|
||||||
|
|
||||||
.highlight .gh { } /* Generic Heading & Diff Header */
|
|
||||||
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
|
||||||
.highlight .gd { color: #f92672; background-color: #561c08 } /* Generic.Deleted & Diff Deleted */
|
|
||||||
.highlight .gi { color: #a6e22e; background-color: #0b5858 } /* Generic.Inserted & Diff Inserted */
|
|
||||||
|
|
||||||
|
|
||||||
/*----- My styles ------*/
|
|
||||||
|
|
||||||
--highlight-bg-color: #272822;
|
|
||||||
--highlighter-rouge-color: #de6b18;
|
--highlighter-rouge-color: #de6b18;
|
||||||
|
|
||||||
--highlight-lineno-color: #6c6c6d;
|
--highlight-lineno-color: #6c6c6d;
|
||||||
--highlight-lineno-border-color: #3c4042;
|
--highlight-lineno-border-color: #303435;
|
||||||
|
--inline-code-bg: #272822;
|
||||||
--inline-code-bg: var(--highlight-bg-color);
|
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
.gp { color: #818c96; }
|
.gp { color: #818c96; }
|
||||||
}
|
}
|
||||||
pre { color: #818c96 } /* override Bootstrap */
|
|
||||||
|
pre { color: #bfbfbf; } /* override Bootstrap */
|
||||||
kbd { background-color: black; }
|
kbd { background-color: black; }
|
||||||
}
|
|
||||||
|
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
||||||
|
.highlight pre { background-color: var(--highlight-bg-color); }
|
||||||
|
.highlight .hll { background-color: var(--highlight-bg-color); }
|
||||||
|
.highlight .c { color: #75715e; } /* Comment */
|
||||||
|
.highlight .err { color: #960050; background-color: #1e0010; } /* Error */
|
||||||
|
.highlight .k { color: #66d9ef; } /* Keyword */
|
||||||
|
.highlight .l { color: #ae81ff; } /* Literal */
|
||||||
|
.highlight .n { color: #f8f8f2; } /* Name */
|
||||||
|
.highlight .o { color: #f92672; } /* Operator */
|
||||||
|
.highlight .p { color: #f8f8f2; } /* Punctuation */
|
||||||
|
.highlight .cm { color: #75715e; } /* Comment.Multiline */
|
||||||
|
.highlight .cp { color: #75715e; } /* Comment.Preproc */
|
||||||
|
.highlight .c1 { color: #75715e; } /* Comment.Single */
|
||||||
|
.highlight .cs { color: #75715e; } /* Comment.Special */
|
||||||
|
.highlight .ge { color: inherit; font-style: italic; } /* Generic.Emph */
|
||||||
|
.highlight .gs { font-weight: bold; } /* Generic.Strong */
|
||||||
|
.highlight .kc { color: #66d9ef; } /* Keyword.Constant */
|
||||||
|
.highlight .kd { color: #66d9ef; } /* Keyword.Declaration */
|
||||||
|
.highlight .kn { color: #f92672; } /* Keyword.Namespace */
|
||||||
|
.highlight .kp { color: #66d9ef; } /* Keyword.Pseudo */
|
||||||
|
.highlight .kr { color: #66d9ef; } /* Keyword.Reserved */
|
||||||
|
.highlight .kt { color: #66d9ef; } /* Keyword.Type */
|
||||||
|
.highlight .ld { color: #e6db74; } /* Literal.Date */
|
||||||
|
.highlight .m { color: #ae81ff; } /* Literal.Number */
|
||||||
|
.highlight .s { color: #e6db74; } /* Literal.String */
|
||||||
|
.highlight .na { color: #a6e22e; } /* Name.Attribute */
|
||||||
|
.highlight .nb { color: #f8f8f2; } /* Name.Builtin */
|
||||||
|
.highlight .nc { color: #a6e22e; } /* Name.Class */
|
||||||
|
.highlight .no { color: #66d9ef; } /* Name.Constant */
|
||||||
|
.highlight .nd { color: #a6e22e; } /* Name.Decorator */
|
||||||
|
.highlight .ni { color: #f8f8f2; } /* Name.Entity */
|
||||||
|
.highlight .ne { color: #a6e22e; } /* Name.Exception */
|
||||||
|
.highlight .nf { color: #a6e22e; } /* Name.Function */
|
||||||
|
.highlight .nl { color: #f8f8f2; } /* Name.Label */
|
||||||
|
.highlight .nn { color: #f8f8f2; } /* Name.Namespace */
|
||||||
|
.highlight .nx { color: #a6e22e; } /* Name.Other */
|
||||||
|
.highlight .py { color: #f8f8f2; } /* Name.Property */
|
||||||
|
.highlight .nt { color: #f92672; } /* Name.Tag */
|
||||||
|
.highlight .nv { color: #f8f8f2; } /* Name.Variable */
|
||||||
|
.highlight .ow { color: #f92672; } /* Operator.Word */
|
||||||
|
.highlight .w { color: #f8f8f2; } /* Text.Whitespace */
|
||||||
|
.highlight .mf { color: #ae81ff; } /* Literal.Number.Float */
|
||||||
|
.highlight .mh { color: #ae81ff; } /* Literal.Number.Hex */
|
||||||
|
.highlight .mi { color: #ae81ff; } /* Literal.Number.Integer */
|
||||||
|
.highlight .mo { color: #ae81ff; } /* Literal.Number.Oct */
|
||||||
|
.highlight .sb { color: #e6db74; } /* Literal.String.Backtick */
|
||||||
|
.highlight .sc { color: #e6db74; } /* Literal.String.Char */
|
||||||
|
.highlight .sd { color: #e6db74; } /* Literal.String.Doc */
|
||||||
|
.highlight .s2 { color: #e6db74; } /* Literal.String.Double */
|
||||||
|
.highlight .se { color: #ae81ff; } /* Literal.String.Escape */
|
||||||
|
.highlight .sh { color: #e6db74; } /* Literal.String.Heredoc */
|
||||||
|
.highlight .si { color: #e6db74; } /* Literal.String.Interpol */
|
||||||
|
.highlight .sx { color: #e6db74; } /* Literal.String.Other */
|
||||||
|
.highlight .sr { color: #e6db74; } /* Literal.String.Regex */
|
||||||
|
.highlight .s1 { color: #e6db74; } /* Literal.String.Single */
|
||||||
|
.highlight .ss { color: #e6db74; } /* Literal.String.Symbol */
|
||||||
|
.highlight .bp { color: #f8f8f2; } /* Name.Builtin.Pseudo */
|
||||||
|
.highlight .vc { color: #f8f8f2; } /* Name.Variable.Class */
|
||||||
|
.highlight .vg { color: #f8f8f2; } /* Name.Variable.Global */
|
||||||
|
.highlight .vi { color: #f8f8f2; } /* Name.Variable.Instance */
|
||||||
|
.highlight .il { color: #ae81ff; } /* Literal.Number.Integer.Long */
|
||||||
|
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
||||||
|
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
||||||
|
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,14 +26,14 @@
|
|||||||
--button-bg: rgb(39, 40, 43);
|
--button-bg: rgb(39, 40, 43);
|
||||||
--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);
|
||||||
|
|
||||||
--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);
|
||||||
--btn-box-shadow: var(--main-wrapper-bg);
|
--btn-box-shadow: var(--main-wrapper-bg);
|
||||||
|
|
||||||
--card-header-bg: rgb(51, 50, 50);
|
--card-header-bg: rgb(51, 50, 50);
|
||||||
--label-color: rgb(108, 117, 125);
|
--label-color: rgb(108, 117, 125);
|
||||||
|
--checkbox-color: rgb(118 120 121);
|
||||||
|
--checkbox-checked-color: var(--link-color);
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
--nav-cursor-color: rgb(183, 182, 182);
|
--nav-cursor-color: rgb(183, 182, 182);
|
||||||
@@ -51,6 +51,8 @@
|
|||||||
--btn-text-color: var(--text-color);
|
--btn-text-color: var(--text-color);
|
||||||
--btn-paginator-border-color: var(--btn-border-color);
|
--btn-paginator-border-color: var(--btn-border-color);
|
||||||
--btn-paginator-shadow: var(--main-wrapper-bg);
|
--btn-paginator-shadow: var(--main-wrapper-bg);
|
||||||
|
--pin-bg: rgb(34 35 37);
|
||||||
|
--pin-color: iherit;
|
||||||
|
|
||||||
/* Posts */
|
/* Posts */
|
||||||
--toc-highlight: rgb(116, 178, 243);
|
--toc-highlight: rgb(116, 178, 243);
|
||||||
@@ -71,7 +73,6 @@
|
|||||||
--tag-border: rgb(59, 79, 88);
|
--tag-border: rgb(59, 79, 88);
|
||||||
--tag-shadow: rgb(32, 33, 33);
|
--tag-shadow: rgb(32, 33, 33);
|
||||||
--search-tag-bg: var(--tag-bg);
|
--search-tag-bg: var(--tag-bg);
|
||||||
|
|
||||||
--dash-color: rgb(63, 65, 68);
|
--dash-color: rgb(63, 65, 68);
|
||||||
|
|
||||||
/* categories */
|
/* categories */
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
--timeline-year-dot-color: var(--timeline-color);
|
--timeline-year-dot-color: var(--timeline-color);
|
||||||
|
|
||||||
/* Footer */
|
/* Footer */
|
||||||
--footer-link: rgb(171 171 171);
|
--footer-link: rgb(171, 171, 171);
|
||||||
|
|
||||||
.post-content img {
|
.post-content img {
|
||||||
filter: brightness(90%);
|
filter: brightness(90%);
|
||||||
@@ -98,10 +99,10 @@
|
|||||||
nav[data-toggle=toc] .nav-link.active,
|
nav[data-toggle=toc] .nav-link.active,
|
||||||
nav[data-toggle=toc] .nav-link.active:focus,
|
nav[data-toggle=toc] .nav-link.active:focus,
|
||||||
nav[data-toggle=toc] .nav-link.active:hover,
|
nav[data-toggle=toc] .nav-link.active:hover,
|
||||||
nav[data-toggle=toc] .nav>li>a:focus,
|
nav[data-toggle=toc] .nav > li > a:focus,
|
||||||
nav[data-toggle=toc] .nav>li>a:hover {
|
nav[data-toggle=toc] .nav > li > a:hover {
|
||||||
color: var(--toc-highlight)!important;
|
color: var(--toc-highlight) !important;
|
||||||
border-left-color: var(--toc-highlight)!important;
|
border-left-color: var(--toc-highlight) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* categories */
|
/* categories */
|
||||||
@@ -126,8 +127,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#archives li:nth-child(odd) {
|
#archives li:nth-child(odd) {
|
||||||
background-image: linear-gradient(to left,
|
background-image: linear-gradient(
|
||||||
rgb(26, 26, 30), rgb(39, 39, 45), rgb(39, 39, 45), rgb(39, 39, 45), rgb(26, 26, 30));
|
to left,
|
||||||
|
rgb(26, 26, 30),
|
||||||
|
rgb(39, 39, 45),
|
||||||
|
rgb(39, 39, 45),
|
||||||
|
rgb(39, 39, 45),
|
||||||
|
rgb(26, 26, 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // dark-scheme
|
} // dark-scheme
|
||||||
|
|||||||
@@ -8,73 +8,72 @@
|
|||||||
|
|
||||||
@mixin light-syntax {
|
@mixin light-syntax {
|
||||||
/* see: <https://raw.githubusercontent.com/jwarby/pygments-css/master/github.css> */
|
/* see: <https://raw.githubusercontent.com/jwarby/pygments-css/master/github.css> */
|
||||||
.highlight .hll { background-color: #ffffcc }
|
.highlight .hll { background-color: #ffffcc; }
|
||||||
.highlight .c { color: #999988; font-style: italic } /* Comment */
|
.highlight .c { color: #999988; font-style: italic; } /* Comment */
|
||||||
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
|
.highlight .err { color: #a61717; background-color: #e3d2d2; } /* Error */
|
||||||
.highlight .k { color: #000000; font-weight: bold } /* Keyword */
|
.highlight .k { color: #000000; font-weight: bold; } /* Keyword */
|
||||||
.highlight .o { color: #000000; font-weight: bold } /* Operator */
|
.highlight .o { color: #000000; font-weight: bold; } /* Operator */
|
||||||
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
|
.highlight .cm { color: #999988; font-style: italic; } /* Comment.Multiline */
|
||||||
.highlight .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
|
.highlight .cp { color: #999999; font-weight: bold; font-style: italic; } /* Comment.Preproc */
|
||||||
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
|
.highlight .c1 { color: #999988; font-style: italic; } /* Comment.Single */
|
||||||
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
|
.highlight .cs { color: #999999; font-weight: bold; font-style: italic; } /* Comment.Special */
|
||||||
.highlight .gd { color: #d01040; background-color: #ffdddd } /* Generic.Deleted */
|
.highlight .gd { color: #d01040; background-color: #ffdddd; } /* Generic.Deleted */
|
||||||
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
|
.highlight .ge { color: #000000; font-style: italic; } /* Generic.Emph */
|
||||||
.highlight .gr { color: #aa0000 } /* Generic.Error */
|
.highlight .gr { color: #aa0000; } /* Generic.Error */
|
||||||
.highlight .gh { color: #999999 } /* Generic.Heading */
|
.highlight .gh { color: #999999; } /* Generic.Heading */
|
||||||
.highlight .gi { color: #008080; background-color: #ddffdd } /* Generic.Inserted */
|
.highlight .gi { color: #008080; background-color: #ddffdd; } /* Generic.Inserted */
|
||||||
.highlight .go { color: #888888 } /* Generic.Output */
|
.highlight .go { color: #888888; } /* Generic.Output */
|
||||||
.highlight .gp { color: #555555 } /* Generic.Prompt */
|
.highlight .gp { color: #555555; } /* Generic.Prompt */
|
||||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
.highlight .gs { font-weight: bold; } /* Generic.Strong */
|
||||||
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
|
.highlight .gu { color: #aaaaaa; } /* Generic.Subheading */
|
||||||
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
|
.highlight .gt { color: #aa0000; } /* Generic.Traceback */
|
||||||
.highlight .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
|
.highlight .kc { color: #000000; font-weight: bold; } /* Keyword.Constant */
|
||||||
.highlight .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
|
.highlight .kd { color: #000000; font-weight: bold; } /* Keyword.Declaration */
|
||||||
.highlight .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
|
.highlight .kn { color: #000000; font-weight: bold; } /* Keyword.Namespace */
|
||||||
.highlight .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
|
.highlight .kp { color: #000000; font-weight: bold; } /* Keyword.Pseudo */
|
||||||
.highlight .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
|
.highlight .kr { color: #000000; font-weight: bold; } /* Keyword.Reserved */
|
||||||
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
|
.highlight .kt { color: #445588; font-weight: bold; } /* Keyword.Type */
|
||||||
.highlight .m { color: #009999 } /* Literal.Number */
|
.highlight .m { color: #009999; } /* Literal.Number */
|
||||||
.highlight .s { color: #d01040 } /* Literal.String */
|
.highlight .s { color: #d01040; } /* Literal.String */
|
||||||
.highlight .na { color: #008080 } /* Name.Attribute */
|
.highlight .na { color: #008080; } /* Name.Attribute */
|
||||||
.highlight .nb { color: #0086B3 } /* Name.Builtin */
|
.highlight .nb { color: #0086b3; } /* Name.Builtin */
|
||||||
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
|
.highlight .nc { color: #445588; font-weight: bold; } /* Name.Class */
|
||||||
.highlight .no { color: #008080 } /* Name.Constant */
|
.highlight .no { color: #008080; } /* Name.Constant */
|
||||||
.highlight .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
|
.highlight .nd { color: #3c5d5d; font-weight: bold; } /* Name.Decorator */
|
||||||
.highlight .ni { color: #800080 } /* Name.Entity */
|
.highlight .ni { color: #800080; } /* Name.Entity */
|
||||||
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
|
.highlight .ne { color: #990000; font-weight: bold; } /* Name.Exception */
|
||||||
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
|
.highlight .nf { color: #990000; font-weight: bold; } /* Name.Function */
|
||||||
.highlight .nl { color: #990000; font-weight: bold } /* Name.Label */
|
.highlight .nl { color: #990000; font-weight: bold; } /* Name.Label */
|
||||||
.highlight .nn { color: #555555 } /* Name.Namespace */
|
.highlight .nn { color: #555555; } /* Name.Namespace */
|
||||||
.highlight .nt { color: #000080 } /* Name.Tag */
|
.highlight .nt { color: #000080; } /* Name.Tag */
|
||||||
.highlight .nv { color: #008080 } /* Name.Variable */
|
.highlight .nv { color: #008080; } /* Name.Variable */
|
||||||
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
|
.highlight .ow { color: #000000; font-weight: bold; } /* Operator.Word */
|
||||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
.highlight .w { color: #bbbbbb; } /* Text.Whitespace */
|
||||||
.highlight .mf { color: #009999 } /* Literal.Number.Float */
|
.highlight .mf { color: #009999; } /* Literal.Number.Float */
|
||||||
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
|
.highlight .mh { color: #009999; } /* Literal.Number.Hex */
|
||||||
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
|
.highlight .mi { color: #009999; } /* Literal.Number.Integer */
|
||||||
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
|
.highlight .mo { color: #009999; } /* Literal.Number.Oct */
|
||||||
.highlight .sb { color: #d01040 } /* Literal.String.Backtick */
|
.highlight .sb { color: #d01040; } /* Literal.String.Backtick */
|
||||||
.highlight .sc { color: #d01040 } /* Literal.String.Char */
|
.highlight .sc { color: #d01040; } /* Literal.String.Char */
|
||||||
.highlight .sd { color: #d01040 } /* Literal.String.Doc */
|
.highlight .sd { color: #d01040; } /* Literal.String.Doc */
|
||||||
.highlight .s2 { color: #d01040 } /* Literal.String.Double */
|
.highlight .s2 { color: #d01040; } /* Literal.String.Double */
|
||||||
.highlight .se { color: #d01040 } /* Literal.String.Escape */
|
.highlight .se { color: #d01040; } /* Literal.String.Escape */
|
||||||
.highlight .sh { color: #d01040 } /* Literal.String.Heredoc */
|
.highlight .sh { color: #d01040; } /* Literal.String.Heredoc */
|
||||||
.highlight .si { color: #d01040 } /* Literal.String.Interpol */
|
.highlight .si { color: #d01040; } /* Literal.String.Interpol */
|
||||||
.highlight .sx { color: #d01040 } /* Literal.String.Other */
|
.highlight .sx { color: #d01040; } /* Literal.String.Other */
|
||||||
.highlight .sr { color: #009926 } /* Literal.String.Regex */
|
.highlight .sr { color: #009926; } /* Literal.String.Regex */
|
||||||
.highlight .s1 { color: #d01040 } /* Literal.String.Single */
|
.highlight .s1 { color: #d01040; } /* Literal.String.Single */
|
||||||
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
|
.highlight .ss { color: #990073; } /* Literal.String.Symbol */
|
||||||
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
|
.highlight .bp { color: #999999; } /* Name.Builtin.Pseudo */
|
||||||
.highlight .vc { color: #008080 } /* Name.Variable.Class */
|
.highlight .vc { color: #008080; } /* Name.Variable.Class */
|
||||||
.highlight .vg { color: #008080 } /* Name.Variable.Global */
|
.highlight .vg { color: #008080; } /* Name.Variable.Global */
|
||||||
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
|
.highlight .vi { color: #008080; } /* Name.Variable.Instance */
|
||||||
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
|
.highlight .il { color: #009999; } /* Literal.Number.Integer.Long */
|
||||||
|
|
||||||
/*--- custom light colors ---*/
|
/* --- custom light colors --- */
|
||||||
--highlight-bg-color: #f7f7f7;
|
--highlight-bg-color: #f7f7f7;
|
||||||
--highlighter-rouge-color: #353a3d;
|
--highlighter-rouge-color: #353a3d;
|
||||||
--highlight-lineno-color: #c2c6cc;
|
--highlight-lineno-color: #c2c6cc;
|
||||||
--highlight-lineno-border-color: #e9ecef;
|
--highlight-lineno-border-color: #e9ecef;
|
||||||
|
|
||||||
--inline-code-bg: #f3f3f3;
|
--inline-code-bg: #f3f3f3;
|
||||||
} // light-syntax
|
} // light-syntax
|
||||||
|
|||||||
@@ -7,118 +7,74 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@mixin light-scheme {
|
@mixin light-scheme {
|
||||||
|
/* Common */
|
||||||
--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;
|
--btn-border-color: #e9ecef;
|
||||||
|
|
||||||
--text-color: #333333;
|
--text-color: #333333;
|
||||||
|
|
||||||
--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;
|
--text-muted-color: gray;
|
||||||
|
|
||||||
--tb-odd-bg: #fbfcfd;
|
--tb-odd-bg: #fbfcfd;
|
||||||
|
|
||||||
--tb-border-color: #eaeaea;
|
--tb-border-color: #eaeaea;
|
||||||
|
|
||||||
--button-bg: #fff;
|
--button-bg: #fff;
|
||||||
|
|
||||||
--btn-backtotop-color: #686868;
|
--btn-backtotop-color: #686868;
|
||||||
|
--btn-backtotop-border-color: #f1f1f1;
|
||||||
--btn-backtotop-border-color: #f1f1f1; //--main-border-color,
|
|
||||||
|
|
||||||
--btn-box-shadow: #eaeaea;
|
--btn-box-shadow: #eaeaea;
|
||||||
|
--checkbox-color: #c5c5c5;
|
||||||
|
--checkbox-checked-color: #07a8f7;
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
|
|
||||||
--sidebar-bg: radial-gradient(
|
--sidebar-bg: radial-gradient(
|
||||||
circle, rgba(42, 30, 107, 1) 0%, rgba(35, 37, 46, 1) 100%);
|
circle,
|
||||||
|
rgba(42, 30, 107, 1) 0%,
|
||||||
|
rgba(35, 37, 46, 1) 100%);
|
||||||
--nav-cursor-color: #fcfcfc;
|
--nav-cursor-color: #fcfcfc;
|
||||||
|
|
||||||
/* Topbar */
|
/* Topbar */
|
||||||
|
|
||||||
--topbar-wrapper-bg: white;
|
--topbar-wrapper-bg: white;
|
||||||
|
|
||||||
--topbar-text-color: rgb(78, 78, 78);
|
--topbar-text-color: rgb(78, 78, 78);
|
||||||
|
|
||||||
--search-wrapper-bg: #f5f5f5;
|
--search-wrapper-bg: #f5f5f5;
|
||||||
|
|
||||||
--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);
|
||||||
|
|
||||||
/* 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: #e9ecef;
|
||||||
|
|
||||||
--btn-active-bg: #2a408e;
|
--btn-active-bg: #2a408e;
|
||||||
|
|
||||||
--btn-active-border-color: #007bff;
|
--btn-active-border-color: #007bff;
|
||||||
|
|
||||||
--btn-text-color: #f8f8f8;
|
--btn-text-color: #f8f8f8;
|
||||||
|
|
||||||
--btn-paginator-border-color: #f1f1f1;
|
--btn-paginator-border-color: #f1f1f1;
|
||||||
|
|
||||||
--btn-paginator-shadow: #4b92d2;
|
--btn-paginator-shadow: #4b92d2;
|
||||||
|
--pin-bg: #f5f5f5;
|
||||||
|
--pin-color: #999fa4;
|
||||||
|
|
||||||
/* Posts */
|
/* Posts */
|
||||||
|
|
||||||
--btn-share-hover-color: var(--link-color);
|
--btn-share-hover-color: var(--link-color);
|
||||||
|
|
||||||
--card-border-color: #f1f1f1;
|
--card-border-color: #f1f1f1;
|
||||||
|
|
||||||
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
||||||
|
--label-color: #616161;
|
||||||
--label-color: #808080;
|
--relate-post-date: rgba(30, 55, 70, 0.4);
|
||||||
|
|
||||||
--relate-post-date: rgba(30, 55, 70, .4);
|
|
||||||
|
|
||||||
--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);
|
--categories-hover-bg: var(--btn-border-color);
|
||||||
|
|
||||||
--dash-color: silver;
|
--dash-color: silver;
|
||||||
|
|
||||||
|
|
||||||
/* 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 */
|
||||||
|
|
||||||
--footer-bg-color: #ffffff;
|
--footer-bg-color: #ffffff;
|
||||||
|
|
||||||
--footnote-target-bg: lightcyan;
|
--footnote-target-bg: lightcyan;
|
||||||
|
|
||||||
--footer-link: #424242;
|
--footer-link: #424242;
|
||||||
}
|
} // light-scheme
|
||||||
|
|||||||
@@ -19,10 +19,6 @@
|
|||||||
background-color: var(--timeline-color);
|
background-color: var(--timeline-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
%date-font {
|
|
||||||
font-family: 'Roboto Condensed', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
#archives {
|
#archives {
|
||||||
letter-spacing: 0.03rem;
|
letter-spacing: 0.03rem;
|
||||||
li {
|
li {
|
||||||
@@ -33,7 +29,7 @@
|
|||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
||||||
}
|
}
|
||||||
>div {
|
> div {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@@ -42,7 +38,6 @@
|
|||||||
|
|
||||||
span.lead {
|
span.lead {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
@extend %date-font;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 8px;
|
left: 8px;
|
||||||
|
|
||||||
@@ -54,8 +49,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after { /* Year dot */
|
||||||
/* Year dot */
|
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -80,8 +74,8 @@
|
|||||||
&.month {
|
&.month {
|
||||||
width: 1.4rem;
|
width: 1.4rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@extend %date-font;
|
|
||||||
~a::before {
|
~ a::before {
|
||||||
/* A dot for Month and Day */
|
/* A dot for Month and Day */
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -111,12 +105,12 @@
|
|||||||
} // #archives .date
|
} // #archives .date
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
>li {
|
> li {
|
||||||
>div>a {
|
> div > a {
|
||||||
/* post title in Archvies */
|
/* post title in Archvies */
|
||||||
margin-left: 2.5rem;
|
margin-left: 2.5rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: .1rem;
|
top: 0.1rem;
|
||||||
}
|
}
|
||||||
&::after {
|
&::after {
|
||||||
@extend %date-timeline;
|
@extend %date-timeline;
|
||||||
@@ -129,10 +123,10 @@
|
|||||||
top: -1.61rem;
|
top: -1.61rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:not(:last-child)>li:last-child::after {
|
&:not(:last-child) > li:last-child::after {
|
||||||
height: 3.4rem;
|
height: 3.4rem;
|
||||||
}
|
}
|
||||||
&:last-child>li:last-child::after {
|
&:last-child > li:last-child::after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
} // #archives ul
|
} // #archives ul
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
border-left: none;
|
border-left: none;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
>i {
|
> i {
|
||||||
@extend %category-icon-color;
|
@extend %category-icon-color;
|
||||||
}
|
}
|
||||||
&:first-child {
|
&:first-child {
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header>span>i:first-child {
|
.card-header > span > i:first-child {
|
||||||
@extend %category-icon-color;
|
@extend %category-icon-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #6c757d!important;
|
color: #6c757d!important;
|
||||||
>i.fas {
|
> i.fas {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: .7rem;
|
height: 0.7rem;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
transition: 300ms ease all;
|
transition: 300ms ease all;
|
||||||
}
|
}
|
||||||
@@ -68,4 +68,4 @@
|
|||||||
-ms-transform: rotate(-90deg); /* IE 9 */
|
-ms-transform: rotate(-90deg); /* IE 9 */
|
||||||
-webkit-transform: rotate(-90deg); /* Safari 3-8 */
|
-webkit-transform: rotate(-90deg); /* Safari 3-8 */
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
{% include_relative _addon/main.scss %}
|
{% include_relative _addon/main.scss %}
|
||||||
|
|
||||||
#page-category, #page-tag {
|
#page-category, #page-tag {
|
||||||
ul>li {
|
ul > li {
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
padding: .6rem 0;
|
padding: 0.6rem 0;
|
||||||
&::before { // dot
|
&::before { // dot
|
||||||
background: #999;
|
background: #999;
|
||||||
width: 5px;
|
width: 5px;
|
||||||
@@ -21,25 +21,25 @@
|
|||||||
display: block;
|
display: block;
|
||||||
content: "";
|
content: "";
|
||||||
position: relative;
|
position: relative;
|
||||||
top: .6rem;
|
top: 0.6rem;
|
||||||
margin-right: .5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
>a { /* post's title */
|
> a { /* post's title */
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
@extend %no-bottom-border;
|
@extend %no-bottom-border;
|
||||||
}
|
}
|
||||||
>span:last-child {
|
> span:last-child {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
/* post's date */
|
/* post's date */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-tag h1>i { // tag icon
|
#page-tag h1 > i { // tag icon
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-category h1>i {
|
#page-category h1 > i {
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,15 +59,15 @@ a:hover {
|
|||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
#page-category, #page-tag {
|
#page-category, #page-tag {
|
||||||
ul>li {
|
ul > li {
|
||||||
&::before {
|
&::before {
|
||||||
margin: 0 .5rem;
|
margin: 0 .5rem;
|
||||||
}
|
}
|
||||||
>a {
|
> a {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#post-list {
|
#post-list {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
padding-right: .5rem;
|
padding-right: 0.5rem;
|
||||||
|
|
||||||
.post-preview {
|
.post-preview {
|
||||||
padding-top: 1.5rem;
|
padding-top: 1.5rem;
|
||||||
@@ -20,25 +20,22 @@
|
|||||||
h1 {
|
h1 {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
~i { // pinned icon
|
|
||||||
font-size: .86rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-meta {
|
.post-meta {
|
||||||
i {
|
i {
|
||||||
font-size: .73rem;
|
font-size: 0.73rem;
|
||||||
&:not(:first-child) { // post-meta icons on the homepage
|
}
|
||||||
margin-left: 1.5rem;
|
span:not(:last-child) {
|
||||||
}
|
margin-right: 1.2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
margin-top: .6rem;
|
margin-top: 0.6rem;
|
||||||
margin-bottom: .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;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -49,6 +46,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pin {
|
||||||
|
> i {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
padding-left: 3px;
|
||||||
|
color: var(--pin-color);
|
||||||
|
}
|
||||||
|
> span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // .post-preview
|
} // .post-preview
|
||||||
|
|
||||||
} // #post-list
|
} // #post-list
|
||||||
@@ -107,12 +115,6 @@
|
|||||||
|
|
||||||
} // .pagination
|
} // .pagination
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
|
||||||
#post-list .post-meta>span i:not(:first-child) {
|
|
||||||
margin-left: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 830px) {
|
||||||
.pagination {
|
.pagination {
|
||||||
@@ -125,10 +127,25 @@
|
|||||||
|
|
||||||
#post-list {
|
#post-list {
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
|
.post-preview .post-meta {
|
||||||
|
.pin {
|
||||||
|
background: var(--pin-bg);
|
||||||
|
border-radius: 5px;
|
||||||
|
line-height: 1.4rem;
|
||||||
|
height: 1.3rem;
|
||||||
|
margin-top: 3px;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 6px;
|
||||||
|
|
||||||
|
> span {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
font-size: .85rem;
|
font-size: 0.85rem;
|
||||||
.page-item .page-link {
|
.page-item .page-link {
|
||||||
width: 2.2rem;
|
width: 2.2rem;
|
||||||
height: 2.2rem;
|
height: 2.2rem;
|
||||||
@@ -142,4 +159,4 @@
|
|||||||
#post-list {
|
#post-list {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,16 +27,32 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
border-color: var(--btn-border-color);
|
border-color: var(--btn-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.post {
|
@mixin dot($pl: 0.2rem, $pr: 0.4rem) {
|
||||||
img {
|
content: "\2022";
|
||||||
max-width: 100%;
|
color: rgba(158, 158, 158, 0.8);
|
||||||
margin-top: .5rem;
|
padding-left: $pl;
|
||||||
margin-bottom: 1.5rem;
|
padding-right: $pr;
|
||||||
position: relative;
|
}
|
||||||
left: 50%;
|
|
||||||
-webkit-transform: translateX(-50%);
|
.post .post-meta {
|
||||||
-ms-transform: translateX(-50%);
|
> div:nth-child(2) {
|
||||||
transform: translateX(-50%);
|
> span:not(:first-child)::before {
|
||||||
|
@include dot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pv::after {
|
||||||
|
content: " views";
|
||||||
|
}
|
||||||
|
.readtime::after {
|
||||||
|
content: " read";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.post-content {
|
||||||
|
.preview-img {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 2.5rem;
|
||||||
|
@include align-center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,20 +96,20 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
p {
|
p {
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
margin-top: .3rem;
|
margin-top: 0.3rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
a, span {
|
a, span {
|
||||||
&::before {
|
&::before {
|
||||||
color: var(--text-muted-color);
|
color: var(--text-muted-color);
|
||||||
font-size: .65rem;
|
font-size: 0.65rem;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
left: .5px;
|
left: 0.5px;
|
||||||
&::before {
|
&::before {
|
||||||
content: $prompt-older
|
content: $prompt-older
|
||||||
}
|
}
|
||||||
@@ -101,7 +117,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
&:last-child {
|
&:last-child {
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-bottom-left-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
right: .5px;
|
right: 0.5px;
|
||||||
&::before {
|
&::before {
|
||||||
content: $prompt-newer
|
content: $prompt-newer
|
||||||
}
|
}
|
||||||
@@ -123,25 +139,24 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#toc-wrapper {
|
#toc-wrapper {
|
||||||
margin-top: 7rem;
|
|
||||||
border-left: 1px solid rgba(158, 158, 158, 0.17);
|
border-left: 1px solid rgba(158, 158, 158, 0.17);
|
||||||
position: -webkit-sticky;
|
position: -webkit-sticky;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 4rem;
|
top: 4rem;
|
||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
animation: fade-up .8s;
|
animation: fade-up 0.8s;
|
||||||
&.topbar-down {
|
&.topbar-down {
|
||||||
top: 6rem;
|
top: 6rem;
|
||||||
}
|
}
|
||||||
>h3 {
|
> span {
|
||||||
@include label(inherit, 600);
|
@include panel-label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#toc li>a {
|
#toc li>a {
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
padding-top: .5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: .5rem;
|
padding-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -152,19 +167,19 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
@include label(1.1rem, 600);
|
@include label(1.1rem, 600);
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
border: 1px solid var(--card-border-color);
|
border-color: var(--card-border-color);
|
||||||
background-color: var(--card-bg);
|
background-color: var(--card-bg);
|
||||||
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
||||||
-webkit-transition: all .3s ease-in-out;
|
-webkit-transition: all 0.3s ease-in-out;
|
||||||
-moz-transition: all .3s ease-in-out;
|
-moz-transition: all 0.3s ease-in-out;
|
||||||
transition: all .3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
h3 {
|
h3 {
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
-webkit-transform: translate3d(0, -3px, 0);
|
-webkit-transform: translate3d(0, -3px, 0);
|
||||||
transform: translate3d(0, -3px, 0);
|
transform: translate3d(0, -3px, 0);
|
||||||
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
box-shadow: 0 10px 15px -4px rgba(0,0,0,0.15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,8 +188,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: .9rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: 0.5rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
@@ -225,7 +240,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
a {
|
a {
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: .25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -235,7 +250,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>i {
|
>i {
|
||||||
padding-top: .35rem;
|
padding-top: 0.35rem;
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %btn-share-hovor;
|
@extend %btn-share-hovor;
|
||||||
}
|
}
|
||||||
@@ -283,7 +298,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
span:last-child {
|
span:last-child {
|
||||||
font-size: .85rem;
|
font-size: 0.85rem;
|
||||||
}
|
}
|
||||||
} // .license-wrapper
|
} // .license-wrapper
|
||||||
|
|
||||||
@@ -309,11 +324,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
.post {
|
.post {
|
||||||
.post-meta {
|
.post-meta {
|
||||||
>div:not(:first-child)::before {
|
>div:not(:first-child)::before {
|
||||||
content: "\2022";
|
@include dot(0.5rem, 0.2rem);
|
||||||
color: rgba(158, 158, 158, 0.8);
|
|
||||||
font-weight: bold;
|
|
||||||
padding-left: .5rem;
|
|
||||||
padding-right: .3rem;
|
|
||||||
}
|
}
|
||||||
&.flex-column {
|
&.flex-column {
|
||||||
-webkit-box-orient: horizontal!important;
|
-webkit-box-orient: horizontal!important;
|
||||||
@@ -333,19 +344,10 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
|||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 830px) {
|
||||||
.post img {
|
|
||||||
position: relative;
|
|
||||||
left: 50%;
|
|
||||||
-webkit-transform: translateX(-50%);
|
|
||||||
-ms-transform: translateX(-50%);
|
|
||||||
transform: translateX(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-navigation {
|
.post-navigation {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
margin-left: -.5rem;
|
margin-left: -.5rem;
|
||||||
margin-right: -.5rem;
|
margin-right: -.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
.tag {
|
.tag {
|
||||||
border-radius: 0.7em;
|
border-radius: 0.7em;
|
||||||
padding: 6px 8px 7px;
|
padding: 6px 8px 7px;
|
||||||
margin-right: .8rem;
|
margin-right: 0.8rem;
|
||||||
line-height: 3rem;
|
line-height: 3rem;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
border: 1px solid var(--tag-border) !important;
|
border: 1px solid var(--tag-border) !important;
|
||||||
@@ -22,4 +22,4 @@
|
|||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
font-family: 'Oswald', sans-serif;
|
font-family: 'Oswald', sans-serif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 52 KiB |
BIN
assets/img/sample/gh-pages-sources.png
Normal file
BIN
assets/img/sample/gh-pages-sources.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -18,4 +18,6 @@
|
|||||||
|
|
||||||
{% include_relative _commons/copy-link.js %}
|
{% include_relative _commons/copy-link.js %}
|
||||||
|
|
||||||
|
{% include_relative _commons/checkbox.js %}
|
||||||
|
|
||||||
{% include_relative _utils/tooltip-loader.js %}
|
{% include_relative _utils/tooltip-loader.js %}
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
||||||
*/
|
*/
|
||||||
$(window).scroll(function() {
|
|
||||||
if ($(this).scrollTop() > 50
|
|
||||||
&& $('#sidebar-trigger').css('display') == 'none') {
|
|
||||||
$('#back-to-top').fadeIn();
|
|
||||||
} else {
|
|
||||||
$('#back-to-top').fadeOut();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$('#back-to-top').click(function() {
|
$(window).scroll(() => {
|
||||||
$('body,html').animate({scrollTop: 0}, 800);
|
if ($(this).scrollTop() > 50 &&
|
||||||
|
$("#sidebar-trigger").css("display") === "none") {
|
||||||
|
$("#back-to-top").fadeIn();
|
||||||
|
} else {
|
||||||
|
$("#back-to-top").fadeOut();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#back-to-top").click(() => {
|
||||||
|
$("body,html").animate({
|
||||||
|
scrollTop: 0
|
||||||
|
}, 800);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
12
assets/js/_commons/checkbox.js
Normal file
12
assets/js/_commons/checkbox.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Create a more beautiful checkbox
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
/* hide browser default checkbox */
|
||||||
|
$("input[type=checkbox]").addClass("unloaded");
|
||||||
|
/* create checked checkbox */
|
||||||
|
$("input[type=checkbox][checked]").before("<i class=\"fas fa-check-circle checked\"></i>");
|
||||||
|
/* create normal checkbox */
|
||||||
|
$("input[type=checkbox]:not([checked])").before("<i class=\"far fa-circle\"></i>");
|
||||||
|
});
|
||||||
@@ -1,20 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copy current page url to clipboard.
|
* Copy current page url to clipboard.
|
||||||
* v2.1
|
* v2.1
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
* https://github.com/cotes2020/jekyll-theme-chirpy
|
||||||
* © 2020 Cotes Chung
|
* © 2020 Cotes Chung
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function copyLink(url) {
|
function copyLink(url) {
|
||||||
if (!url || 0 === url.length)
|
if (!url || 0 === url.length) {
|
||||||
url = window.location.href;
|
url = window.location.href;
|
||||||
|
}
|
||||||
|
|
||||||
var $temp = $("<input>");
|
var $temp = $("<input>");
|
||||||
|
|
||||||
$("body").append($temp);
|
$("body").append($temp);
|
||||||
$temp.val(url).select();
|
$temp.val(url).select();
|
||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
$temp.remove();
|
$temp.remove();
|
||||||
|
|
||||||
alert("Link copied successfully!");
|
alert("Link copied successfully!");
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,18 +8,18 @@
|
|||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
var btnSbTrigger = $('#sidebar-trigger');
|
var btnSbTrigger = $("#sidebar-trigger");
|
||||||
var btnSearchTrigger = $('#search-trigger');
|
var btnSearchTrigger = $("#search-trigger");
|
||||||
var btnCancel = $('#search-cancel');
|
var btnCancel = $("#search-cancel");
|
||||||
var btnClear = $('#search-cleaner');
|
var btnClear = $("#search-cleaner");
|
||||||
|
|
||||||
var main = $('#main');
|
var main = $("#main");
|
||||||
var topbarTitle = $('#topbar-title');
|
var topbarTitle = $("#topbar-title");
|
||||||
var searchWrapper = $('#search-wrapper');
|
var searchWrapper = $("#search-wrapper");
|
||||||
var resultWrapper = $('#search-result-wrapper');
|
var resultWrapper = $("#search-result-wrapper");
|
||||||
var results = $('#search-results');
|
var results = $("#search-results");
|
||||||
var input = $('#search-input');
|
var input = $("#search-input");
|
||||||
var hints = $('#search-hints');
|
var hints = $("#search-hints");
|
||||||
|
|
||||||
|
|
||||||
/*--- Actions in small screens (Sidebar unloaded) ---*/
|
/*--- Actions in small screens (Sidebar unloaded) ---*/
|
||||||
@@ -27,75 +27,76 @@ $(function() {
|
|||||||
var scrollBlocker = (function() {
|
var scrollBlocker = (function() {
|
||||||
var offset = 0;
|
var offset = 0;
|
||||||
return {
|
return {
|
||||||
block: function() {
|
block() {
|
||||||
offset = $(window).scrollTop();
|
offset = $(window).scrollTop();
|
||||||
},
|
},
|
||||||
release: function() {
|
release() {
|
||||||
$('html,body').scrollTop(offset);
|
$("html,body").scrollTop(offset);
|
||||||
},
|
},
|
||||||
getOffset: function() {
|
getOffset() {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})();
|
}());
|
||||||
|
|
||||||
var mobileSearchBar = (function() {
|
var mobileSearchBar = (function() {
|
||||||
return {
|
return {
|
||||||
on: function() {
|
on() {
|
||||||
btnSbTrigger.addClass('unloaded');
|
btnSbTrigger.addClass("unloaded");
|
||||||
topbarTitle.addClass('unloaded');
|
topbarTitle.addClass("unloaded");
|
||||||
btnSearchTrigger.addClass('unloaded');
|
btnSearchTrigger.addClass("unloaded");
|
||||||
searchWrapper.addClass('d-flex');
|
searchWrapper.addClass("d-flex");
|
||||||
btnCancel.addClass('loaded');
|
btnCancel.addClass("loaded");
|
||||||
},
|
},
|
||||||
off: function() {
|
off() {
|
||||||
btnCancel.removeClass('loaded');
|
btnCancel.removeClass("loaded");
|
||||||
searchWrapper.removeClass('d-flex');
|
searchWrapper.removeClass("d-flex");
|
||||||
btnSbTrigger.removeClass('unloaded');
|
btnSbTrigger.removeClass("unloaded");
|
||||||
topbarTitle.removeClass('unloaded');
|
topbarTitle.removeClass("unloaded");
|
||||||
btnSearchTrigger.removeClass('unloaded');
|
btnSearchTrigger.removeClass("unloaded");
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})();
|
}());
|
||||||
|
|
||||||
var resultSwitch = (function() {
|
var resultSwitch = (function() {
|
||||||
var visable = false;
|
var visable = false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
on: function() {
|
on() {
|
||||||
if (!visable) {
|
if (!visable) {
|
||||||
resultWrapper.removeClass('unloaded');
|
resultWrapper.removeClass("unloaded");
|
||||||
main.addClass('hidden');
|
main.addClass("hidden");
|
||||||
|
|
||||||
visable = true;
|
visable = true;
|
||||||
scrollBlocker.block();
|
scrollBlocker.block();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
off: function() {
|
off() {
|
||||||
if (visable) {
|
if (visable) {
|
||||||
results.empty();
|
results.empty();
|
||||||
if (hints.hasClass('unloaded')) {
|
if (hints.hasClass("unloaded")) {
|
||||||
hints.removeClass('unloaded');
|
hints.removeClass("unloaded");
|
||||||
}
|
}
|
||||||
resultWrapper.addClass('unloaded');
|
resultWrapper.addClass("unloaded");
|
||||||
btnClear.removeClass('visable');
|
btnClear.removeClass("visable");
|
||||||
main.removeClass('hidden');
|
main.removeClass("hidden");
|
||||||
|
|
||||||
input.val('');
|
input.val("");
|
||||||
visable = false;
|
visable = false;
|
||||||
|
|
||||||
scrollBlocker.release();
|
scrollBlocker.release();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isVisable: function() {
|
isVisable() {
|
||||||
return visable;
|
return visable;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})();
|
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
function isMobileView() {
|
function isMobileView() {
|
||||||
return btnCancel.hasClass('loaded');
|
return btnCancel.hasClass("loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
btnSearchTrigger.click(function() {
|
btnSearchTrigger.click(function() {
|
||||||
@@ -110,45 +111,45 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
input.focus(function() {
|
input.focus(function() {
|
||||||
searchWrapper.addClass('input-focus');
|
searchWrapper.addClass("input-focus");
|
||||||
});
|
});
|
||||||
|
|
||||||
input.focusout(function() {
|
input.focusout(function() {
|
||||||
searchWrapper.removeClass('input-focus');
|
searchWrapper.removeClass("input-focus");
|
||||||
});
|
});
|
||||||
|
|
||||||
input.on('keyup', function(e) {
|
input.on("keyup", function(e) {
|
||||||
if (e.keyCode == 8 && input.val() == '') {
|
if (e.keyCode === 8 && input.val() === "") {
|
||||||
if (!isMobileView()) {
|
if (!isMobileView()) {
|
||||||
resultSwitch.off();
|
resultSwitch.off();
|
||||||
} else {
|
} else {
|
||||||
hints.removeClass('unloaded');
|
hints.removeClass("unloaded");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (input.val() != '') {
|
if (input.val() !== "") {
|
||||||
resultSwitch.on();
|
resultSwitch.on();
|
||||||
|
|
||||||
if (!btnClear.hasClass('visible')) {
|
if (!btnClear.hasClass("visible")) {
|
||||||
btnClear.addClass('visable');
|
btnClear.addClass("visable");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMobileView()) {
|
if (isMobileView()) {
|
||||||
hints.addClass('unloaded');
|
hints.addClass("unloaded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
btnClear.on('click', function() {
|
btnClear.on("click", function() {
|
||||||
input.val('');
|
input.val("");
|
||||||
if (isMobileView()) {
|
if (isMobileView()) {
|
||||||
hints.removeClass('unloaded');
|
hints.removeClass("unloaded");
|
||||||
results.empty();
|
results.empty();
|
||||||
} else {
|
} else {
|
||||||
resultSwitch.off();
|
resultSwitch.off();
|
||||||
}
|
}
|
||||||
input.focus();
|
input.focus();
|
||||||
btnClear.removeClass('visable');
|
btnClear.removeClass("visable");
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,24 +11,24 @@ $(function() {
|
|||||||
var sidebarUtil = (function() {
|
var sidebarUtil = (function() {
|
||||||
const ATTR_DISPLAY = "sidebar-display";
|
const ATTR_DISPLAY = "sidebar-display";
|
||||||
var isExpanded = false;
|
var isExpanded = false;
|
||||||
var body = $('body');
|
var body = $("body");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toggle: function() {
|
toggle() {
|
||||||
if (isExpanded == false) {
|
if (isExpanded === false) {
|
||||||
body.attr(ATTR_DISPLAY, '');
|
body.attr(ATTR_DISPLAY, "");
|
||||||
} else {
|
} else {
|
||||||
body.removeAttr(ATTR_DISPLAY);
|
body.removeAttr(ATTR_DISPLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
isExpanded = !isExpanded;
|
isExpanded = !isExpanded;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
})();
|
}());
|
||||||
|
|
||||||
$("#sidebar-trigger").click(sidebarUtil.toggle);
|
$("#sidebar-trigger").click(sidebarUtil.toggle);
|
||||||
|
|
||||||
$('#mask').click(sidebarUtil.toggle);
|
$("#mask").click(sidebarUtil.toggle);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,47 @@ $(function() {
|
|||||||
var didScroll;
|
var didScroll;
|
||||||
var lastScrollTop = 0;
|
var lastScrollTop = 0;
|
||||||
var delta = 5;
|
var delta = 5;
|
||||||
var topbarHeight = $('#topbar-wrapper').outerHeight();
|
var topbarHeight = $("#topbar-wrapper").outerHeight();
|
||||||
|
|
||||||
|
function hasScrolled() {
|
||||||
|
var st = $(this).scrollTop();
|
||||||
|
|
||||||
|
/* Make sure they scroll more than delta */
|
||||||
|
if (Math.abs(lastScrollTop - st) <= delta) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (st > lastScrollTop && st > topbarHeight) {
|
||||||
|
/* Scroll Down */
|
||||||
|
$("#topbar-wrapper").removeClass("topbar-down").addClass("topbar-up");
|
||||||
|
|
||||||
|
if ($("#toc-wrapper").length > 0) {
|
||||||
|
$("#toc-wrapper").removeClass("topbar-down");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(".access").length > 0) {
|
||||||
|
$(".access").removeClass("topbar-down");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($("#search-input").is(":focus")) {
|
||||||
|
$("#search-input").blur(); /* remove focus */
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* Scroll Up */
|
||||||
|
if (st + $(window).height() < $(document).height()) {
|
||||||
|
$("#topbar-wrapper").removeClass("topbar-up").addClass("topbar-down");
|
||||||
|
if ($("#toc-wrapper").length > 0) {
|
||||||
|
$("#toc-wrapper").addClass("topbar-down");
|
||||||
|
}
|
||||||
|
if ($(".access").length > 0) {
|
||||||
|
$(".access").addClass("topbar-down");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastScrollTop = st;
|
||||||
|
}
|
||||||
|
|
||||||
$(window).scroll(function(event) {
|
$(window).scroll(function(event) {
|
||||||
if ($("#topbar-title").is(":hidden")) { /* Not in small screens */
|
if ($("#topbar-title").is(":hidden")) { /* Not in small screens */
|
||||||
@@ -26,42 +66,4 @@ $(function() {
|
|||||||
}
|
}
|
||||||
}, 250);
|
}, 250);
|
||||||
|
|
||||||
function hasScrolled() {
|
|
||||||
var st = $(this).scrollTop();
|
|
||||||
|
|
||||||
/* Make sure they scroll more than delta */
|
|
||||||
if (Math.abs(lastScrollTop - st) <= delta)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (st > lastScrollTop && st > topbarHeight) {
|
|
||||||
/* Scroll Down */
|
|
||||||
$('#topbar-wrapper').removeClass('topbar-down').addClass('topbar-up');
|
|
||||||
|
|
||||||
if ( $('#toc-wrapper').length > 0) {
|
|
||||||
$('#toc-wrapper').removeClass('topbar-down');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $('.access').length > 0) {
|
|
||||||
$('.access').removeClass('topbar-down');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#search-input').is(':focus')) {
|
|
||||||
$('#search-input').blur(); /* remove focus */
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
/* Scroll Up */
|
|
||||||
if (st + $(window).height() < $(document).height()) {
|
|
||||||
$('#topbar-wrapper').removeClass('topbar-up').addClass('topbar-down');
|
|
||||||
if ( $('#toc-wrapper').length > 0) {
|
|
||||||
$('#toc-wrapper').addClass('topbar-down');
|
|
||||||
}
|
|
||||||
if ( $('.access').length > 0) {
|
|
||||||
$('.access').addClass('topbar-down');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lastScrollTop = st;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
@@ -13,9 +13,9 @@ $(function() {
|
|||||||
$("div.post>h1").text().trim() : $("h1").text().trim();
|
$("div.post>h1").text().trim() : $("h1").text().trim();
|
||||||
|
|
||||||
if ($("#page-category").length || $("#page-tag").length) {
|
if ($("#page-category").length || $("#page-tag").length) {
|
||||||
/* The title in Category or Tag page will be '<title> <count_of_posts>' */
|
/* The title in Category or Tag page will be "<title> <count_of_posts>" */
|
||||||
if (/\s/.test(title)) {
|
if (/\s/.test(title)) {
|
||||||
title = title.replace(/[0-9]/g, '').trim();
|
title = title.replace(/[0-9]/g, "").trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,19 +29,19 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).scrollTop() >= 95) {
|
if ($(this).scrollTop() >= 95) {
|
||||||
if ($("#topbar-title").text() != title) {
|
if ($("#topbar-title").text() !== title) {
|
||||||
$("#topbar-title").text(title);
|
$("#topbar-title").text(title);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($("#topbar-title").text() != DEFAULT) {
|
if ($("#topbar-title").text() !== DEFAULT) {
|
||||||
$("#topbar-title").text(DEFAULT);
|
$("#topbar-title").text(DEFAULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Click title remove hover effect. */
|
/* Click title remove hover effect. */
|
||||||
$('#topbar-title').click(function() {
|
$("#topbar-title").click(function() {
|
||||||
$('body,html').animate({scrollTop: 0}, 800);
|
$("body,html").animate({scrollTop: 0}, 800);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -7,26 +7,26 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var child_prefix = "l_";
|
var childPrefix = "l_";
|
||||||
var parent_prefix = "h_";
|
var parentPrefix = "h_";
|
||||||
|
|
||||||
/* close up top-category */
|
/* close up top-category */
|
||||||
$(".collapse").on("hide.bs.collapse", function() { /* Bootstrap collapse events. */
|
$(".collapse").on("hide.bs.collapse", function() { /* Bootstrap collapse events. */
|
||||||
var parent_id = parent_prefix + $(this).attr('id').substring(child_prefix.length);
|
var parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
||||||
if (parent_id) {
|
if (parentId) {
|
||||||
$("#" + parent_id + " .far.fa-folder-open").attr("class", "far fa-folder fa-fw");
|
$("#" + parentId + " .far.fa-folder-open").attr("class", "far fa-folder fa-fw");
|
||||||
$("#" + parent_id + " i.fas").addClass("rotate");
|
$("#" + parentId + " i.fas").addClass("rotate");
|
||||||
$("#" + parent_id).removeClass("hide-border-bottom");
|
$("#" + parentId).removeClass("hide-border-bottom");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* expand the top category */
|
/* expand the top category */
|
||||||
$(".collapse").on("show.bs.collapse", function() {
|
$(".collapse").on("show.bs.collapse", function() {
|
||||||
var parent_id = parent_prefix + $(this).attr('id').substring(child_prefix.length);
|
var parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
||||||
if (parent_id) {
|
if (parentId) {
|
||||||
$("#" + parent_id + " .far.fa-folder").attr("class", "far fa-folder-open fa-fw");
|
$("#" + parentId + " .far.fa-folder").attr("class", "far fa-folder-open fa-fw");
|
||||||
$("#" + parent_id + " i.fas").removeClass("rotate");
|
$("#" + parentId + " i.fas").removeClass("rotate");
|
||||||
$("#" + parent_id).addClass("hide-border-bottom");
|
$("#" + parentId).addClass("hide-border-bottom");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
16
assets/js/_utils/img-hyperlink.js
Normal file
16
assets/js/_utils/img-hyperlink.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Find out the <a> tag contains an image and mark it.
|
||||||
|
*
|
||||||
|
* v2.5.1
|
||||||
|
* https://github.com/cotes2020/jekyll-theme-chirpy
|
||||||
|
* © 2020 Cotes Chung
|
||||||
|
* MIT Licensed
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
|
||||||
|
var MARK="img-hyperlink";
|
||||||
|
|
||||||
|
$("a:has(img)").addClass(MARK);
|
||||||
|
|
||||||
|
});
|
||||||
20
assets/js/_utils/lang-badge.js
Normal file
20
assets/js/_utils/lang-badge.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Add language indicator to code snippets
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
const prefix = "language-";
|
||||||
|
const regex = new RegExp(`^${prefix}([a-z])+$`);
|
||||||
|
|
||||||
|
$(`div[class^=${prefix}`).each(function() {
|
||||||
|
let clzsses = $(this).attr("class").split(" ");
|
||||||
|
|
||||||
|
clzsses.forEach((clzss) => {
|
||||||
|
if (regex.test(clzss)) {
|
||||||
|
let lang = clzss.substring(prefix.length);
|
||||||
|
$(this).attr("lang", `${lang}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -11,84 +11,19 @@
|
|||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function countUp(min, max, destId) {
|
var getInitStatus = (function () {
|
||||||
if (min < max) {
|
|
||||||
var numAnim = new CountUp(destId, min, max);
|
|
||||||
if (!numAnim.error) {
|
|
||||||
numAnim.start();
|
|
||||||
} else {
|
|
||||||
console.error(numAnim.error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function countPV(path, rows) {
|
|
||||||
var count = 0;
|
|
||||||
|
|
||||||
if (rows !== undefined ) {
|
|
||||||
for (var i = 0; i < rows.length; ++i) {
|
|
||||||
var gaPath = rows[i][0];
|
|
||||||
if (gaPath == path) { /* path format see: site.permalink */
|
|
||||||
count += parseInt(rows[i][1]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function tacklePV(rows, path, elem, hasInit) {
|
|
||||||
var count = countPV(path, rows);
|
|
||||||
count = (count == 0 ? 1 : count);
|
|
||||||
|
|
||||||
if (!hasInit) {
|
|
||||||
elem.text(new Intl.NumberFormat().format(count));
|
|
||||||
} else {
|
|
||||||
var initCount = parseInt(elem.text().replace(/,/g, ''));
|
|
||||||
if (count > initCount) {
|
|
||||||
countUp(initCount, count, elem.attr('id'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function displayPageviews(data) {
|
|
||||||
if (data === undefined) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hasInit = getInitStatus();
|
|
||||||
var rows = data.rows; /* could be undefined */
|
|
||||||
|
|
||||||
if ($("#post-list").length > 0) { /* the Home page */
|
|
||||||
$(".post-preview").each(function() {
|
|
||||||
var path = $(this).children("div").children("h1").children("a").attr("href");
|
|
||||||
tacklePV(rows, path, $(this).find('.pageviews'), hasInit);
|
|
||||||
});
|
|
||||||
|
|
||||||
} else if ($(".post").length > 0) { /* the post */
|
|
||||||
var path = window.location.pathname;
|
|
||||||
tacklePV(rows, path, $('#pv'), hasInit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var getInitStatus = (function() {
|
|
||||||
var hasInit = false;
|
var hasInit = false;
|
||||||
return function() {
|
return () => {
|
||||||
let ret = hasInit;
|
let ret = hasInit;
|
||||||
if (!hasInit) {
|
if (!hasInit) {
|
||||||
hasInit = true;
|
hasInit = true;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
};
|
||||||
})();
|
}());
|
||||||
|
|
||||||
|
|
||||||
var PvCache = (function() {
|
var PvCache = (function () {
|
||||||
const KEY_PV = "pv";
|
const KEY_PV = "pv";
|
||||||
const KEY_CREATION = "pv_created_date";
|
const KEY_CREATION = "pv_created_date";
|
||||||
const KEY_PV_SRC = "pv_source";
|
const KEY_PV_SRC = "pv_source";
|
||||||
@@ -107,26 +42,26 @@ var PvCache = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getData: function() {
|
getData() {
|
||||||
return JSON.parse(localStorage.getItem(KEY_PV) );
|
return JSON.parse(localStorage.getItem(KEY_PV) );
|
||||||
},
|
},
|
||||||
saveOriginCache: function(pv) {
|
saveOriginCache(pv) {
|
||||||
set(KEY_PV, pv);
|
set(KEY_PV, pv);
|
||||||
set(KEY_PV_SRC, Source.ORIGIN );
|
set(KEY_PV_SRC, Source.ORIGIN );
|
||||||
set(KEY_CREATION, new Date().toJSON() );
|
set(KEY_CREATION, new Date().toJSON() );
|
||||||
},
|
},
|
||||||
saveProxyCache: function(pv) {
|
saveProxyCache(pv) {
|
||||||
set(KEY_PV, pv);
|
set(KEY_PV, pv);
|
||||||
set(KEY_PV_SRC, Source.PROXY );
|
set(KEY_PV_SRC, Source.PROXY );
|
||||||
set(KEY_CREATION, new Date().toJSON() );
|
set(KEY_CREATION, new Date().toJSON() );
|
||||||
},
|
},
|
||||||
isFromOrigin: function() {
|
isFromOrigin() {
|
||||||
return get(KEY_PV_SRC) == Source.ORIGIN;
|
return get(KEY_PV_SRC) === Source.ORIGIN;
|
||||||
},
|
},
|
||||||
isFromProxy: function() {
|
isFromProxy() {
|
||||||
return get(KEY_PV_SRC) == Source.PROXY;
|
return get(KEY_PV_SRC) === Source.PROXY;
|
||||||
},
|
},
|
||||||
isExpired: function() {
|
isExpired() {
|
||||||
if (PvCache.isFromOrigin() ) {
|
if (PvCache.isFromOrigin() ) {
|
||||||
let date = new Date(get(KEY_CREATION));
|
let date = new Date(get(KEY_CREATION));
|
||||||
date.setDate(date.getDate() + 1); /* update origin records every day */
|
date.setDate(date.getDate() + 1); /* update origin records every day */
|
||||||
@@ -139,30 +74,110 @@ var PvCache = (function() {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
getAllPagevies: function() {
|
getAllPagevies() {
|
||||||
return PvCache.getData().totalsForAllResults["ga:pageviews"];
|
return PvCache.getData().totalsForAllResults["ga:pageviews"];
|
||||||
},
|
},
|
||||||
newerThan: function(pv) {
|
newerThan(pv) {
|
||||||
return PvCache.getAllPagevies() > pv.totalsForAllResults["ga:pageviews"];
|
return PvCache.getAllPagevies() > pv.totalsForAllResults["ga:pageviews"];
|
||||||
},
|
},
|
||||||
inspectKeys: function() {
|
inspectKeys() {
|
||||||
if (localStorage.getItem(KEY_PV) == null
|
if (localStorage.getItem(KEY_PV) === null
|
||||||
|| localStorage.getItem(KEY_PV_SRC) == null
|
|| localStorage.getItem(KEY_PV_SRC) === null
|
||||||
|| localStorage.getItem(KEY_CREATION) == null) {
|
|| localStorage.getItem(KEY_CREATION) === null) {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
})(); /* PvCache */
|
}()); /* PvCache */
|
||||||
|
|
||||||
|
function countUp(min, max, destId) {
|
||||||
|
if (min < max) {
|
||||||
|
var numAnim = new CountUp(destId, min, max);
|
||||||
|
if (!numAnim.error) {
|
||||||
|
numAnim.start();
|
||||||
|
} else {
|
||||||
|
console.error(numAnim.error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function countPV(path, rows) {
|
||||||
|
var count = 0;
|
||||||
|
|
||||||
|
if (typeof rows !== "undefined" ) {
|
||||||
|
for (var i = 0; i < rows.length; ++i) {
|
||||||
|
var gaPath = rows[parseInt(i, 10)][0];
|
||||||
|
if (gaPath === path) { /* path format see: site.permalink */
|
||||||
|
count += parseInt(rows[parseInt(i, 10)][1], 10);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function tacklePV(rows, path, elem, hasInit) {
|
||||||
|
var count = countPV(path, rows);
|
||||||
|
count = (count === 0 ? 1 : count);
|
||||||
|
|
||||||
|
if (!hasInit) {
|
||||||
|
elem.text(new Intl.NumberFormat().format(count));
|
||||||
|
} else {
|
||||||
|
var initCount = parseInt(elem.text().replace(/,/g, ""), 10);
|
||||||
|
if (count > initCount) {
|
||||||
|
countUp(initCount, count, elem.attr("id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function displayPageviews(data) {
|
||||||
|
if (typeof data === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var hasInit = getInitStatus();
|
||||||
|
var rows = data.rows; /* could be undefined */
|
||||||
|
|
||||||
|
if ($("#post-list").length > 0) { /* the Home page */
|
||||||
|
$(".post-preview").each(function() {
|
||||||
|
var path = $(this).find("a").attr("href");
|
||||||
|
tacklePV(rows, path, $(this).find(".pageviews"), hasInit);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else if ($(".post").length > 0) { /* the post */
|
||||||
|
var path = window.location.pathname;
|
||||||
|
tacklePV(rows, path, $("#pv"), hasInit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fetchProxyPageviews() {
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: proxyEndpoint, /* see: /assets/js/_pv-config.js */
|
||||||
|
dataType: "jsonp",
|
||||||
|
jsonpCallback: "displayPageviews",
|
||||||
|
success: (data, textStatus, jqXHR) => {
|
||||||
|
PvCache.saveProxyCache(JSON.stringify(data));
|
||||||
|
},
|
||||||
|
error: (jqXHR, textStatus, errorThrown) => {
|
||||||
|
console.log("Failed to load pageviews from proxy server: " + errorThrown);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function fetchPageviews(fetchOrigin = true, filterOrigin = false) {
|
function fetchPageviews(fetchOrigin = true, filterOrigin = false) {
|
||||||
/* pvCacheEnabled › see: /assets/js/_pv-config.js */
|
/* pvCacheEnabled › see: /assets/js/_pv-config.js */
|
||||||
if (pvCacheEnabled && fetchOrigin) {
|
if (pvCacheEnabled && fetchOrigin) {
|
||||||
fetch('/assets/js/data/pageviews.json')
|
fetch("/assets/js/data/pageviews.json")
|
||||||
.then(response => response.json())
|
.then((response) => response.json())
|
||||||
.then(data => {
|
.then((data) => {
|
||||||
if (filterOrigin) {
|
if (filterOrigin) {
|
||||||
if (PvCache.newerThan(data)) {
|
if (PvCache.newerThan(data)) {
|
||||||
return;
|
return;
|
||||||
@@ -180,25 +195,9 @@ function fetchPageviews(fetchOrigin = true, filterOrigin = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function fetchProxyPageviews() {
|
|
||||||
$.ajax({
|
|
||||||
type: 'GET',
|
|
||||||
url: proxyEndpoint, /* see: /assets/js/_pv-config.js */
|
|
||||||
dataType: 'jsonp',
|
|
||||||
jsonpCallback: "displayPageviews",
|
|
||||||
success: function(data, textStatus, jqXHR) {
|
|
||||||
PvCache.saveProxyCache(JSON.stringify(data));
|
|
||||||
},
|
|
||||||
error: function(jqXHR, textStatus, errorThrown) {
|
|
||||||
console.log("Failed to load pageviews from proxy server: " + errorThrown);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
if ($('.pageviews').length > 0) {
|
if ($(".pageviews").length > 0) {
|
||||||
|
|
||||||
PvCache.inspectKeys();
|
PvCache.inspectKeys();
|
||||||
let cache = PvCache.getData();
|
let cache = PvCache.getData();
|
||||||
|
|||||||
80
assets/js/_utils/smooth-scroll.js
Normal file
80
assets/js/_utils/smooth-scroll.js
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
Safari doesn't support CSS `scroll-behavior: smooth`,
|
||||||
|
so here is a compatible sollution for all browser to smooth scrolling
|
||||||
|
|
||||||
|
See: <https://css-tricks.com/snippets/jquery/smooth-scrolling/>
|
||||||
|
|
||||||
|
Warning: It must be called after all `<a>` tags (e.g., the dynamic TOC) are ready.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("a[href*='#']")
|
||||||
|
.not("[href='#']")
|
||||||
|
.not("[href='#0']")
|
||||||
|
.click(function(event) {
|
||||||
|
|
||||||
|
if (location.pathname.replace(/^\//, "") === this.pathname.replace(/^\//, "")
|
||||||
|
&& location.hostname === this.hostname) {
|
||||||
|
|
||||||
|
const REM = 16; /* 16px */
|
||||||
|
|
||||||
|
const hash = decodeURI(this.hash);
|
||||||
|
let isFnRef = RegExp(/^#fnref:/).test(hash);
|
||||||
|
let isFn = RegExp(/^#fn:/).test(hash);
|
||||||
|
let selector = hash.includes(":") ? hash.replace(/\:/, "\\:") : hash;
|
||||||
|
const target = $(selector);
|
||||||
|
|
||||||
|
if (target.length) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (history.pushState) { /* add hash to URL */
|
||||||
|
history.pushState(null, null, hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
let curOffset = $(this).offset().top;
|
||||||
|
let destOffset = target.offset().top;
|
||||||
|
const scrollUp = (destOffset < curOffset);
|
||||||
|
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
||||||
|
|
||||||
|
if (scrollUp && isFnRef) {
|
||||||
|
/* Avoid the top-bar covering `fnref` when scrolling up
|
||||||
|
because `fnref` has no `%anchor`(see: module.scss) style. */
|
||||||
|
destOffset -= (topbarHeight + REM / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$("html,body").animate({
|
||||||
|
scrollTop: destOffset
|
||||||
|
}, 800, () => {
|
||||||
|
|
||||||
|
var $target = $(target);
|
||||||
|
$target.focus();
|
||||||
|
|
||||||
|
const SCROLL_MARK = "scroll-focus";
|
||||||
|
|
||||||
|
/* clean up old scroll mark */
|
||||||
|
if ($(`[${ SCROLL_MARK }=true]`).length) {
|
||||||
|
$(`[${ SCROLL_MARK }=true]`).attr(SCROLL_MARK, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Clean :target links */
|
||||||
|
if ($(":target").length) { /* element that visited by the URL with hash */
|
||||||
|
$(":target").attr(SCROLL_MARK, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set scroll mark to footnotes */
|
||||||
|
if (isFn || isFnRef) {
|
||||||
|
$target.attr(SCROLL_MARK, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($target.is(":focus")) { /* Checking if the target was focused */
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
||||||
|
$target.focus(); /* Set focus again */
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}); /* click() */
|
||||||
|
});
|
||||||
@@ -8,24 +8,28 @@
|
|||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
|
var toRefresh = $(".timeago").length;
|
||||||
|
|
||||||
|
var intervalId = void 0;
|
||||||
|
|
||||||
function timeago(iso, isLastmod) {
|
function timeago(iso, isLastmod) {
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let past = new Date(iso);
|
let past = new Date(iso);
|
||||||
|
|
||||||
if (past.getFullYear() != now.getFullYear()) {
|
if (past.getFullYear() !== now.getFullYear()) {
|
||||||
toRefresh -= 1;
|
toRefresh -= 1;
|
||||||
return past.toLocaleString("en-US", {
|
return past.toLocaleString("en-US", {
|
||||||
year: 'numeric',
|
year: "numeric",
|
||||||
month: 'short',
|
month: "short",
|
||||||
day: 'numeric'
|
day: "numeric"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (past.getMonth() != now.getMonth()) {
|
if (past.getMonth() !== now.getMonth()) {
|
||||||
toRefresh -= 1;
|
toRefresh -= 1;
|
||||||
return past.toLocaleString("en-US", {
|
return past.toLocaleString("en-US", {
|
||||||
month: 'short',
|
month: "short",
|
||||||
day: 'numeric'
|
day: "numeric"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,37 +51,33 @@ $(function() {
|
|||||||
return minute + " minute" + (minute > 1 ? "s" : "") + " ago";
|
return minute + " minute" + (minute > 1 ? "s" : "") + " ago";
|
||||||
}
|
}
|
||||||
|
|
||||||
return (isLastmod? "just" : "Just") + " now";
|
return (isLastmod ? "just" : "Just") + " now";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateTimeago() {
|
function updateTimeago() {
|
||||||
$(".timeago").each(function() {
|
$(".timeago").each(function() {
|
||||||
if ($(this).children("i").length > 0) {
|
if ($(this).children("i").length > 0) {
|
||||||
var basic = $(this).text();
|
var basic = $(this).text();
|
||||||
var isLastmod = $(this).hasClass('lastmod');
|
var isLastmod = $(this).hasClass("lastmod");
|
||||||
var node = $(this).children("i");
|
var node = $(this).children("i");
|
||||||
var date = node.text(); /* ISO Date: 'YYYY-MM-DDTHH:MM:SSZ' */
|
var date = node.text(); /* ISO Date: "YYYY-MM-DDTHH:MM:SSZ" */
|
||||||
$(this).text(timeago(date, isLastmod));
|
$(this).text(timeago(date, isLastmod));
|
||||||
$(this).append(node);
|
$(this).append(node);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (toRefresh == 0 && intervalId != undefined) {
|
if (toRefresh === 0 && typeof intervalId !== "undefined") {
|
||||||
clearInterval(intervalId); /* stop interval */
|
clearInterval(intervalId); /* stop interval */
|
||||||
}
|
}
|
||||||
return toRefresh;
|
return toRefresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (toRefresh === 0) {
|
||||||
var toRefresh = $(".timeago").length;
|
|
||||||
|
|
||||||
if (toRefresh == 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateTimeago() > 0) { /* run immediately */
|
if (updateTimeago() > 0) { /* run immediately */
|
||||||
var intervalId = setInterval(updateTimeago, 60000); /* run every minute */
|
intervalId = setInterval(updateTimeago, 60000); /* run every minute */
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* Hide the empty ToC in posts.
|
|
||||||
* v2.0
|
|
||||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
* © 2019 Cotes Chung
|
|
||||||
* MIT Licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
if ($("#post-wrapper .post-content h1").length == 0
|
|
||||||
&& $("#post-wrapper .post-content h2").length == 0) {
|
|
||||||
$("#toc-wrapper").addClass("unloaded");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -6,5 +6,5 @@
|
|||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
$(function () {
|
$(function () {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$("[data-toggle=\"tooltip\"]").tooltip();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,46 +26,13 @@ const include = [
|
|||||||
'{{ "/assets/js/home.min.js" | relative_url }}',
|
'{{ "/assets/js/home.min.js" | relative_url }}',
|
||||||
'{{ "/assets/js/page.min.js" | relative_url }}',
|
'{{ "/assets/js/page.min.js" | relative_url }}',
|
||||||
'{{ "/assets/js/post.min.js" | relative_url }}',
|
'{{ "/assets/js/post.min.js" | relative_url }}',
|
||||||
|
'{{ "/assets/js/categories.min.js" | relative_url }}',
|
||||||
|
|
||||||
/*--- HTML ---*/
|
/*--- HTML ---*/
|
||||||
|
|
||||||
/* Tabs */
|
/* Tabs */
|
||||||
{% for tab in site.data.tabs %}
|
{% for tab in site.tabs %}
|
||||||
{% capture item %}
|
'{{ tab.url }}',
|
||||||
{%- unless tab.name == 'Home' -%}
|
|
||||||
/tabs/{{ tab.name | downcase }}
|
|
||||||
{%- endunless -%}
|
|
||||||
{{- "/" -}}
|
|
||||||
{% endcapture %}
|
|
||||||
'{{ item | relative_url }}',
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
/* The posts of first Home page and recent update list */
|
|
||||||
{% assign post_list = "" | split: "" %}
|
|
||||||
|
|
||||||
{% for post in site.posts limit: site.paginate %}
|
|
||||||
{% capture post_url %}{{ post.url | relative_url }}{% endcapture %}
|
|
||||||
{% assign post_list = post_list | push: post_url %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% include update-list.html %}
|
|
||||||
|
|
||||||
{% for item in update_list %}
|
|
||||||
{% assign url = item | split: "::" | last | url_encode | prepend: "/posts/" | append: "/" | relative_url %}
|
|
||||||
{% assign post_list = post_list | push: url %}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% assign post_list = post_list | uniq %}
|
|
||||||
|
|
||||||
{% for url in post_list %}
|
|
||||||
'{{ url }}',
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
/* Trending tags */
|
|
||||||
{% include trending-tags.html %}
|
|
||||||
{% for tag in trending_tags %}
|
|
||||||
{% capture tag_url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
|
|
||||||
'{{ tag_url | relative_url }}',
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
/*--- Icons ---*/
|
/*--- Icons ---*/
|
||||||
|
|||||||
2
assets/js/page.min.js
vendored
2
assets/js/page.min.js
vendored
@@ -9,3 +9,5 @@ layout: compress
|
|||||||
---
|
---
|
||||||
|
|
||||||
{% include_relative _commons.js %}
|
{% include_relative _commons.js %}
|
||||||
|
|
||||||
|
{% include_relative _utils/smooth-scroll.js %}
|
||||||
|
|||||||
7
assets/js/post.min.js
vendored
7
assets/js/post.min.js
vendored
@@ -12,4 +12,9 @@ layout: compress
|
|||||||
|
|
||||||
{% include_relative lib/_bootstrap-toc.min.js %}
|
{% include_relative lib/_bootstrap-toc.min.js %}
|
||||||
|
|
||||||
{% include_relative _utils/toc-filter.js %}
|
{% include_relative _utils/img-hyperlink.js %}
|
||||||
|
|
||||||
|
{% include_relative _utils/lang-badge.js %}
|
||||||
|
|
||||||
|
{% comment %} `smooth-scroll.js` must be called after ToC is ready {% endcomment %}
|
||||||
|
{% include_relative _utils/smooth-scroll.js %}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# Chirpy
|
# Chirpy
|
||||||
|
|
||||||
🌏 [English](../README.md) • 简体中文
|
Language: [English](../README.md) | 简体中文
|
||||||
|
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||||
|
[](https://app.codacy.com/manual/cotes2020/jekyll-theme-chirpy?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade_Dashboard)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[](https://996.icu)
|
[](https://996.icu)
|
||||||
|
|
||||||
@@ -10,49 +11,48 @@
|
|||||||
|
|
||||||
[](https://chirpy.cotes.info)
|
[](https://chirpy.cotes.info)
|
||||||
|
|
||||||
> ⚠️ 中文版文档存在更新不及时的风险(开源文档以英文为主,请见谅)。如果发现中、英文内容不匹配的情况,一切以英文版内容为准。如果您愿意的话,可提交 issuse 提醒作者更新中文版 README,谢谢。
|
> :bulb: 中文版文档存在更新不及时的风险(开源文档以英文为主,请见谅)。如果发现中、英文内容不匹配的情况,一切以英文版内容为准。如果您愿意的话,可提交 issue 提醒作者更新中文版 README,谢谢。
|
||||||
|
|
||||||
## 目录
|
## 目录
|
||||||
|
|
||||||
* [功能一览](#功能一览)
|
- [功能一览](#功能一览)
|
||||||
* [安装](#安装)
|
- [安装](#安装)
|
||||||
* [使用](#使用)
|
- [使用](#使用)
|
||||||
* [参与贡献](#参与贡献)
|
- [参与贡献](#参与贡献)
|
||||||
* [感谢](#感谢)
|
- [鸣谢](#鸣谢)
|
||||||
* [赞助](#赞助)
|
- [赞助](#赞助)
|
||||||
* [许可证书](#许可证书)
|
- [许可证书](#许可证书)
|
||||||
|
|
||||||
## 功能一览
|
## 功能一览
|
||||||
|
|
||||||
* 文章置顶
|
- 文章置顶
|
||||||
* 可配置的全局主题颜色
|
- 可配置的全局主题颜色
|
||||||
* 文章最后修改日期
|
- 文章最后修改日期
|
||||||
* 文章目录
|
- 文章目录
|
||||||
* 自动推荐相关文章
|
- 自动推荐相关文章
|
||||||
* 语法高亮
|
- 语法高亮
|
||||||
* 二级目录
|
- 二级目录
|
||||||
* 数学表达式
|
- 数学表达式
|
||||||
* 搜索
|
- Mermaid 图表
|
||||||
* Atom 订阅
|
- 搜索
|
||||||
* Disqus 评论
|
- Atom 订阅
|
||||||
* Google 分析
|
- Disqus 评论
|
||||||
* GA 浏览报告(高级功能)
|
- Google 分析
|
||||||
* SEO 优化
|
- GA 浏览报告(高级功能)
|
||||||
* 网站性能优化
|
- SEO 优化
|
||||||
|
- 网站性能优化
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork),然后克隆到本地:
|
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork),把仓库改名为 `USERNAME.github.io`(其中 `USERNAME` 是你的 GitHub 用户名), 然后克隆到本地:
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ git clone git@github.com:<username>/jekyll-theme-chirpy -b master --single-branch
|
$ git clone https://github.com/USERNAME/USERNAME.github.io.git -b master --single-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
### 设置本地环境
|
### 设置本地环境
|
||||||
|
|
||||||
如果你想在本地运行或构建, 参考 [Jekyll Docs](https://jekyllrb.com/docs/installation/)安装 `Ruby`, `RubyGems` 和 `Bundler`。
|
如果你想在本地运行或构建, 参考 [Jekyll Docs](https://jekyllrb.com/docs/installation/)安装 `Ruby`,`RubyGems`,`Jekyll` 和 `Bundler`。
|
||||||
|
|
||||||
|
|
||||||
首次运行或构建时, 请先安装 Jekyll plugins。在项目根目录运行:
|
首次运行或构建时, 请先安装 Jekyll plugins。在项目根目录运行:
|
||||||
|
|
||||||
@@ -62,25 +62,17 @@ $ bundle install
|
|||||||
|
|
||||||
`bundle` 会自动安装 `Gemfile` 内指定的依赖插件。
|
`bundle` 会自动安装 `Gemfile` 内指定的依赖插件。
|
||||||
|
|
||||||
另外,为了生成一些额外的文件( Post 的分类、标签以及更新时间列表),需要用到一些脚本工具。如果你电脑的操作系统是 Debian 或者 macOS,请确保已经安装了[GNU coreutils](https://www.gnu.org/software/coreutils/),否则,通过以下方式完成安装:
|
### 配置 Docker 镜像(可选)
|
||||||
|
|
||||||
* Debian
|
如果你是 [**Docker**](https://www.docker.com/) 的铁粉,或者不想在本地安装上述 [_设置本地环境_](#设置本地环境) 提到的包, 那么请确保先安装并运行了 **Docker Engine** 然后从 Docker Hub 获取镜像 `jekyll/jekyll`:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ sudo apt-get install coreutils
|
$ docker pull jekyll/jekyll
|
||||||
```
|
```
|
||||||
|
|
||||||
* macOS
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ brew install coreutils
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
运行 [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) 需要一些额外的文件, 它们不能通过 Jekyll 原生的命令生成,所以请严格依照下列说明去运行或部署此项目。
|
|
||||||
|
|
||||||
### 初始化
|
### 初始化
|
||||||
|
|
||||||
在项目根目录,开始初始化:
|
在项目根目录,开始初始化:
|
||||||
@@ -94,36 +86,44 @@ $ bash tools/init.sh
|
|||||||
上述脚本完成了以下工作:
|
上述脚本完成了以下工作:
|
||||||
|
|
||||||
1. 从你的仓库中删除了:
|
1. 从你的仓库中删除了:
|
||||||
- `.travis.yml`
|
|
||||||
- `.github` 下的文件和目录
|
|
||||||
- `_posts` 下的文件
|
|
||||||
- `docs` 目录
|
|
||||||
|
|
||||||
2. 配置了 GitHub Actions:把 `.github/workflows/` 的文件 `pages-deploy.yml.hook` 重命名为 `pages-deploy.yml`。
|
- `.travis.yml`
|
||||||
|
- `_posts` 下的文件
|
||||||
|
- `docs` 目录
|
||||||
|
|
||||||
3. 自动提交一个 Commit 以保存文件的更改。
|
2. 如果使用了参数 `--no-gh`,则会怒删 `.github`。否则,将会配置 GitHub Actions:把 `.github/workflows/pages-deploy.yml.hook` 的后缀 `.hook` 去除,然后删除 `.github` 里的其他目录和文件。
|
||||||
|
|
||||||
|
3. 自动提交一个 Commit 以保存上述文件的更改。
|
||||||
|
|
||||||
### 配置文件
|
### 配置文件
|
||||||
|
|
||||||
根据个人需要去修改 `_config.yml` 的变量,大部分都有注释介绍用法。典型的几个选项是:
|
根据个人需要去修改 `_config.yml` 的变量,大部分都有注释介绍用法。典型的几个选项是:
|
||||||
|
|
||||||
* `url`
|
- `url`
|
||||||
* `avatar`
|
- `avatar`
|
||||||
* `timezone`
|
- `timezone`
|
||||||
* `theme_mode`
|
- `theme_mode`
|
||||||
|
|
||||||
### 本地运行
|
### 本地运行
|
||||||
|
|
||||||
使用以下工具可轻松运行:
|
发布之前,在本地预览:
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
$ bash tools/run.sh
|
$ bundle exec jekyll s
|
||||||
```
|
```
|
||||||
|
|
||||||
访问本地服务: <http://localhost:4000>
|
访问本地服务: <http://localhost:4000>
|
||||||
|
|
||||||
如果你想在本地服务运行后,把修改源文件的更改实时刷新,可使用选项 `-r` (或 `--realtime`),不过要先安装依赖 [**fswatch**](http://emcrisostomo.github.io/fswatch/) 。
|
### 用 Docker 运行
|
||||||
|
|
||||||
|
在项目根目录运行命令:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
$ docker run -it --rm \
|
||||||
|
--volume="$PWD:/srv/jekyll" \
|
||||||
|
-p 4000:4000 jekyll/jekyll \
|
||||||
|
jekyll serve
|
||||||
|
```
|
||||||
|
|
||||||
### 部署
|
### 部署
|
||||||
|
|
||||||
@@ -133,70 +133,56 @@ $ bash tools/run.sh
|
|||||||
|
|
||||||
#### 部署到 GitHub Pages
|
#### 部署到 GitHub Pages
|
||||||
|
|
||||||
由于安全原因,GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用脚本工具去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
|
由于安全原因,GitHub Pages 的构建强制加了 `safe`参数,这导致了我们不能使用插件去创建所需的附加页面。因此,我们可以使用 GitHub Actions 去构建站点,把站点文件存储在一个新分支上,再指定该分支作为 Pages 服务的源。
|
||||||
|
|
||||||
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
1. 推送任意一个 commit 到 `origin/master` 以触发 GitHub Actions workflow。一旦 build 完毕并且成功,远端将会自动出现一个新分支 `gh-pages` 用来存储构建的站点文件。
|
||||||
|
|
||||||
2. 除非你是使用 project 站点, 否则重命名你的仓库为 `<username>.github.io`。
|
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):
|
||||||
|

|
||||||
|
|
||||||
3. 选择分支 `gh-pages` 作为 GitHub Pages 的源.
|
3. 按照 GitHub 指示的地址去访问你的网站。
|
||||||
|
|
||||||
4. 按照 GitHub 指示的地址去访问你的网站。
|
|
||||||
|
|
||||||
#### 部署到其他 Pages 平台
|
#### 部署到其他 Pages 平台
|
||||||
|
|
||||||
在 GitHub 之外的平台,例如 GitLab,就没法享受 **GitHub Actions** 的便利了。不过先别慌,可以通过工具来弥补这个遗憾。
|
在 GitHub 之外的平台,例如 GitLab,就没法享受 **GitHub Actions** 的便利了。因此我们需要在本地构建站点(或者在其他第三方 CI 平台),然后推送站点文件到服务器上。
|
||||||
|
|
||||||
先把本地仓库的 upstream 改为新平台的仓库地址,推送一发。以后每次更新内容后,提交 commit ,然后运行:
|
在项目根目录,运行:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bash tools/publish.sh
|
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||||
```
|
```
|
||||||
|
|
||||||
>**注**: *最后更新* 列表根据文章的 git 修改记录生成,所以运行前先把 `_posts` 目录的修改提交。
|
或者通过 Docker 构建:
|
||||||
|
|
||||||
它会自动生成文章的 *最后修改日期* 和 *分类 / 标签* 页面,并自动提交一个 commit 并推送到 `origin/master` 。输出日志类似如下:
|
|
||||||
|
|
||||||
```terminal
|
```terminal
|
||||||
[INFO] Success to update lastmod for 4 post(s).
|
$ docker run -it --rm \
|
||||||
[INFO] Succeed! 3 category-pages created.
|
--env JEKYLL_ENV=production \
|
||||||
[INFO] Succeed! 4 tag-pages created.
|
--volume="$PWD:/srv/jekyll" \
|
||||||
[INFO] Published successfully!
|
jekyll/jekyll \
|
||||||
|
jekyll build
|
||||||
```
|
```
|
||||||
|
|
||||||
最后,根据平台的说明文档为项目开启 Pages 服务。
|
生成的静态文件将会在 `_site`, 把内部的文件上传到服务器即可。
|
||||||
|
|
||||||
#### 部署到私人服务器
|
|
||||||
|
|
||||||
在项目更目录,运行:
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ bash tools/build.sh -d /path/to/site/
|
|
||||||
```
|
|
||||||
|
|
||||||
生成的静态文件将会在 `/path/to/site/`, 把内部的文件上传到服务器即可。
|
|
||||||
|
|
||||||
### 文档
|
### 文档
|
||||||
|
|
||||||
若想要更多细节以及更佳的阅读体验,请参阅 [线上教程](https://chirpy.cotes.info/categories/tutorial/)。 与此同时,[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki) 也有一份教程的拷贝。
|
若想要更多细节以及更佳的阅读体验,请参阅 [线上教程](https://chirpy.cotes.info/categories/tutorial/)。 与此同时,[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki) 也有一份教程的拷贝。
|
||||||
|
|
||||||
|
|
||||||
## 参与贡献
|
## 参与贡献
|
||||||
|
|
||||||
三人行必有我师,欢迎提报告 bug, 帮助改进代码质量,或者提交新功能。具体操作规则请参考 [贡献指南](../.github/CONTRIBUTING.md),谢谢 🙏。
|
三人行必有我师,欢迎提报告 bug, 帮助改进代码质量,或者提交新功能。具体操作规则请参考 [贡献指南](../.github/CONTRIBUTING.md),谢谢 🙏。
|
||||||
|
|
||||||
## 感谢
|
## 鸣谢
|
||||||
|
|
||||||
这个主题的开发主要基于 [Jekyll](https://jekyllrb.com/) 生态、[Bootstrap](https://getbootstrap.com/)、[Font Awesome](https://fontawesome.com/) 和其他一些出色的工具 (相关文件中可以找到这些工具的版权信息).
|
这个主题的开发主要基于 [Jekyll](https://jekyllrb.com/) 生态、[Bootstrap](https://getbootstrap.com/)、[Font Awesome](https://fontawesome.com/) 和其他一些出色的工具 (相关文件中可以找到这些工具的版权信息).
|
||||||
|
|
||||||
: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、分享新点子或者启发了我写出更通俗易懂的文档。
|
||||||
|
|
||||||
|
|
||||||
## 赞助
|
## 赞助
|
||||||
|
|
||||||
如果您喜欢这个主题或者它对您有帮助,请考虑打赏作者:在 [项目主页](https://github.com/cotes2020/jekyll-theme-chirpy) 点击按钮 <kbd>:heart: Sponsor</kbd> 选择适合的链接即可完成(国内一般选第二个链接,支付宝/微信赞助),您的打赏将会极大地鼓励作者,并帮助作者更好地维护项目!
|
如果您喜欢这个主题或者它对您有帮助,请考虑打赏作者:在 [项目主页](https://github.com/cotes2020/jekyll-theme-chirpy) 点击按钮 <kbd>:heart: Sponsor</kbd> 选择适合的链接即可完成(国内一般选第二个链接,支付宝/微信赞助),您的打赏将会极大地鼓励作者,并帮助作者更好地维护项目!
|
||||||
|
|
||||||
|
|
||||||
## 许可证书
|
## 许可证书
|
||||||
|
|
||||||
本项目开源,基于 [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) 许可。
|
本项目开源,基于 [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) 许可。
|
||||||
14
feed.xml
14
feed.xml
@@ -30,10 +30,10 @@ layout: compress
|
|||||||
<title>{{ post.title }}</title>
|
<title>{{ post.title }}</title>
|
||||||
<link href="{{ post_absolute_url }}" rel="alternate" type="text/html" title="{{ post.title }}" />
|
<link href="{{ post_absolute_url }}" rel="alternate" type="text/html" title="{{ post.title }}" />
|
||||||
<published>{{ post.date | date_to_xmlschema }}</published>
|
<published>{{ post.date | date_to_xmlschema }}</published>
|
||||||
{% if post.seo.date_modified %}
|
{% if post.last_modified_at %}
|
||||||
<updated>{{ post.seo.date_modified | date_to_xmlschema }}</updated>
|
<updated>{{ post.last_modified_at | date_to_xmlschema }}</updated>
|
||||||
{% else %}
|
{% else %}
|
||||||
<updated>{{ site.time | date_to_xmlschema }}</updated>
|
<updated>{{ post.date | date_to_xmlschema }}</updated>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<id>{{ post_absolute_url }}</id>
|
<id>{{ post_absolute_url }}</id>
|
||||||
<content src="{{ post_absolute_url }}" />
|
<content src="{{ post_absolute_url }}" />
|
||||||
@@ -51,13 +51,13 @@ layout: compress
|
|||||||
<summary>{{ post.summary | strip }}</summary>
|
<summary>{{ post.summary | strip }}</summary>
|
||||||
{% else %}
|
{% else %}
|
||||||
<summary>
|
<summary>
|
||||||
{% assign content = post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
{% include no-linenos.html %}
|
{{ content | strip_html | truncate: 400 }}
|
||||||
{{ content | strip_html | truncate: 200 }}</summary>
|
</summary>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</entry>
|
</entry>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</feed>
|
</feed>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
{{ source | replace: '&', '&' }}
|
{{ source | replace: '&', '&' }}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user