mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 14:14:17 +00:00
Compare commits
83 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b5a3865ac | ||
|
|
fe2a3cdf51 | ||
|
|
4e7bf00ee9 | ||
|
|
773d3b1263 | ||
|
|
b0d5956f5a | ||
|
|
e50343b06b | ||
|
|
b3de722778 | ||
|
|
782a930fdf | ||
|
|
da7d7e25b6 | ||
|
|
f6e9a3fccf | ||
|
|
ae2669fedc | ||
|
|
48f14e39ac | ||
|
|
6774e0e1fb | ||
|
|
8134209aa2 | ||
|
|
c0e3e61fa7 | ||
|
|
e107a2e759 | ||
|
|
df8185f887 | ||
|
|
339293d0d7 | ||
|
|
1fd665bf49 | ||
|
|
e48d66e525 | ||
|
|
647eea8dbd | ||
|
|
1c330f403c | ||
|
|
b6a1a4172e | ||
|
|
3c44a1ff71 | ||
|
|
e7dee2a589 | ||
|
|
a6ce765082 | ||
|
|
294e2985c1 | ||
|
|
5de6f17754 | ||
|
|
d96fa5aa0c | ||
|
|
6852ceb280 | ||
|
|
f904e8cd48 | ||
|
|
81b9f7a9ac | ||
|
|
916fbf4a2c | ||
|
|
d9d7848f03 | ||
|
|
70662a0365 | ||
|
|
3432413020 | ||
|
|
fd5df7e1a1 | ||
|
|
65f722fb04 | ||
|
|
1082d041ca | ||
|
|
eac3f9b434 | ||
|
|
304d75c500 | ||
|
|
fb13e3219b | ||
|
|
5511b2883f | ||
|
|
76712c09cd | ||
|
|
80cb0b3717 | ||
|
|
d2fb98b3e5 | ||
|
|
39da11e3f3 | ||
|
|
fec5214b45 | ||
|
|
827f84c7e8 | ||
|
|
3ffd19d81d | ||
|
|
49bb93cc0c | ||
|
|
8bcdd87891 | ||
|
|
7cc36c5287 | ||
|
|
3878815852 | ||
|
|
e55ebadeb2 | ||
|
|
0c5b697fd3 | ||
|
|
f1d9e99bc0 | ||
|
|
b288587c1c | ||
|
|
f35b147b28 | ||
|
|
163c5761e9 | ||
|
|
4023be9bef | ||
|
|
0dcd39d491 | ||
|
|
45c58d8f4c | ||
|
|
e993ac872a | ||
|
|
21c8c2b70d | ||
|
|
43323abdfe | ||
|
|
b78a2d85bd | ||
|
|
940b2810e9 | ||
|
|
b405a58838 | ||
|
|
d792a2f6af | ||
|
|
22d4275f75 | ||
|
|
3fa1bf3054 | ||
|
|
ad137fa294 | ||
|
|
20b7fe3a53 | ||
|
|
5eb329f36c | ||
|
|
378b65a061 | ||
|
|
2fed338ce6 | ||
|
|
232927c47c | ||
|
|
5b97d3fd25 | ||
|
|
856ef11487 | ||
|
|
b0329775fc | ||
|
|
971fe03ec3 | ||
|
|
96af7291ea |
@@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"body-max-line-length": [0, "always"]
|
"body-max-line-length": [
|
||||||
|
0,
|
||||||
|
"always"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ root = true
|
|||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
# 2 space indentation
|
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
# Unix-style newlines with a newline ending every file
|
# Unix-style newlines with a newline ending every file
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
|
|
||||||
|
[*.js]
|
||||||
|
indent_size = 4
|
||||||
|
|||||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,2 +1,2 @@
|
|||||||
ko_fi: coteschung
|
ko_fi: coteschung
|
||||||
custom: https://cotes.gitee.io/alipay-wechat-donation
|
custom: https://sponsor.cotes.page
|
||||||
|
|||||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -22,7 +22,7 @@ Please select the desired item checkbox and change it to "[x]", then delete opti
|
|||||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- [ ] I have run `bash ./tools/deploy.sh --dry-run` (at the root of the project) locally and passed
|
- [ ] I have run `bash ./tools/test.sh` (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
|
||||||
|
|||||||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -20,18 +20,22 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ruby: [2.5, 2.6, 2.7, 3]
|
ruby: [2.5, 2.6, 2.7, 3]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # for posts's lastmod
|
fetch-depth: 0 # for posts's lastmod
|
||||||
|
|
||||||
- name: Setup Ruby
|
- name: Setup Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
|
||||||
- name: Test Site
|
- name: Test Site
|
||||||
run: bash tools/deploy.sh --dry-run
|
run: bash tools/test.sh
|
||||||
|
|||||||
58
.github/workflows/pages-deploy.yml.hook
vendored
58
.github/workflows/pages-deploy.yml.hook
vendored
@@ -1,29 +1,71 @@
|
|||||||
name: 'Automatic build'
|
name: "Build and Deploy"
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- main
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- .gitignore
|
- .gitignore
|
||||||
- README.md
|
- README.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
|
||||||
jobs:
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
continuous-delivery:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
# Allow one concurrent deployment
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # for posts's lastmod
|
fetch-depth: 0
|
||||||
|
# submodules: true
|
||||||
|
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
|
||||||
|
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
id: pages
|
||||||
|
uses: actions/configure-pages@v1
|
||||||
|
|
||||||
- name: Setup Ruby
|
- name: Setup Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 2.7
|
ruby-version: 3 # reads from a '.ruby-version' or '.tools-version' file if 'ruby-version' is omitted
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
|
||||||
- name: Deploy
|
- name: Build site
|
||||||
run: bash tools/deploy.sh
|
run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
|
||||||
|
env:
|
||||||
|
JEKYLL_ENV: "production"
|
||||||
|
|
||||||
|
- name: Test site
|
||||||
|
run: |
|
||||||
|
bundle exec htmlproofer _site --disable-external --check-html --allow_hash_href
|
||||||
|
|
||||||
|
- name: Upload site artifact
|
||||||
|
uses: actions/upload-pages-artifact@v1
|
||||||
|
with:
|
||||||
|
path: "_site${{ steps.pages.outputs.base_path }}"
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v1
|
||||||
|
|||||||
22
.github/workflows/style-lint.yml
vendored
Normal file
22
.github/workflows/style-lint.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: 'Style Lint'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '_sass/**.scss'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '_sass/**.scss'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stylelint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
- run: npm i
|
||||||
|
- run: npm test
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@
|
|||||||
!.husky
|
!.husky
|
||||||
!.commitlintrc.json
|
!.commitlintrc.json
|
||||||
!.versionrc.json
|
!.versionrc.json
|
||||||
|
!.stylelintrc.json
|
||||||
|
|
||||||
# bundler cache
|
# bundler cache
|
||||||
_site
|
_site
|
||||||
|
|||||||
22
.stylelintrc.json
Normal file
22
.stylelintrc.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"extends": "stylelint-config-standard-scss",
|
||||||
|
"rules": {
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
"shorthand-property-no-redundant-values": null,
|
||||||
|
"at-rule-no-vendor-prefix": null,
|
||||||
|
"property-no-vendor-prefix": null,
|
||||||
|
"selector-no-vendor-prefix": null,
|
||||||
|
"value-no-vendor-prefix": null,
|
||||||
|
"color-function-notation": "legacy",
|
||||||
|
"alpha-value-notation": "number",
|
||||||
|
"selector-not-notation": "simple",
|
||||||
|
"color-hex-length": "long",
|
||||||
|
"declaration-block-single-line-max-declarations": 3,
|
||||||
|
"font-family-no-missing-generic-family-keyword": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignoreFontFamilies": ["Font Awesome 5 Free"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,13 +16,16 @@ before_script: git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
|
|||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: Upgrade
|
- stage: Upgrade
|
||||||
|
cache: bundler
|
||||||
git:
|
git:
|
||||||
depth: false # for posts' lastmod
|
depth: false # for posts' lastmod
|
||||||
script: eval "$BUILD_CMD"
|
script: eval "$BUILD_CMD"
|
||||||
|
|
||||||
- stage: Starter
|
- stage: Starter
|
||||||
language: minimal
|
language: minimal
|
||||||
install: true # skip install step
|
install: true # skip install step
|
||||||
script: eval "$FLUSH_STARTER"
|
script: eval "$FLUSH_STARTER"
|
||||||
|
|
||||||
- stage: Docs
|
- stage: Docs
|
||||||
cache: bundler
|
cache: bundler
|
||||||
git:
|
git:
|
||||||
|
|||||||
63
CHANGELOG.md
63
CHANGELOG.md
@@ -2,6 +2,69 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [5.3.2](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.3.1...v5.3.2) (2022-11-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* `mermaid` occasionally fails to initialize ([#536](https://github.com/cotes2020/jekyll-theme-chirpy/issues/536)) ([48f14e3](https://github.com/cotes2020/jekyll-theme-chirpy/commit/48f14e39ac81bbfb3b9913ea3ee789d775b2d1ae))
|
||||||
|
* **comment:** disqus doesn't follow theme mode switching ([b0d5956](https://github.com/cotes2020/jekyll-theme-chirpy/commit/b0d5956f5a0ed894984d6b1754efeba04d8bc966))
|
||||||
|
* restore full-text search ([#741](https://github.com/cotes2020/jekyll-theme-chirpy/issues/741)) ([6774e0e](https://github.com/cotes2020/jekyll-theme-chirpy/commit/6774e0e1fb37cf467b14be481347412713763f05))
|
||||||
|
* the image URL in the SEO-related tags is incomplete ([#754](https://github.com/cotes2020/jekyll-theme-chirpy/issues/754)) ([f6e9a3f](https://github.com/cotes2020/jekyll-theme-chirpy/commit/f6e9a3fccf7ab34db71f8aefaf86fdcc05861076))
|
||||||
|
|
||||||
|
## [5.3.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.3.0...v5.3.1) (2022-10-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 404 page missing title in tablet/desktop view ([5511b28](https://github.com/cotes2020/jekyll-theme-chirpy/commit/5511b2883fd5a395fddfb642588d00c122f18da7))
|
||||||
|
* prompt content overflows horizontally ([#705](https://github.com/cotes2020/jekyll-theme-chirpy/issues/705)) ([fb13e32](https://github.com/cotes2020/jekyll-theme-chirpy/commit/fb13e3219b5eca0d2e4f86a1ecabfab75240369f))
|
||||||
|
* **tools:** multiple configuration files will fail the test ([80cb0b3](https://github.com/cotes2020/jekyll-theme-chirpy/commit/80cb0b371754e96772a7907877a8ce196398ba3d))
|
||||||
|
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* **layout:** improve the min-height of main content ([#674](https://github.com/cotes2020/jekyll-theme-chirpy/issues/674)) ([49bb93c](https://github.com/cotes2020/jekyll-theme-chirpy/commit/49bb93cc0c89ad9cfaad5edcf9cb28c3d5134575))
|
||||||
|
* modify checkbox icon with `Liquid` ([1fd665b](https://github.com/cotes2020/jekyll-theme-chirpy/commit/1fd665bf4990c26ae23635c511c5abc9640184d1))
|
||||||
|
* optimize the extra padding in lists ([#703](https://github.com/cotes2020/jekyll-theme-chirpy/issues/703)) ([39da11e](https://github.com/cotes2020/jekyll-theme-chirpy/commit/39da11e3f3685f49321757576d2b87a48bf25db5)), closes [#702](https://github.com/cotes2020/jekyll-theme-chirpy/issues/702)
|
||||||
|
* **posts:** improve core block bottom padding ([d2fb98b](https://github.com/cotes2020/jekyll-theme-chirpy/commit/d2fb98b3e57f2f6c3fc3816551cd0721731adf40))
|
||||||
|
* truncate post content for search results ([647eea8](https://github.com/cotes2020/jekyll-theme-chirpy/commit/647eea8dbd716f9d3cb8330c3139fa753903f51d))
|
||||||
|
* **typography:** optimize the line height of post content ([eac3f9b](https://github.com/cotes2020/jekyll-theme-chirpy/commit/eac3f9b434ca77e3dc64eea9cedea7b93e7b306b))
|
||||||
|
|
||||||
|
### Others
|
||||||
|
|
||||||
|
* **giscus:** add `reactions-enabled` option ([#712](https://github.com/cotes2020/jekyll-theme-chirpy/issues/712)) ([70662a0](https://github.com/cotes2020/jekyll-theme-chirpy/commit/70662a0365e6b9378602dc0a57462ddad5aebcf5))
|
||||||
|
* **locale:** restore options for changing date format ([#716](https://github.com/cotes2020/jekyll-theme-chirpy/issues/716)) ([f904e8c](https://github.com/cotes2020/jekyll-theme-chirpy/commit/f904e8cd48c343cc31e25859d9d50bfe2c056f41))
|
||||||
|
* remove site config option `prefer_datetime_locale` ([6852ceb](https://github.com/cotes2020/jekyll-theme-chirpy/commit/6852ceb280927ff4e753a3e1131f2b396d9807d0))
|
||||||
|
|
||||||
|
## [5.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.2.1...v5.3.0) (2022-09-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add multiple authors to a post ([#677](https://github.com/cotes2020/jekyll-theme-chirpy/issues/677)) ([f1d9e99](https://github.com/cotes2020/jekyll-theme-chirpy/commit/f1d9e99bc02d3cd0a6b0cd1beac545f0cc7a24f8)), closes [#675](https://github.com/cotes2020/jekyll-theme-chirpy/issues/675)
|
||||||
|
* **i18n:** add Bulgarian support ([#612](https://github.com/cotes2020/jekyll-theme-chirpy/issues/612)) ([2fed338](https://github.com/cotes2020/jekyll-theme-chirpy/commit/2fed338ce6d078bf528c9717201fbc475f88cd22))
|
||||||
|
* **i18n:** add German locale file ([#663](https://github.com/cotes2020/jekyll-theme-chirpy/issues/663)) ([940b281](https://github.com/cotes2020/jekyll-theme-chirpy/commit/940b2810e95065e30600ae8d5e4612e7183da60e))
|
||||||
|
* **i18n:** add Hungarian locale file ([#597](https://github.com/cotes2020/jekyll-theme-chirpy/issues/597), [#598](https://github.com/cotes2020/jekyll-theme-chirpy/issues/598)) ([b032977](https://github.com/cotes2020/jekyll-theme-chirpy/commit/b0329775fc24d0323e5cc04cda46ece8b4531802))
|
||||||
|
* **i18n:** add Turkish language ([#631](https://github.com/cotes2020/jekyll-theme-chirpy/issues/631)) ([ad137fa](https://github.com/cotes2020/jekyll-theme-chirpy/commit/ad137fa2945b1870b9c1dd5e9212a5f4af7c3580))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add missing color to linkedin icon for share list ([#683](https://github.com/cotes2020/jekyll-theme-chirpy/issues/683)) ([0dcd39d](https://github.com/cotes2020/jekyll-theme-chirpy/commit/0dcd39d491c9c49e4acf7f75f83fe6e1d1839e37))
|
||||||
|
* code contains spaces in headings ([#644](https://github.com/cotes2020/jekyll-theme-chirpy/issues/644)) ([3fa1bf3](https://github.com/cotes2020/jekyll-theme-chirpy/commit/3fa1bf305451f645a7f3aa93863b076463c8f165))
|
||||||
|
* correct spelling of `panel` ([#686](https://github.com/cotes2020/jekyll-theme-chirpy/issues/686)) ([b288587](https://github.com/cotes2020/jekyll-theme-chirpy/commit/b288587c1c3d113a1c52c2d25fb46cddda348961))
|
||||||
|
* correct the i18n for tab titles ([0c5b697](https://github.com/cotes2020/jekyll-theme-chirpy/commit/0c5b697fd3b283b6a5c926742b61ed49d8688c18))
|
||||||
|
* the `code` doesn't wrap inside the prompt ([#626](https://github.com/cotes2020/jekyll-theme-chirpy/issues/626)) ([378b65a](https://github.com/cotes2020/jekyll-theme-chirpy/commit/378b65a0617787813519dde74d6f741f255eff3d))
|
||||||
|
|
||||||
|
## [5.2.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.2.0...v5.2.1) (2022-06-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* exclude CHANGELOG from output ([971fe03](https://github.com/cotes2020/jekyll-theme-chirpy/commit/971fe03ec329ae49e7d60fe3af6101cfbd1acd6c))
|
||||||
|
* **PWA:** sometimes update notification is not triggered ([96af729](https://github.com/cotes2020/jekyll-theme-chirpy/commit/96af7291ea5b2c5ed6372e7b6f7725e67c69f1ba))
|
||||||
|
|
||||||
## [5.2.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.1.0...v5.2.0) (2022-06-09)
|
## [5.2.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v5.1.0...v5.2.0) (2022-06-09)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
|
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
|
||||||
|
|
||||||
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml)
|
||||||
[](https://www.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade)
|
||||||
[](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)
|
||||||
@@ -73,7 +73,7 @@ After a while, navigate to the site at <http://localhost:4000>.
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
For more details on usage, please refer to the tutorial on the [demo website](https://cotes2020.github.io/chirpy-demo/) / [wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Note that the tutorial is based on the [latest tag](https://github.com/cotes2020/jekyll-theme-chirpy/tags), and the features of the default branch are usually ahead of the documentation.
|
For more details on usage, please refer to the tutorial on the [demo website](https://cotes2020.github.io/chirpy-demo/) / [wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Note that the tutorial is based on the [latest release](https://github.com/cotes2020/jekyll-theme-chirpy/releases/latest), and the features of the default branch are usually ahead of the documentation.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -102,4 +102,4 @@ This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chi
|
|||||||
<!-- ReadMe links -->
|
<!-- ReadMe links -->
|
||||||
|
|
||||||
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||||
[cn-donation]: https://cotes.gitee.io/alipay-wechat-donation/
|
[cn-donation]: https://sponsor.cotes.page/
|
||||||
|
|||||||
16
_config.yml
16
_config.yml
@@ -12,8 +12,6 @@ baseurl: ''
|
|||||||
# otherwise, the layout language will use the default value of 'en'.
|
# otherwise, the layout language will use the default value of 'en'.
|
||||||
lang: en
|
lang: en
|
||||||
|
|
||||||
# Additional parameters for datetime localization, optional. › https://github.com/iamkun/dayjs/tree/dev/src/locale
|
|
||||||
prefer_datetime_locale:
|
|
||||||
|
|
||||||
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
@@ -41,7 +39,7 @@ social:
|
|||||||
# Change to your full name.
|
# Change to your full name.
|
||||||
# It will be displayed as the default author of the posts and the copyright owner in the Footer
|
# It will be displayed as the default author of the posts and the copyright owner in the Footer
|
||||||
name: your_full_name
|
name: your_full_name
|
||||||
email: example@doamin.com # change to your email address
|
email: example@domain.com # change to your email address
|
||||||
links:
|
links:
|
||||||
# The first element serves as the copyright owner's link
|
# The first element serves as the copyright owner's link
|
||||||
- https://twitter.com/username # change to your twitter homepage
|
- https://twitter.com/username # change to your twitter homepage
|
||||||
@@ -80,7 +78,7 @@ theme_mode: # [light|dark]
|
|||||||
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
||||||
#
|
#
|
||||||
# e.g. 'https://cdn.com'
|
# e.g. 'https://cdn.com'
|
||||||
img_cdn: 'https://raw.githubusercontent.com/cotes2020/chirpy-images/main'
|
img_cdn: 'https://demo-img.cotes.page'
|
||||||
|
|
||||||
# the avatar on sidebar, support local or CORS resources
|
# the avatar on sidebar, support local or CORS resources
|
||||||
avatar: '/commons/avatar.jpg'
|
avatar: '/commons/avatar.jpg'
|
||||||
@@ -99,13 +97,14 @@ comments:
|
|||||||
issue_term: # < url | pathname | title | ...>
|
issue_term: # < url | pathname | title | ...>
|
||||||
# Giscus options › https://giscus.app
|
# Giscus options › https://giscus.app
|
||||||
giscus:
|
giscus:
|
||||||
repo: # <gh-username>/<repo>
|
repo: # <gh-username>/<repo>
|
||||||
repo_id:
|
repo_id:
|
||||||
category:
|
category:
|
||||||
category_id:
|
category_id:
|
||||||
mapping: # optional, default to 'pathname'
|
mapping: # optional, default to 'pathname'
|
||||||
input_position: # optional, default to 'bottom'
|
input_position: # optional, default to 'bottom'
|
||||||
lang: # optional, default to the value of `site.lang`
|
lang: # optional, default to the value of `site.lang`
|
||||||
|
reactions_enabled: # optional, default to the value of `1`
|
||||||
|
|
||||||
# Self-hosted static assets, optional › https://github.com/cotes2020/chirpy-static-assets
|
# Self-hosted static assets, optional › https://github.com/cotes2020/chirpy-static-assets
|
||||||
assets:
|
assets:
|
||||||
@@ -185,6 +184,7 @@ exclude:
|
|||||||
- '*.gemspec'
|
- '*.gemspec'
|
||||||
- tools
|
- tools
|
||||||
- README.md
|
- README.md
|
||||||
|
- CHANGELOG.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
- gulpfile.js
|
- gulpfile.js
|
||||||
- node_modules
|
- node_modules
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ bootstrap-toc:
|
|||||||
js: https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js
|
js: https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js
|
||||||
|
|
||||||
fontawesome:
|
fontawesome:
|
||||||
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css
|
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css
|
||||||
|
|
||||||
search:
|
search:
|
||||||
js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
|
js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
|
||||||
|
|
||||||
mermaid:
|
mermaid:
|
||||||
js: https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js
|
js: https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.min.js
|
||||||
|
|
||||||
dayjs:
|
dayjs:
|
||||||
js:
|
js:
|
||||||
@@ -53,7 +53,7 @@ lozad:
|
|||||||
js: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
|
js: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
|
||||||
|
|
||||||
clipboard:
|
clipboard:
|
||||||
js: https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
|
js: https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
|
||||||
|
|
||||||
polyfill:
|
polyfill:
|
||||||
js: https://polyfill.io/v3/polyfill.min.js?features=es6
|
js: https://polyfill.io/v3/polyfill.min.js?features=es6
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ bootstrap-toc:
|
|||||||
js: /assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js
|
js: /assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js
|
||||||
|
|
||||||
fontawesome:
|
fontawesome:
|
||||||
css: /assets/lib/fontawesome-free-5.15.4/css/all.min.css
|
css: /assets/lib/fontawesome-free-6.2.1/css/all.min.css
|
||||||
|
|
||||||
search:
|
search:
|
||||||
js: /assets/lib/simple-jekyll-search-1.10.0/simple-jekyll-search.min.js
|
js: /assets/lib/simple-jekyll-search-1.10.0/simple-jekyll-search.min.js
|
||||||
|
|
||||||
mermaid:
|
mermaid:
|
||||||
js: /assets/lib/mermaid-8.13.10/mermaid.min.js
|
js: /assets/lib/mermaid-9.1.7/mermaid.min.js
|
||||||
|
|
||||||
dayjs:
|
dayjs:
|
||||||
js:
|
js:
|
||||||
|
|||||||
83
_data/locales/bg-BG.yml
Normal file
83
_data/locales/bg-BG.yml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: Публикация
|
||||||
|
category: Категория
|
||||||
|
tag: Тагове
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: Начало
|
||||||
|
categories: Категории
|
||||||
|
tags: Тагове
|
||||||
|
archives: Архив
|
||||||
|
about: За мен
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: търси
|
||||||
|
cancel: Отмени
|
||||||
|
no_results: Упс! Не са намерени резултати.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: Наскоро обновени
|
||||||
|
trending_tags: Популярни тагове
|
||||||
|
toc: Съдържание
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: Тази публикация е лицензирана под :LICENSE_NAME от автора.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: Някои права запазени.
|
||||||
|
verbose: >-
|
||||||
|
Освен ако не е посочено друго, публикациите в блога на този сайт са лицензирани
|
||||||
|
под лиценза Creative Commons Attribution 4.0 (CC BY 4.0) от автора.
|
||||||
|
|
||||||
|
meta: Създадено чрез :PLATFORM и :THEME тема.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: Съжалявам, но този на този URL адрес няма налично съдържание.
|
||||||
|
|
||||||
|
notification:
|
||||||
|
update_found: Налична е нова версия на съдържанието.
|
||||||
|
update: Обнови
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: Автор
|
||||||
|
posted: Публикувана
|
||||||
|
updated: Обновена
|
||||||
|
words: думи
|
||||||
|
pageview_measure: преглеждания
|
||||||
|
read_time:
|
||||||
|
unit: мин
|
||||||
|
prompt: четиво
|
||||||
|
relate_posts: Още за четене
|
||||||
|
share: Споделете
|
||||||
|
button:
|
||||||
|
next: По-нови
|
||||||
|
previous: По-стари
|
||||||
|
copy_code:
|
||||||
|
succeed: Копирано!
|
||||||
|
share_link:
|
||||||
|
title: Копирай линк
|
||||||
|
succeed: Линкът е копиран успешно!
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: Прикрепен
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure:
|
||||||
|
singular: категория
|
||||||
|
plural: категории
|
||||||
|
post_measure:
|
||||||
|
singular: публикация
|
||||||
|
plural: публикации
|
||||||
82
_data/locales/de-DE.yml
Normal file
82
_data/locales/de-DE.yml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: Eintrag
|
||||||
|
category: Kategorie
|
||||||
|
tag: Tag
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: Startseite
|
||||||
|
categories: Kategorien
|
||||||
|
tags: Tags
|
||||||
|
archives: Archiv
|
||||||
|
about: Über
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: Suche
|
||||||
|
cancel: Abbrechen
|
||||||
|
no_results: Ups! Keine Einträge gefunden.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: Kürzlich aktualisiert
|
||||||
|
trending_tags: Beliebte Tags
|
||||||
|
toc: Inhalt
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: Dieser Eintrag ist vom Autor unter :LICENSE_NAME lizensiert.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: Einige Rechte vorbehalten.
|
||||||
|
verbose: >-
|
||||||
|
Alle Einträge auf dieser Seite stehen, soweit nicht anders angegeben, unter der Lizenz Creative Commons Attribution 4.0 (CC BY 4.0).
|
||||||
|
|
||||||
|
meta: Powered by :PLATFORM with :THEME theme.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: Entschuldigung, dieser Link verweist auf keine vorhandene Ressource.
|
||||||
|
|
||||||
|
notification:
|
||||||
|
update_found: Eine neue Version ist verfügbar.
|
||||||
|
update: Neue Version
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: Von
|
||||||
|
posted: Veröffentlicht
|
||||||
|
updated: Aktualisiert
|
||||||
|
words: Wörter
|
||||||
|
pageview_measure: Aufrufe
|
||||||
|
read_time:
|
||||||
|
unit: Minuten
|
||||||
|
prompt: lesen
|
||||||
|
relate_posts: Weiterlesen
|
||||||
|
share: Teilen
|
||||||
|
button:
|
||||||
|
next: Nächster Eintrag
|
||||||
|
previous: Eintrag vorher
|
||||||
|
copy_code:
|
||||||
|
succeed: Kopiert!
|
||||||
|
share_link:
|
||||||
|
title: Link kopieren
|
||||||
|
succeed: Link erfolgreich kopiert!
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: Angepinnt
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure:
|
||||||
|
singular: Kategorie
|
||||||
|
plural: Kategorien
|
||||||
|
post_measure:
|
||||||
|
singular: Eintrag
|
||||||
|
plural: Einträge
|
||||||
@@ -73,6 +73,16 @@ post:
|
|||||||
# pinned prompt of posts list on homepage
|
# pinned prompt of posts list on homepage
|
||||||
pin_prompt: Pinned
|
pin_prompt: Pinned
|
||||||
|
|
||||||
|
# Date time format.
|
||||||
|
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
|
||||||
|
df:
|
||||||
|
post:
|
||||||
|
strftime: '%b %e, %Y'
|
||||||
|
dayjs: 'll'
|
||||||
|
archives:
|
||||||
|
strftime: '%b'
|
||||||
|
dayjs: 'MMM'
|
||||||
|
|
||||||
# categories page
|
# categories page
|
||||||
categories:
|
categories:
|
||||||
category_measure:
|
category_measure:
|
||||||
|
|||||||
81
_data/locales/hu-HU.yml
Normal file
81
_data/locales/hu-HU.yml
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: Bejegyzés
|
||||||
|
category: Kategória
|
||||||
|
tag: Címke
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: Kezdőlap
|
||||||
|
categories: Kategóriák
|
||||||
|
tags: Címkék
|
||||||
|
archives: Archívum
|
||||||
|
about: Rólam
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: keresés
|
||||||
|
cancel: Mégse
|
||||||
|
no_results: Oops! Nincs találat a keresésre.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: Legutóbb frissítve
|
||||||
|
trending_tags: Népszerű Címkék
|
||||||
|
toc: Tartalom
|
||||||
|
links: Blog linkek
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: A bejegyzés :LICENSE_NAME licenccel rendelkezik.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: Néhány jog fenntartva.
|
||||||
|
verbose: >-
|
||||||
|
Az oldalon található tartalmak
|
||||||
|
Creative Commons Attribution 4.0 International (CC BY 4.0) licenccel rendelkeznek,
|
||||||
|
hacsak másképp nincs jelezve.
|
||||||
|
|
||||||
|
meta: Készítve :PLATFORM motorral :THEME témával.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: Sajnáljuk, az URL-t rosszul helyeztük el, vagy valami nem létezőre mutat.
|
||||||
|
|
||||||
|
notification:
|
||||||
|
update_found: Elérhető a tartalom új verziója.
|
||||||
|
update: Frissítés
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: Szerző
|
||||||
|
posted: Létrehozva
|
||||||
|
updated: Frissítve
|
||||||
|
words: szó
|
||||||
|
pageview_measure: látogató
|
||||||
|
read_time:
|
||||||
|
unit: perc
|
||||||
|
prompt: elolvasni
|
||||||
|
relate_posts: További olvasnivaló
|
||||||
|
share: Megosztás
|
||||||
|
button:
|
||||||
|
next: Újabb
|
||||||
|
previous: Régebbi
|
||||||
|
copy_code:
|
||||||
|
succeed: Másolva!
|
||||||
|
share_link:
|
||||||
|
title: Link másolása
|
||||||
|
succeed: Link sikeresen másolva!
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: Kitűzve
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure: kategória
|
||||||
|
post_measure: bejegyzés
|
||||||
@@ -73,6 +73,13 @@ post:
|
|||||||
# pinned prompt of posts list on homepage
|
# pinned prompt of posts list on homepage
|
||||||
pin_prompt: 핀
|
pin_prompt: 핀
|
||||||
|
|
||||||
|
# Date time format.
|
||||||
|
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
|
||||||
|
df:
|
||||||
|
post:
|
||||||
|
strftime: '%Y/%m/%d'
|
||||||
|
dayjs: 'YYYY/MM/DD'
|
||||||
|
|
||||||
# categories page
|
# categories page
|
||||||
categories:
|
categories:
|
||||||
category_measure: 카테고리
|
category_measure: 카테고리
|
||||||
|
|||||||
79
_data/locales/tr-TR.yml
Normal file
79
_data/locales/tr-TR.yml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: Gönderi
|
||||||
|
category: Kategori
|
||||||
|
tag: Etiket
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: Ana Sayfa
|
||||||
|
categories: Kategoriler
|
||||||
|
tags: Etiketler
|
||||||
|
archives: Arşiv
|
||||||
|
about: Hakkında
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: Ara...
|
||||||
|
cancel: İptal
|
||||||
|
no_results: Hop! Öyle bir şey bulamadım.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: Yeni Güncellendi
|
||||||
|
trending_tags: Yükselen Etiketler
|
||||||
|
toc: İçindekiler
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: Bu gönderi :LICENSE_NAME lisansı altındadır.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/deed.tr
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: Bazı hakları saklıdır.
|
||||||
|
verbose: >-
|
||||||
|
Aksi belirtilmediği sürece, bu sitedeki gönderiler Creative Commons Atıf 4.0 Uluslararası (CC BY 4.0) Lisansı altındadır.
|
||||||
|
Kısaca sayfa linkini de vererek paylaşabilir veya düzenleyip paylaşabilirsin.
|
||||||
|
|
||||||
|
meta: :PLATFORM ve :THEME teması.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: Üzgünüz, bu linki yanlış yerleştirdik veya var olmayan bir şeye işaret ediyor.
|
||||||
|
|
||||||
|
notification:
|
||||||
|
update_found: İçeriğin yeni bir sürümü mevcut.
|
||||||
|
update: Güncelle
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: Yazan
|
||||||
|
posted: Gönderilme Tarihi
|
||||||
|
updated: Güncellenme Tarihi
|
||||||
|
words: sözcük
|
||||||
|
pageview_measure: görüntülenme
|
||||||
|
read_time:
|
||||||
|
unit: dakikada
|
||||||
|
prompt: okunabilir
|
||||||
|
relate_posts: Benzer Gönderiler
|
||||||
|
share: Paylaş
|
||||||
|
button:
|
||||||
|
next: İleri
|
||||||
|
previous: Geri
|
||||||
|
copy_code:
|
||||||
|
succeed: Kopyalandı.
|
||||||
|
share_link:
|
||||||
|
title: Linki kopyala
|
||||||
|
succeed: Link kopyalandı.
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: Sabitlendi
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure: kategori
|
||||||
|
post_measure: gönderi
|
||||||
@@ -67,11 +67,18 @@ post:
|
|||||||
copy_code:
|
copy_code:
|
||||||
succeed: 已复制!
|
succeed: 已复制!
|
||||||
share_link:
|
share_link:
|
||||||
title: 分享链接
|
title: 分享链接
|
||||||
succeed: 链接已复制!
|
succeed: 链接已复制!
|
||||||
# pinned prompt of posts list on homepage
|
# pinned prompt of posts list on homepage
|
||||||
pin_prompt: 顶置
|
pin_prompt: 顶置
|
||||||
|
|
||||||
|
# Date time format.
|
||||||
|
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
|
||||||
|
df:
|
||||||
|
post:
|
||||||
|
strftime: '%Y/%m/%d'
|
||||||
|
dayjs: 'YYYY/MM/DD'
|
||||||
|
|
||||||
# categories page
|
# categories page
|
||||||
categories:
|
categories:
|
||||||
category_measure: 个分类
|
category_measure: 个分类
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Lazy loading */
|
/* Lazy loading */
|
||||||
|
|
||||||
var disqus_observer = new IntersectionObserver(function (entries) {
|
var disqus_observer = new IntersectionObserver(function (entries) {
|
||||||
if(entries[0].isIntersecting) {
|
if(entries[0].isIntersecting) {
|
||||||
(function () {
|
(function () {
|
||||||
@@ -32,23 +31,24 @@
|
|||||||
disqus_observer.observe(document.querySelector('#disqus_thread'));
|
disqus_observer.observe(document.querySelector('#disqus_thread'));
|
||||||
|
|
||||||
/* Auto switch theme */
|
/* Auto switch theme */
|
||||||
|
|
||||||
function reloadDisqus() {
|
function reloadDisqus() {
|
||||||
/* Disqus hasn't been loaded */
|
if (event.source === window && event.data &&
|
||||||
if (typeof DISQUS === "undefined") {
|
event.data.direction === ModeToggle.ID) {
|
||||||
return;
|
/* Disqus hasn't been loaded */
|
||||||
}
|
if (typeof DISQUS === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (document.readyState == 'complete') {
|
if (document.readyState == 'complete') {
|
||||||
DISQUS.reset({ reload: true, config: disqus_config });
|
DISQUS.reset({ reload: true, config: disqus_config });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const modeToggle = document.querySelector(".mode-toggle");
|
const modeToggle = document.querySelector(".mode-toggle");
|
||||||
|
|
||||||
if (typeof modeToggle !== "undefined") {
|
if (typeof modeToggle !== "undefined") {
|
||||||
/* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
|
window.addEventListener("message", reloadDisqus);
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"data-category": "{{ site.comments.giscus.category }}",
|
"data-category": "{{ site.comments.giscus.category }}",
|
||||||
"data-category-id": "{{ site.comments.giscus.category_id }}",
|
"data-category-id": "{{ site.comments.giscus.category_id }}",
|
||||||
"data-mapping": "{{ site.comments.giscus.mapping | default: 'pathname' }}",
|
"data-mapping": "{{ site.comments.giscus.mapping | default: 'pathname' }}",
|
||||||
"data-reactions-enabled": "1",
|
"data-reactions-enabled": "{{ site.comments.giscus.reactions_enabled | default: '1' }}",
|
||||||
"data-emit-metadata": "0",
|
"data-emit-metadata": "0",
|
||||||
"data-theme": initTheme,
|
"data-theme": initTheme,
|
||||||
"data-input-position": "{{ site.comments.giscus.input_position | default: 'bottom' }}",
|
"data-input-position": "{{ site.comments.giscus.input_position | default: 'bottom' }}",
|
||||||
|
|||||||
@@ -4,14 +4,8 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
{% assign wrap_elem = include.wrap | default: 'em' %}
|
{% assign wrap_elem = include.wrap | default: 'em' %}
|
||||||
|
{% assign df_strftime = site.data.locales[site.lang].df.post.strftime | default: '%d/%m/%Y' %}
|
||||||
{% if site.prefer_datetime_locale == 'en' or lang == 'en' %}
|
{% assign df_dayjs = site.data.locales[site.lang].df.post.dayjs | default: 'DD/MM/YYYY' %}
|
||||||
{% assign df_strftime = '%b %e, %Y' %}
|
|
||||||
{% assign df_dayjs = 'll' %}
|
|
||||||
{% else %}
|
|
||||||
{% assign df_strftime = '%F' %}
|
|
||||||
{% assign df_dayjs = 'YYYY-MM-DD' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<{{ wrap_elem }} class="{% if include.class %}{{ include.class }}{% endif %}"
|
<{{ wrap_elem }} class="{% if include.class %}{{ include.class }}{% endif %}"
|
||||||
data-ts="{{ include.date | date: '%s' }}"
|
data-ts="{{ include.date | date: '%s' }}"
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
<!-- The Footer -->
|
<!-- The Footer -->
|
||||||
|
|
||||||
<footer class="row pl-3 pr-3">
|
<footer>
|
||||||
<div class="col-12 d-flex justify-content-between align-items-center text-muted pl-0 pr-0">
|
<div class="container pl-lg-4 pr-lg-4">
|
||||||
<div class="footer-left">
|
<div class="d-flex justify-content-between align-items-center text-muted ml-md-3 mr-md-3">
|
||||||
<p class="mb-0">
|
<div class="footer-left">
|
||||||
© {{ 'now' | date: "%Y" }}
|
<p class="mb-0">
|
||||||
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
© {{ 'now' | date: "%Y" }}
|
||||||
{% if site.data.locales[lang].copyright.brief %}
|
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
||||||
<span data-toggle="tooltip" data-placement="top"
|
{% if site.data.locales[site.lang].copyright.brief %}
|
||||||
title="{{ site.data.locales[lang].copyright.verbose }}">{{ site.data.locales[lang].copyright.brief }}</span>
|
<span data-toggle="tooltip" data-placement="top"
|
||||||
{% endif %}
|
title="{{ site.data.locales[site.lang].copyright.verbose }}">{{ site.data.locales[site.lang].copyright.brief }}</span>
|
||||||
</p>
|
{% endif %}
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="footer-right">
|
<div class="footer-right">
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
{% capture _platform %}
|
|
||||||
|
{% capture _platform %}
|
||||||
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
|
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% capture _theme %}
|
{% capture _theme %}
|
||||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
|
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{{ site.data.locales[lang].meta
|
{{ site.data.locales[site.lang].meta
|
||||||
| default: 'Powered by :PLATFORM with :THEME theme.'
|
| default: 'Powered by :PLATFORM with :THEME theme.'
|
||||||
| replace: ':PLATFORM', _platform | replace: ':THEME', _theme
|
| replace: ':PLATFORM', _platform | replace: ':THEME', _theme
|
||||||
}}
|
}}
|
||||||
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -6,11 +6,6 @@
|
|||||||
<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">
|
||||||
|
|
||||||
<!-- Allow having a localized datetime different from the appearance language -->
|
|
||||||
{% if site.prefer_datetime_locale %}
|
|
||||||
<meta name="prefer-datetime-locale" content="{{ site.prefer_datetime_locale }}">
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||||
|
|
||||||
{% if site.google_analytics.pv.proxy_endpoint %}
|
{% if site.google_analytics.pv.proxy_endpoint %}
|
||||||
@@ -27,23 +22,22 @@
|
|||||||
{% seo title=false %}
|
{% seo title=false %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% if site.img_cdn and seo_tags contains 'og:image' %}
|
{% if page.image %}
|
||||||
{% assign properties = 'og:image,twitter:image' | split: ',' %}
|
{% assign img = page.image.path | default: page.image %}
|
||||||
|
{% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
|
||||||
|
{% capture target %}"{{ img | absolute_url }}"{% endcapture %}
|
||||||
|
|
||||||
{% for prop in properties %}
|
{% if site.img_cdn contains '//' %}
|
||||||
{% if site.img_cdn contains '//' %}
|
<!-- it's a cross-origin URL -->
|
||||||
<!-- `site.img_cdn` is a cross-origin URL -->
|
{% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
|
||||||
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{% endcapture %}
|
{% else %}
|
||||||
{% capture replacement %}<meta property="{{ prop }}" content="{{ site.img_cdn }}{% endcapture %}
|
<!-- it's a local file path -->
|
||||||
{% else %}
|
{%- capture replacement -%}
|
||||||
<!-- `site.img_cdn` is a local file path -->
|
"{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
|
||||||
{% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
{%- endcapture -%}
|
||||||
{% assign replacement = target | append: site.img_cdn %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ seo_tags }}
|
{{ seo_tags }}
|
||||||
|
|||||||
@@ -29,11 +29,7 @@
|
|||||||
or page.layout == 'category'
|
or page.layout == 'category'
|
||||||
or page.layout == 'tag' %}
|
or page.layout == 'tag' %}
|
||||||
|
|
||||||
{% if site.prefer_datetime_locale %}
|
{% assign locale = site.lang | split: '-' | first %}
|
||||||
{% assign locale = site.prefer_datetime_locale | downcase %}
|
|
||||||
{% else %}
|
|
||||||
{% assign locale = site.lang | split: '-' | first %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% assign _urls = site.data.assets[origin].dayjs.js.common
|
{% assign _urls = site.data.assets[origin].dayjs.js.common
|
||||||
| append: ',' | append: site.data.assets[origin].dayjs.js.locale
|
| append: ',' | append: site.data.assets[origin].dayjs.js.locale
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{% comment %}
|
|
||||||
Detect appearance language and return it through variable "lang"
|
|
||||||
{% endcomment %}
|
|
||||||
{% if site.data.locales[site.lang] %}
|
|
||||||
{% assign lang = site.lang %}
|
|
||||||
{% else %}
|
|
||||||
{% assign lang = 'en' %}
|
|
||||||
{% endif %}
|
|
||||||
@@ -5,10 +5,11 @@
|
|||||||
<script src="{{ site.data.assets[origin].mermaid.js | relative_url }}"></script>
|
<script src="{{ site.data.assets[origin].mermaid.js | relative_url }}"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
(function () {
|
||||||
|
|
||||||
function updateMermaid(event) {
|
function updateMermaid(event) {
|
||||||
if (event.source === window && event.data &&
|
if (event.source === window && event.data &&
|
||||||
event.data.direction === ModeToggle.ID) {
|
event.data.direction === ModeToggle.ID) {
|
||||||
|
|
||||||
const mode = event.data.message;
|
const mode = event.data.message;
|
||||||
|
|
||||||
@@ -16,11 +17,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let expectedTheme = (mode === ModeToggle.DARK_MODE? "dark" : "default");
|
let expectedTheme = (mode === ModeToggle.DARK_MODE ? "dark" : "default");
|
||||||
let config = { theme: expectedTheme };
|
let config = {theme: expectedTheme};
|
||||||
|
|
||||||
/* Re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
/* Re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
||||||
$(".mermaid").each(function() {
|
$(".mermaid").each(function () {
|
||||||
let svgCode = $(this).prev().children().html();
|
let svgCode = $(this).prev().children().html();
|
||||||
$(this).removeAttr("data-processed");
|
$(this).removeAttr("data-processed");
|
||||||
$(this).html(svgCode);
|
$(this).html(svgCode);
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
if ($("html[data-mode=dark]").length > 0
|
if ($("html[data-mode=dark]").length > 0
|
||||||
|| ($("html[data-mode]").length == 0
|
|| ($("html[data-mode]").length == 0
|
||||||
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
||||||
initTheme = "dark";
|
initTheme = "dark";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,15 +44,16 @@
|
|||||||
theme: initTheme /* <default|dark|forest|neutral> */
|
theme: initTheme /* <default|dark|forest|neutral> */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Markdown converts to HTML */
|
/* Create mermaid tag */
|
||||||
$("pre").has("code.language-mermaid").each(function() {
|
$("pre").has("code.language-mermaid").each(function () {
|
||||||
let svgCode = $(this).children().html();
|
let svgCode = $(this).children().html();
|
||||||
$(this).addClass("unloaded");
|
$(this).addClass("unloaded");
|
||||||
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
|
$(this).after(`<pre class=\"mermaid\">${svgCode}</pre>`);
|
||||||
});
|
});
|
||||||
|
|
||||||
mermaid.initialize(mermaidConf);
|
mermaid.initialize(mermaidConf);
|
||||||
|
|
||||||
window.addEventListener("message", updateMermaid);
|
window.addEventListener("message", updateMermaid);
|
||||||
});
|
})();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,24 +5,24 @@
|
|||||||
<div class="post-navigation d-flex justify-content-between">
|
<div class="post-navigation d-flex justify-content-between">
|
||||||
{% if page.previous.url %}
|
{% if page.previous.url %}
|
||||||
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
||||||
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
prompt="{{ site.data.locales[site.lang].post.button.previous }}">
|
||||||
<p>{{ page.previous.title }}</p>
|
<p>{{ page.previous.title }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="btn btn-outline-primary disabled"
|
<div class="btn btn-outline-primary disabled"
|
||||||
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
prompt="{{ site.data.locales[site.lang].post.button.previous }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.next.url %}
|
{% if page.next.url %}
|
||||||
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
||||||
prompt="{{ site.data.locales[lang].post.button.next }}">
|
prompt="{{ site.data.locales[site.lang].post.button.next }}">
|
||||||
<p>{{ page.next.title }}</p>
|
<p>{{ page.next.title }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="btn btn-outline-primary disabled"
|
<div class="btn btn-outline-primary disabled"
|
||||||
prompt="{{ site.data.locales[lang].post.button.next }}">
|
prompt="{{ site.data.locales[site.lang].post.button.next }}">
|
||||||
<p>-</p>
|
<p>-</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
The paginator for post list on HomgPage.
|
The paginator for post list on HomgPage.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ul class="pagination align-items-center mt-4 mb-5 pl-lg-2">
|
<ul class="pagination align-items-center mt-4 pl-lg-2">
|
||||||
<!-- left arrow -->
|
<!-- left arrow -->
|
||||||
{% if paginator.previous_page %}
|
{% if paginator.previous_page %}
|
||||||
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<div class="share-wrapper">
|
<div class="share-wrapper">
|
||||||
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
|
<span class="share-label text-muted mr-1">{{ site.data.locales[site.lang].post.share }}</span>
|
||||||
<span class="share-icons">
|
<span class="share-icons">
|
||||||
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
||||||
{% assign title = title | url_encode %}
|
{% assign title = title | url_encode %}
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
<i id="copy-link" class="fa-fw fas fa-link small"
|
<i id="copy-link" class="fa-fw fas fa-link small"
|
||||||
data-toggle="tooltip" data-placement="top"
|
data-toggle="tooltip" data-placement="top"
|
||||||
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
title="{{ site.data.locales[site.lang].post.button.share_link.title }}"
|
||||||
data-title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
data-title-succeed="{{ site.data.locales[site.lang].post.button.share_link.succeed }}">
|
||||||
</i>
|
</i>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
{% endunless %}
|
{% endunless %}
|
||||||
|
|
||||||
{% capture read_prompt %}
|
{% capture read_prompt %}
|
||||||
{{- site.data.locales[lang].post.read_time.prompt -}}
|
{{- site.data.locales[site.lang].post.read_time.prompt -}}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<!-- return element -->
|
<!-- return element -->
|
||||||
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
||||||
title="{{ words }} {{ site.data.locales[lang].post.words }}">
|
title="{{ words }} {{ site.data.locales[site.lang].post.words }}">
|
||||||
<em>{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}</em>
|
<em>{{- read_time -}}{{" "}}{{- site.data.locales[site.lang].post.read_time.unit -}}</em>
|
||||||
{%- if include.prompt -%}
|
{%- if include.prompt -%}
|
||||||
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
|
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
|
||||||
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
|
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
|
||||||
|
|||||||
@@ -31,11 +31,15 @@
|
|||||||
%}
|
%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Add attribute 'hide-bullet' to the checkbox list -->
|
<!-- Change the icon of checkbox -->
|
||||||
|
{% if _content contains '<input type="checkbox"' %}
|
||||||
{% if _content contains '<li class="task-list-item"><' %}
|
|
||||||
{% assign _content = _content
|
{% assign _content = _content
|
||||||
| replace: '"task-list-item"><', '"task-list-item" hide-bullet><'
|
| replace:
|
||||||
|
'<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" checked="checked" />',
|
||||||
|
'<i class="fas fa-check-circle fa-fw checked"></i>'
|
||||||
|
| replace:
|
||||||
|
'<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />',
|
||||||
|
'<i class="far fa-circle fa-fw"></i>'
|
||||||
%}
|
%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -103,13 +107,7 @@
|
|||||||
|
|
||||||
<!-- Add image path -->
|
<!-- Add image path -->
|
||||||
{% if page.img_path %}
|
{% if page.img_path %}
|
||||||
{% assign _path = page.img_path %}
|
{% assign _path = page.img_path | append: '/' | replace: '//', '/' %}
|
||||||
{% assign last_char = _path | slice: -1 %}
|
|
||||||
|
|
||||||
{% unless last_char == '/' %}
|
|
||||||
{% assign _path = _path | append: '/' %}
|
|
||||||
{% endunless %}
|
|
||||||
|
|
||||||
{% assign _src_prefix = _src_prefix | append: _path %}
|
{% assign _src_prefix = _src_prefix | append: _path %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -177,7 +175,7 @@
|
|||||||
| append: '<div class="code-header">'
|
| append: '<div class="code-header">'
|
||||||
| append: _label
|
| append: _label
|
||||||
| append: '<button aria-label="copy" data-title-succeed="'
|
| append: '<button aria-label="copy" data-title-succeed="'
|
||||||
| append: site.data.locales[lang].post.button.copy_code.succeed
|
| append: site.data.locales[site.lang].post.button.copy_code.succeed
|
||||||
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
||||||
| append: '<div class="highlight"><code>'
|
| append: '<div class="highlight"><code>'
|
||||||
%}
|
%}
|
||||||
@@ -214,7 +212,7 @@
|
|||||||
|
|
||||||
{% assign left = snippet | split: mark_end | first %}
|
{% assign left = snippet | split: mark_end | first %}
|
||||||
{% assign right = snippet | slice: left.size, snippet.size %}
|
{% assign right = snippet | slice: left.size, snippet.size %}
|
||||||
{% assign left = left | replace: '">', '"><span class="mr-2">' | append: '</span>' %}
|
{% assign left = left | replace_first: '">', '"><span class="mr-2">' | append: '</span>' %}
|
||||||
|
|
||||||
{% assign _new_content = _new_content | append: mark_start
|
{% assign _new_content = _new_content | append: mark_start
|
||||||
| append: left | append: anchor | append: right
|
| append: left | append: anchor | append: right
|
||||||
|
|||||||
@@ -76,9 +76,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if index_list.size > 0 %}
|
{% if index_list.size > 0 %}
|
||||||
<div id="related-posts" class="mt-5 mb-2 mb-sm-4">
|
<div id="related-posts" class="mb-2 mb-sm-4">
|
||||||
<h3 class="pt-2 mt-1 mb-4 ml-1"
|
<h3 class="pt-2 mb-4 ml-1"
|
||||||
data-toc-skip>{{ site.data.locales[lang].post.relate_posts }}</h3>
|
data-toc-skip>{{ site.data.locales[site.lang].post.relate_posts }}</h3>
|
||||||
<div class="card-deck mb-4">
|
<div class="card-deck mb-4">
|
||||||
{% for entry in index_list %}
|
{% for entry in index_list %}
|
||||||
{% assign index = entry | plus: 0 %}
|
{% assign index = entry | plus: 0 %}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
|
{% capture not_found %}<p class="mt-5">{{ site.data.locales[site.lang].search.no_results }}</p>{% endcapture %}
|
||||||
|
|
||||||
<script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
|
<script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<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>
|
||||||
<div class="site-subtitle font-italic">{{ site.tagline }}</div>
|
<div class="site-subtitle font-italic">{{ site.tagline }}</div>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
||||||
<a href="{{ '/' | relative_url }}" class="nav-link">
|
<a href="{{ '/' | relative_url }}" class="nav-link">
|
||||||
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
<span>{{ site.data.locales[lang].tabs.home | upcase }}</span>
|
<span>{{ site.data.locales[site.lang].tabs.home | upcase }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- the real tabs -->
|
<!-- the real tabs -->
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
||||||
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
|
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
|
||||||
|
|
||||||
<span>{{ site.data.locales[lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
|
<span>{{ site.data.locales[site.lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li> <!-- .nav-item -->
|
</li> <!-- .nav-item -->
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<script src="{{ site.data.assets[origin].bootstrap-toc.js | relative_url }}"></script>
|
<script src="{{ site.data.assets[origin].bootstrap-toc.js | relative_url }}"></script>
|
||||||
|
|
||||||
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
||||||
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>
|
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[site.lang].panel.toc -}}</div>
|
||||||
<nav id="toc" data-toggle="toc"></nav>
|
<nav id="toc" data-toggle="toc"></nav>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
{% if paths.size == 0 or page.layout == 'home' %}
|
{% if paths.size == 0 or page.layout == 'home' %}
|
||||||
<!-- index page -->
|
<!-- index page -->
|
||||||
<span>{{ site.data.locales[lang].tabs.home | capitalize }}</span>
|
<span>{{ site.data.locales[site.lang].tabs.home | capitalize }}</span>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
@@ -19,14 +19,14 @@
|
|||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ '/' | relative_url }}">
|
<a href="{{ '/' | relative_url }}">
|
||||||
{{ site.data.locales[lang].tabs.home | capitalize }}
|
{{ site.data.locales[site.lang].tabs.home | capitalize }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{% elsif forloop.last %}
|
{% elsif forloop.last %}
|
||||||
|
|
||||||
{% if page.collection == 'tabs' %}
|
{% if page.collection == 'tabs' %}
|
||||||
<span>{{ site.data.locales[lang].tabs[item] | default: page.title }}</span>
|
<span>{{ site.data.locales[site.lang].tabs[item] | default: page.title }}</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span>{{ page.title }}</span>
|
<span>{{ page.title }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ item | relative_url }}">
|
<a href="{{ item | relative_url }}">
|
||||||
{{ site.data.locales[lang].tabs[item] | default: page.title }}
|
{{ site.data.locales[site.lang].tabs[item] | default: page.title }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -49,12 +49,12 @@
|
|||||||
|
|
||||||
<div id="topbar-title">
|
<div id="topbar-title">
|
||||||
{% if page.layout == 'home' %}
|
{% if page.layout == 'home' %}
|
||||||
{{- site.data.locales[lang].title | default: site.title -}}
|
{{- site.data.locales[site.lang].title | default: site.title -}}
|
||||||
{% elsif page.collection == 'tabs' or page.layout == 'page' %}
|
{% elsif page.collection == 'tabs' or page.layout == 'page' %}
|
||||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
||||||
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
{{- site.data.locales[site.lang].tabs[tab_key] | default: page.title -}}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{- site.data.locales[lang].layout[page.layout] | default: page.layout | capitalize -}}
|
{{- site.data.locales[site.lang].layout[page.layout] | default: page.layout | capitalize -}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -62,9 +62,9 @@
|
|||||||
<span id="search-wrapper" class="align-items-center">
|
<span id="search-wrapper" class="align-items-center">
|
||||||
<i class="fas fa-search fa-fw"></i>
|
<i class="fas fa-search fa-fw"></i>
|
||||||
<input class="form-control" id="search-input" type="search"
|
<input class="form-control" id="search-input" type="search"
|
||||||
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[lang].search.hint | capitalize }}...">
|
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[site.lang].search.hint | capitalize }}...">
|
||||||
</span>
|
</span>
|
||||||
<span id="search-cancel" >{{ site.data.locales[lang].search.cancel }}</span>
|
<span id="search-cancel" >{{ site.data.locales[site.lang].search.cancel }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
{% if trending_tags.size > 0 %}
|
{% if trending_tags.size > 0 %}
|
||||||
<div id="access-tags">
|
<div id="access-tags">
|
||||||
<div class="panel-heading">{{- site.data.locales[lang].panel.trending_tags -}}</div>
|
<div class="panel-heading">{{- site.data.locales[site.lang].panel.trending_tags -}}</div>
|
||||||
<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_name in trending_tags %}
|
{% for tag_name in trending_tags %}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
{% if update_list.size > 0 %}
|
{% if update_list.size > 0 %}
|
||||||
|
|
||||||
<div id="access-lastmod" class="post">
|
<div id="access-lastmod" class="post">
|
||||||
<div class="panel-heading">{{- site.data.locales[lang].panel.lastmod -}}</div>
|
<div class="panel-heading">{{- site.data.locales[site.lang].panel.lastmod -}}</div>
|
||||||
<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 index = item | split: "::" | last | plus: 0 %}
|
{% assign index = item | split: "::" | last | plus: 0 %}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
/*
|
/**
|
||||||
Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
* Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
||||||
*/
|
*/
|
||||||
$(function() {
|
$(function() {
|
||||||
$(window).scroll(() => {
|
$(window).scroll(() => {
|
||||||
if ($(this).scrollTop() > 50 &&
|
if ($(this).scrollTop() > 50 &&
|
||||||
$("#sidebar-trigger").css("display") === "none") {
|
$("#sidebar-trigger").css("display") === "none") {
|
||||||
$("#back-to-top").fadeIn();
|
$("#back-to-top").fadeIn();
|
||||||
} else {
|
} else {
|
||||||
$("#back-to-top").fadeOut();
|
$("#back-to-top").fadeOut();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#back-to-top").click(() => {
|
$("#back-to-top").click(() => {
|
||||||
$("body,html").animate({
|
$("body,html").animate({
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}, 800);
|
}, 800);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/*
|
/**
|
||||||
* Listener for theme mode toggle
|
* Listener for theme mode toggle
|
||||||
*/
|
*/
|
||||||
$(function() {
|
$(function () {
|
||||||
$(".mode-toggle").click((e) => {
|
$(".mode-toggle").click((e) => {
|
||||||
const $target = $(e.target);
|
const $target = $(e.target);
|
||||||
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
|
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
|
||||||
$target : $target.parent());
|
$target : $target.parent());
|
||||||
|
|
||||||
$btn.blur(); // remove the clicking outline
|
$btn.blur(); // remove the clicking outline
|
||||||
flipMode();
|
flipMode();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,35 +2,37 @@
|
|||||||
* A tool for smooth scrolling and topbar switcher
|
* A tool for smooth scrolling and topbar switcher
|
||||||
*/
|
*/
|
||||||
const ScrollHelper = (function () {
|
const ScrollHelper = (function () {
|
||||||
const $body = $("body");
|
const $body = $("body");
|
||||||
const ATTR_TOPBAR_VISIBLE = "data-topbar-visible";
|
const ATTR_TOPBAR_VISIBLE = "data-topbar-visible";
|
||||||
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
||||||
|
|
||||||
let scrollUpCount = 0; // the number of times the scroll up was triggered by ToC or anchor
|
let scrollUpCount = 0; // the number of times the scroll up was triggered by ToC or anchor
|
||||||
let topbarLocked = false;
|
let topbarLocked = false;
|
||||||
let orientationLocked = false;
|
let orientationLocked = false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hideTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, false),
|
hideTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, false),
|
||||||
showTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, true),
|
showTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, true),
|
||||||
|
|
||||||
// scroll up
|
// scroll up
|
||||||
|
|
||||||
addScrollUpTask: () => {
|
addScrollUpTask: () => {
|
||||||
scrollUpCount += 1;
|
scrollUpCount += 1;
|
||||||
if (!topbarLocked) { topbarLocked = true; }
|
if (!topbarLocked) {
|
||||||
},
|
topbarLocked = true;
|
||||||
popScrollUpTask: () => scrollUpCount -= 1,
|
}
|
||||||
hasScrollUpTask: () => scrollUpCount > 0,
|
},
|
||||||
topbarLocked: () => topbarLocked === true,
|
popScrollUpTask: () => scrollUpCount -= 1,
|
||||||
unlockTopbar: () => topbarLocked = false,
|
hasScrollUpTask: () => scrollUpCount > 0,
|
||||||
getTopbarHeight: () => topbarHeight,
|
topbarLocked: () => topbarLocked === true,
|
||||||
|
unlockTopbar: () => topbarLocked = false,
|
||||||
|
getTopbarHeight: () => topbarHeight,
|
||||||
|
|
||||||
// orientation change
|
// orientation change
|
||||||
|
|
||||||
orientationLocked: () => orientationLocked === true,
|
orientationLocked: () => orientationLocked === true,
|
||||||
lockOrientation: () => orientationLocked = true,
|
lockOrientation: () => orientationLocked = true,
|
||||||
unLockOrientation: () => orientationLocked = false
|
unLockOrientation: () => orientationLocked = false
|
||||||
};
|
};
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -1,129 +1,129 @@
|
|||||||
/*
|
/**
|
||||||
* This script make #search-result-wrapper switch to unloaded or shown automatically.
|
* This script make #search-result-wrapper switch to unloaded or shown automatically.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
const btnSbTrigger = $("#sidebar-trigger");
|
const btnSbTrigger = $("#sidebar-trigger");
|
||||||
const btnSearchTrigger = $("#search-trigger");
|
const btnSearchTrigger = $("#search-trigger");
|
||||||
const btnCancel = $("#search-cancel");
|
const btnCancel = $("#search-cancel");
|
||||||
const main = $("#main");
|
const main = $("#main");
|
||||||
const topbarTitle = $("#topbar-title");
|
const topbarTitle = $("#topbar-title");
|
||||||
const searchWrapper = $("#search-wrapper");
|
const searchWrapper = $("#search-wrapper");
|
||||||
const resultWrapper = $("#search-result-wrapper");
|
const resultWrapper = $("#search-result-wrapper");
|
||||||
const results = $("#search-results");
|
const results = $("#search-results");
|
||||||
const input = $("#search-input");
|
const input = $("#search-input");
|
||||||
const hints = $("#search-hints");
|
const hints = $("#search-hints");
|
||||||
|
|
||||||
const scrollBlocker = (function () {
|
const scrollBlocker = (function () {
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
return {
|
return {
|
||||||
block() {
|
block() {
|
||||||
offset = window.scrollY;
|
offset = window.scrollY;
|
||||||
$("html,body").scrollTop(0);
|
$("html,body").scrollTop(0);
|
||||||
},
|
},
|
||||||
release() {
|
release() {
|
||||||
$("html,body").scrollTop(offset);
|
$("html,body").scrollTop(offset);
|
||||||
},
|
},
|
||||||
getOffset() {
|
getOffset() {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--- Actions in mobile screens (Sidebar hidden) ---*/
|
/*--- Actions in mobile screens (Sidebar hidden) ---*/
|
||||||
|
|
||||||
const mobileSearchBar = (function () {
|
const mobileSearchBar = (function () {
|
||||||
return {
|
return {
|
||||||
on() {
|
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() {
|
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");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
const resultSwitch = (function () {
|
const resultSwitch = (function () {
|
||||||
let visible = false;
|
let visible = false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
on() {
|
on() {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
// the block method must be called before $(#main) unloaded.
|
// the block method must be called before $(#main) unloaded.
|
||||||
scrollBlocker.block();
|
scrollBlocker.block();
|
||||||
resultWrapper.removeClass("unloaded");
|
resultWrapper.removeClass("unloaded");
|
||||||
main.addClass("unloaded");
|
main.addClass("unloaded");
|
||||||
visible = true;
|
visible = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
off() {
|
off() {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
results.empty();
|
results.empty();
|
||||||
if (hints.hasClass("unloaded")) {
|
if (hints.hasClass("unloaded")) {
|
||||||
hints.removeClass("unloaded");
|
hints.removeClass("unloaded");
|
||||||
}
|
}
|
||||||
resultWrapper.addClass("unloaded");
|
resultWrapper.addClass("unloaded");
|
||||||
main.removeClass("unloaded");
|
main.removeClass("unloaded");
|
||||||
|
|
||||||
// now the release method must be called after $(#main) display
|
// now the release method must be called after $(#main) display
|
||||||
scrollBlocker.release();
|
scrollBlocker.release();
|
||||||
|
|
||||||
input.val("");
|
input.val("");
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isVisible() {
|
isVisible() {
|
||||||
return visible;
|
return visible;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
function isMobileView() {
|
function isMobileView() {
|
||||||
return btnCancel.hasClass("loaded");
|
return btnCancel.hasClass("loaded");
|
||||||
}
|
|
||||||
|
|
||||||
btnSearchTrigger.click(function() {
|
|
||||||
mobileSearchBar.on();
|
|
||||||
resultSwitch.on();
|
|
||||||
input.focus();
|
|
||||||
});
|
|
||||||
|
|
||||||
btnCancel.click(function() {
|
|
||||||
mobileSearchBar.off();
|
|
||||||
resultSwitch.off();
|
|
||||||
});
|
|
||||||
|
|
||||||
input.focus(function() {
|
|
||||||
searchWrapper.addClass("input-focus");
|
|
||||||
});
|
|
||||||
|
|
||||||
input.focusout(function() {
|
|
||||||
searchWrapper.removeClass("input-focus");
|
|
||||||
});
|
|
||||||
|
|
||||||
input.on("input", () => {
|
|
||||||
if (input.val() === "") {
|
|
||||||
if (isMobileView()) {
|
|
||||||
hints.removeClass("unloaded");
|
|
||||||
} else {
|
|
||||||
resultSwitch.off();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
resultSwitch.on();
|
|
||||||
if (isMobileView()) {
|
|
||||||
hints.addClass("unloaded");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
btnSearchTrigger.click(function () {
|
||||||
|
mobileSearchBar.on();
|
||||||
|
resultSwitch.on();
|
||||||
|
input.focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
btnCancel.click(function () {
|
||||||
|
mobileSearchBar.off();
|
||||||
|
resultSwitch.off();
|
||||||
|
});
|
||||||
|
|
||||||
|
input.focus(function () {
|
||||||
|
searchWrapper.addClass("input-focus");
|
||||||
|
});
|
||||||
|
|
||||||
|
input.focusout(function () {
|
||||||
|
searchWrapper.removeClass("input-focus");
|
||||||
|
});
|
||||||
|
|
||||||
|
input.on("input", () => {
|
||||||
|
if (input.val() === "") {
|
||||||
|
if (isMobileView()) {
|
||||||
|
hints.removeClass("unloaded");
|
||||||
|
} else {
|
||||||
|
resultSwitch.off();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
resultSwitch.on();
|
||||||
|
if (isMobileView()) {
|
||||||
|
hints.addClass("unloaded");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,29 +2,27 @@
|
|||||||
* Expand or close the sidebar in mobile screens.
|
* Expand or close the sidebar in mobile screens.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
|
const sidebarUtil = (function () {
|
||||||
|
const ATTR_DISPLAY = "sidebar-display";
|
||||||
|
let isExpanded = false;
|
||||||
|
const body = $("body");
|
||||||
|
|
||||||
const sidebarUtil = (function () {
|
return {
|
||||||
const ATTR_DISPLAY = "sidebar-display";
|
toggle() {
|
||||||
let isExpanded = false;
|
if (isExpanded === false) {
|
||||||
const body = $("body");
|
body.attr(ATTR_DISPLAY, "");
|
||||||
|
} else {
|
||||||
|
body.removeAttr(ATTR_DISPLAY);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
isExpanded = !isExpanded;
|
||||||
toggle() {
|
}
|
||||||
if (isExpanded === false) {
|
};
|
||||||
body.attr(ATTR_DISPLAY, "");
|
|
||||||
} else {
|
|
||||||
body.removeAttr(ATTR_DISPLAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
isExpanded = !isExpanded;
|
}());
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}());
|
$("#sidebar-trigger").click(sidebarUtil.toggle);
|
||||||
|
|
||||||
$("#sidebar-trigger").click(sidebarUtil.toggle);
|
|
||||||
|
|
||||||
$("#mask").click(sidebarUtil.toggle);
|
|
||||||
|
|
||||||
|
$("#mask").click(sidebarUtil.toggle);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Initial Bootstrap Tooltip.
|
* Initial Bootstrap Tooltip.
|
||||||
*/
|
*/
|
||||||
$(function () {
|
$(function () {
|
||||||
$("[data-toggle=\"tooltip\"]").tooltip();
|
$("[data-toggle=\"tooltip\"]").tooltip();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,90 +1,89 @@
|
|||||||
/*
|
/**
|
||||||
* Hide Header on scroll down
|
* Hide Header on scroll down
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
const $searchInput = $("#search-input");
|
const $searchInput = $("#search-input");
|
||||||
const delta = ScrollHelper.getTopbarHeight();
|
const delta = ScrollHelper.getTopbarHeight();
|
||||||
|
|
||||||
let didScroll;
|
let didScroll;
|
||||||
let lastScrollTop = 0;
|
let lastScrollTop = 0;
|
||||||
|
|
||||||
function hasScrolled() {
|
function hasScrolled() {
|
||||||
let st = $(this).scrollTop();
|
let st = $(this).scrollTop();
|
||||||
|
|
||||||
/* Make sure they scroll more than delta */
|
/* Make sure they scroll more than delta */
|
||||||
if (Math.abs(lastScrollTop - st) <= delta) {
|
if (Math.abs(lastScrollTop - st) <= delta) {
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (st > lastScrollTop ) { // Scroll Down
|
|
||||||
ScrollHelper.hideTopbar();
|
|
||||||
|
|
||||||
if ($searchInput.is(":focus")) {
|
|
||||||
$searchInput.blur(); /* remove focus */
|
|
||||||
}
|
|
||||||
|
|
||||||
} else { // Scroll up
|
|
||||||
// has not yet scrolled to the bottom of the screen, that is, there is still space for scrolling
|
|
||||||
if (st + $(window).height() < $(document).height()) {
|
|
||||||
|
|
||||||
if (ScrollHelper.hasScrollUpTask()) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ScrollHelper.topbarLocked()) { // avoid redundant scroll up event from smooth scrolling
|
if (st > lastScrollTop) { // Scroll Down
|
||||||
ScrollHelper.unlockTopbar();
|
ScrollHelper.hideTopbar();
|
||||||
} else {
|
|
||||||
if (ScrollHelper.orientationLocked()) { // avoid device auto scroll up on orientation change
|
if ($searchInput.is(":focus")) {
|
||||||
ScrollHelper.unLockOrientation();
|
$searchInput.blur(); /* remove focus */
|
||||||
} else {
|
}
|
||||||
ScrollHelper.showTopbar();
|
|
||||||
}
|
} else { // Scroll up
|
||||||
|
// has not yet scrolled to the bottom of the screen, that is, there is still space for scrolling
|
||||||
|
if (st + $(window).height() < $(document).height()) {
|
||||||
|
|
||||||
|
if (ScrollHelper.hasScrollUpTask()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ScrollHelper.topbarLocked()) { // avoid redundant scroll up event from smooth scrolling
|
||||||
|
ScrollHelper.unlockTopbar();
|
||||||
|
} else {
|
||||||
|
if (ScrollHelper.orientationLocked()) { // avoid device auto scroll up on orientation change
|
||||||
|
ScrollHelper.unLockOrientation();
|
||||||
|
} else {
|
||||||
|
ScrollHelper.showTopbar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
lastScrollTop = st;
|
||||||
|
|
||||||
|
} // hasScrolled()
|
||||||
|
|
||||||
|
function handleLandscape() {
|
||||||
|
if ($(window).scrollTop() === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ScrollHelper.lockOrientation();
|
||||||
|
ScrollHelper.hideTopbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
lastScrollTop = st;
|
if (screen.orientation) {
|
||||||
|
screen.orientation.onchange = () => {
|
||||||
|
const type = screen.orientation.type;
|
||||||
|
if (type === "landscape-primary" || type === "landscape-secondary") {
|
||||||
|
handleLandscape();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // hasScrolled()
|
} else {
|
||||||
|
// for the browsers that not support `window.screen.orientation` API
|
||||||
function handleLandscape() {
|
$(window).on("orientationchange", () => {
|
||||||
if ($(window).scrollTop() === 0) {
|
if ($(window).width() < $(window).height()) { // before rotating, it is still in portrait mode.
|
||||||
return;
|
handleLandscape();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
ScrollHelper.lockOrientation();
|
|
||||||
ScrollHelper.hideTopbar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (screen.orientation) {
|
$(window).scroll(() => {
|
||||||
screen.orientation.onchange = () => {
|
if (didScroll) {
|
||||||
const type = screen.orientation.type;
|
return;
|
||||||
if (type === "landscape-primary" || type === "landscape-secondary") {
|
}
|
||||||
handleLandscape();
|
didScroll = true;
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// for the browsers that not support `window.screen.orientation` API
|
|
||||||
$(window).on("orientationchange",() => {
|
|
||||||
if ($(window).width() < $(window).height()) { // before rotating, it is still in portrait mode.
|
|
||||||
handleLandscape();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
$(window).scroll(() => {
|
|
||||||
if (didScroll) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
didScroll = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
if (didScroll) {
|
|
||||||
hasScrolled();
|
|
||||||
didScroll = false;
|
|
||||||
}
|
|
||||||
}, 250);
|
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
if (didScroll) {
|
||||||
|
hasScrolled();
|
||||||
|
didScroll = false;
|
||||||
|
}
|
||||||
|
}, 250);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,67 +1,67 @@
|
|||||||
/*
|
/**
|
||||||
* Top bar title auto change while scrolling up/down in mobile screens.
|
* Top bar title auto change while scrolling up/down in mobile screens.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
const titleSelector = "div.post>h1:first-of-type";
|
const titleSelector = "div.post>h1:first-of-type";
|
||||||
const $pageTitle = $(titleSelector);
|
const $pageTitle = $(titleSelector);
|
||||||
const $topbarTitle = $("#topbar-title");
|
const $topbarTitle = $("#topbar-title");
|
||||||
|
|
||||||
if ($pageTitle.length === 0 /* on Home page */
|
if ($pageTitle.length === 0 /* on Home page */
|
||||||
|| $pageTitle.hasClass("dynamic-title")
|
|| $pageTitle.hasClass("dynamic-title")
|
||||||
|| $topbarTitle.is(":hidden")) {/* not in mobile views */
|
|| $topbarTitle.is(":hidden")) {/* not in mobile views */
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const defaultTitleText = $topbarTitle.text().trim();
|
|
||||||
let pageTitleText = $pageTitle.text().trim();
|
|
||||||
let hasScrolled = false;
|
|
||||||
let lastScrollTop = 0;
|
|
||||||
|
|
||||||
if ($("#page-category").length || $("#page-tag").length) {
|
|
||||||
/* The title in Category or Tag page will be "<title> <count_of_posts>" */
|
|
||||||
if (/\s/.test(pageTitleText)) {
|
|
||||||
pageTitleText = pageTitleText.replace(/[0-9]/g, "").trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// When the page is scrolled down and then refreshed, the topbar title needs to be initialized
|
|
||||||
if ($pageTitle.offset().top < $(window).scrollTop()) {
|
|
||||||
$topbarTitle.text(pageTitleText);
|
|
||||||
}
|
|
||||||
|
|
||||||
let options = {
|
|
||||||
rootMargin: '-48px 0px 0px 0px', // 48px equals to the topbar height (3rem)
|
|
||||||
threshold: [0, 1]
|
|
||||||
};
|
|
||||||
|
|
||||||
let observer = new IntersectionObserver((entries) => {
|
|
||||||
if (!hasScrolled) {
|
|
||||||
hasScrolled = true;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let curScrollTop = $(window).scrollTop();
|
const defaultTitleText = $topbarTitle.text().trim();
|
||||||
let isScrollDown = lastScrollTop < curScrollTop;
|
let pageTitleText = $pageTitle.text().trim();
|
||||||
lastScrollTop = curScrollTop;
|
let hasScrolled = false;
|
||||||
let heading = entries[0];
|
let lastScrollTop = 0;
|
||||||
|
|
||||||
if (isScrollDown) {
|
if ($("#page-category").length || $("#page-tag").length) {
|
||||||
if (heading.intersectionRatio === 0) {
|
/* The title in Category or Tag page will be "<title> <count_of_posts>" */
|
||||||
|
if (/\s/.test(pageTitleText)) {
|
||||||
|
pageTitleText = pageTitleText.replace(/[0-9]/g, "").trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// When the page is scrolled down and then refreshed, the topbar title needs to be initialized
|
||||||
|
if ($pageTitle.offset().top < $(window).scrollTop()) {
|
||||||
$topbarTitle.text(pageTitleText);
|
$topbarTitle.text(pageTitleText);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (heading.intersectionRatio === 1) {
|
|
||||||
$topbarTitle.text(defaultTitleText);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, options);
|
|
||||||
|
|
||||||
observer.observe(document.querySelector(titleSelector));
|
let options = {
|
||||||
|
rootMargin: '-48px 0px 0px 0px', // 48px equals to the topbar height (3rem)
|
||||||
|
threshold: [0, 1]
|
||||||
|
};
|
||||||
|
|
||||||
/* Click title will scroll to top */
|
let observer = new IntersectionObserver((entries) => {
|
||||||
$topbarTitle.click(function() {
|
if (!hasScrolled) {
|
||||||
$("body,html").animate({scrollTop: 0}, 800);
|
hasScrolled = true;
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let curScrollTop = $(window).scrollTop();
|
||||||
|
let isScrollDown = lastScrollTop < curScrollTop;
|
||||||
|
lastScrollTop = curScrollTop;
|
||||||
|
let heading = entries[0];
|
||||||
|
|
||||||
|
if (isScrollDown) {
|
||||||
|
if (heading.intersectionRatio === 0) {
|
||||||
|
$topbarTitle.text(pageTitleText);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (heading.intersectionRatio === 1) {
|
||||||
|
$topbarTitle.text(defaultTitleText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
observer.observe(document.querySelector(titleSelector));
|
||||||
|
|
||||||
|
/* Click title will scroll to top */
|
||||||
|
$topbarTitle.click(function () {
|
||||||
|
$("body,html").animate({scrollTop: 0}, 800);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
/*
|
/**
|
||||||
* Tab 'Categories' expand/close effect.
|
* Tab 'Categories' expand/close effect.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
const childPrefix = "l_";
|
const childPrefix = "l_";
|
||||||
const parentPrefix = "h_";
|
const parentPrefix = "h_";
|
||||||
const collapse = $(".collapse");
|
const collapse = $(".collapse");
|
||||||
|
|
||||||
/* 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. */
|
||||||
const parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
const parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
||||||
if (parentId) {
|
if (parentId) {
|
||||||
$(`#${parentId} .far.fa-folder-open`).attr("class", "far fa-folder fa-fw");
|
$(`#${parentId} .far.fa-folder-open`).attr("class", "far fa-folder fa-fw");
|
||||||
$(`#${parentId} i.fas`).addClass("rotate");
|
$(`#${parentId} i.fas`).addClass("rotate");
|
||||||
$(`#${parentId}`).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 () {
|
||||||
const parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
const parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
||||||
if (parentId) {
|
if (parentId) {
|
||||||
$(`#${parentId} .far.fa-folder`).attr("class", "far fa-folder-open fa-fw");
|
$(`#${parentId} .far.fa-folder`).attr("class", "far fa-folder-open fa-fw");
|
||||||
$(`#${parentId} i.fas`).removeClass("rotate");
|
$(`#${parentId} i.fas`).removeClass("rotate");
|
||||||
$(`#${parentId}`).addClass("hide-border-bottom");
|
$(`#${parentId}`).addClass("hide-border-bottom");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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,4 +1,4 @@
|
|||||||
/*
|
/**
|
||||||
* Clipboard functions
|
* Clipboard functions
|
||||||
*
|
*
|
||||||
* Dependencies:
|
* Dependencies:
|
||||||
@@ -6,128 +6,128 @@
|
|||||||
* - clipboard.js (https://github.com/zenorocha/clipboard.js)
|
* - clipboard.js (https://github.com/zenorocha/clipboard.js)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
const btnSelector = '.code-header>button';
|
const btnSelector = '.code-header>button';
|
||||||
const ICON_SUCCESS = 'fas fa-check';
|
const ICON_SUCCESS = 'fas fa-check';
|
||||||
const ATTR_TIMEOUT = 'timeout';
|
const ATTR_TIMEOUT = 'timeout';
|
||||||
const ATTR_TITLE_SUCCEED = 'data-title-succeed';
|
const ATTR_TITLE_SUCCEED = 'data-title-succeed';
|
||||||
const ATTR_TITLE_ORIGIN = 'data-original-title';
|
const ATTR_TITLE_ORIGIN = 'data-original-title';
|
||||||
const TIMEOUT = 2000; // in milliseconds
|
const TIMEOUT = 2000; // in milliseconds
|
||||||
|
|
||||||
function isLocked(node) {
|
function isLocked(node) {
|
||||||
if ($(node)[0].hasAttribute(ATTR_TIMEOUT)) {
|
if ($(node)[0].hasAttribute(ATTR_TIMEOUT)) {
|
||||||
let timeout = $(node).attr(ATTR_TIMEOUT);
|
let timeout = $(node).attr(ATTR_TIMEOUT);
|
||||||
if (Number(timeout) > Date.now()) {
|
if (Number(timeout) > Date.now()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
function lock(node) {
|
|
||||||
$(node).attr(ATTR_TIMEOUT, Date.now() + TIMEOUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
function unlock(node) {
|
|
||||||
$(node).removeAttr(ATTR_TIMEOUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Copy code block --- */
|
|
||||||
|
|
||||||
// Initial the clipboard.js object
|
|
||||||
const clipboard = new ClipboardJS(btnSelector, {
|
|
||||||
target(trigger) {
|
|
||||||
let codeBlock = trigger.parentNode.nextElementSibling;
|
|
||||||
return codeBlock.querySelector('code .rouge-code');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(btnSelector).tooltip({
|
|
||||||
trigger: 'hover',
|
|
||||||
placement: 'left'
|
|
||||||
});
|
|
||||||
|
|
||||||
function getIcon(btn) {
|
|
||||||
let iconNode = $(btn).children();
|
|
||||||
return iconNode.attr('class');
|
|
||||||
}
|
|
||||||
|
|
||||||
const ICON_DEFAULT = getIcon(btnSelector);
|
|
||||||
|
|
||||||
function showTooltip(btn) {
|
|
||||||
const succeedTitle = $(btn).attr(ATTR_TITLE_SUCCEED);
|
|
||||||
$(btn).attr(ATTR_TITLE_ORIGIN, succeedTitle).tooltip('show');
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideTooltip(btn) {
|
|
||||||
$(btn).tooltip('hide').removeAttr(ATTR_TITLE_ORIGIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSuccessIcon(btn) {
|
|
||||||
let btnNode = $(btn);
|
|
||||||
let iconNode = btnNode.children();
|
|
||||||
iconNode.attr('class', ICON_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resumeIcon(btn) {
|
|
||||||
let btnNode = $(btn);
|
|
||||||
let iconNode = btnNode.children();
|
|
||||||
iconNode.attr('class', ICON_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
clipboard.on('success', (e) => {
|
|
||||||
e.clearSelection();
|
|
||||||
|
|
||||||
const trigger = e.trigger;
|
|
||||||
if (isLocked(trigger)) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setSuccessIcon(trigger);
|
function lock(node) {
|
||||||
showTooltip(trigger);
|
$(node).attr(ATTR_TIMEOUT, Date.now() + TIMEOUT);
|
||||||
lock(trigger);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
hideTooltip(trigger);
|
|
||||||
resumeIcon(trigger);
|
|
||||||
unlock(trigger);
|
|
||||||
}, TIMEOUT);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
/* --- Post link sharing --- */
|
|
||||||
|
|
||||||
$('#copy-link').click((e) => {
|
|
||||||
|
|
||||||
let target = $(e.target);
|
|
||||||
|
|
||||||
if (isLocked(target)) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy URL to clipboard
|
function unlock(node) {
|
||||||
|
$(node).removeAttr(ATTR_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
const url = window.location.href;
|
/* --- Copy code block --- */
|
||||||
const $temp = $("<input>");
|
|
||||||
|
|
||||||
$("body").append($temp);
|
// Initial the clipboard.js object
|
||||||
$temp.val(url).select();
|
const clipboard = new ClipboardJS(btnSelector, {
|
||||||
document.execCommand("copy");
|
target(trigger) {
|
||||||
$temp.remove();
|
let codeBlock = trigger.parentNode.nextElementSibling;
|
||||||
|
return codeBlock.querySelector('code .rouge-code');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Switch tooltip title
|
$(btnSelector).tooltip({
|
||||||
|
trigger: 'hover',
|
||||||
|
placement: 'left'
|
||||||
|
});
|
||||||
|
|
||||||
const defaultTitle = target.attr(ATTR_TITLE_ORIGIN);
|
function getIcon(btn) {
|
||||||
const succeedTitle = target.attr(ATTR_TITLE_SUCCEED);
|
let iconNode = $(btn).children();
|
||||||
|
return iconNode.attr('class');
|
||||||
|
}
|
||||||
|
|
||||||
target.attr(ATTR_TITLE_ORIGIN, succeedTitle).tooltip('show');
|
const ICON_DEFAULT = getIcon(btnSelector);
|
||||||
lock(target);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
function showTooltip(btn) {
|
||||||
target.attr(ATTR_TITLE_ORIGIN, defaultTitle);
|
const succeedTitle = $(btn).attr(ATTR_TITLE_SUCCEED);
|
||||||
unlock(target);
|
$(btn).attr(ATTR_TITLE_ORIGIN, succeedTitle).tooltip('show');
|
||||||
}, TIMEOUT);
|
}
|
||||||
|
|
||||||
});
|
function hideTooltip(btn) {
|
||||||
|
$(btn).tooltip('hide').removeAttr(ATTR_TITLE_ORIGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSuccessIcon(btn) {
|
||||||
|
let btnNode = $(btn);
|
||||||
|
let iconNode = btnNode.children();
|
||||||
|
iconNode.attr('class', ICON_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
function resumeIcon(btn) {
|
||||||
|
let btnNode = $(btn);
|
||||||
|
let iconNode = btnNode.children();
|
||||||
|
iconNode.attr('class', ICON_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
clipboard.on('success', (e) => {
|
||||||
|
e.clearSelection();
|
||||||
|
|
||||||
|
const trigger = e.trigger;
|
||||||
|
if (isLocked(trigger)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSuccessIcon(trigger);
|
||||||
|
showTooltip(trigger);
|
||||||
|
lock(trigger);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
hideTooltip(trigger);
|
||||||
|
resumeIcon(trigger);
|
||||||
|
unlock(trigger);
|
||||||
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/* --- Post link sharing --- */
|
||||||
|
|
||||||
|
$('#copy-link').click((e) => {
|
||||||
|
|
||||||
|
let target = $(e.target);
|
||||||
|
|
||||||
|
if (isLocked(target)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy URL to clipboard
|
||||||
|
|
||||||
|
const url = window.location.href;
|
||||||
|
const $temp = $("<input>");
|
||||||
|
|
||||||
|
$("body").append($temp);
|
||||||
|
$temp.val(url).select();
|
||||||
|
document.execCommand("copy");
|
||||||
|
$temp.remove();
|
||||||
|
|
||||||
|
// Switch tooltip title
|
||||||
|
|
||||||
|
const defaultTitle = target.attr(ATTR_TITLE_ORIGIN);
|
||||||
|
const succeedTitle = target.attr(ATTR_TITLE_SUCCEED);
|
||||||
|
|
||||||
|
target.attr(ATTR_TITLE_ORIGIN, succeedTitle).tooltip('show');
|
||||||
|
lock(target);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
target.attr(ATTR_TITLE_ORIGIN, defaultTitle);
|
||||||
|
unlock(target);
|
||||||
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,47 +1,46 @@
|
|||||||
/**
|
/**
|
||||||
Lazy load images (https://github.com/ApoorvSaxena/lozad.js)
|
Lazy load images (https://github.com/ApoorvSaxena/lozad.js)
|
||||||
and popup when clicked (https://github.com/dimsemenov/Magnific-Popup)
|
and popup when clicked (https://github.com/dimsemenov/Magnific-Popup)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
|
const IMG_SCOPE = '#main > div.row:first-child > div:first-child';
|
||||||
|
|
||||||
const IMG_SCOPE = '#main > div.row:first-child > div:first-child';
|
if ($(`${IMG_SCOPE} img`).length <= 0) {
|
||||||
|
return;
|
||||||
if ($(`${IMG_SCOPE} img`).length <= 0 ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* lazy loading */
|
|
||||||
|
|
||||||
const imgList = document.querySelectorAll(`${IMG_SCOPE} img[data-src]`);
|
|
||||||
const observer = lozad(imgList);
|
|
||||||
observer.observe();
|
|
||||||
|
|
||||||
/* popup */
|
|
||||||
|
|
||||||
$(`${IMG_SCOPE} p > img[data-src],${IMG_SCOPE} img[data-src].preview-img`).each(
|
|
||||||
function() {
|
|
||||||
let nextTag = $(this).next();
|
|
||||||
const title = nextTag.prop('tagName') === 'EM' ? nextTag.text() : '';
|
|
||||||
const src = $(this).attr('data-src'); // created by lozad.js
|
|
||||||
|
|
||||||
$(this).wrap(`<a href="${src}" title="${title}" class="popup"></a>`);
|
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
$('.popup').magnificPopup({
|
/* lazy loading */
|
||||||
type: 'image',
|
|
||||||
closeOnContentClick: true,
|
|
||||||
showCloseBtn: false,
|
|
||||||
zoom: {
|
|
||||||
enabled: true,
|
|
||||||
duration: 300,
|
|
||||||
easing: 'ease-in-out'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* markup the image links */
|
const imgList = document.querySelectorAll(`${IMG_SCOPE} img[data-src]`);
|
||||||
|
const observer = lozad(imgList);
|
||||||
|
observer.observe();
|
||||||
|
|
||||||
$(`${IMG_SCOPE} a`).has('img').addClass('img-link');
|
/* popup */
|
||||||
|
|
||||||
|
$(`${IMG_SCOPE} p > img[data-src], ${IMG_SCOPE} img[data-src].preview-img`).each(
|
||||||
|
function () {
|
||||||
|
let nextTag = $(this).next();
|
||||||
|
const title = nextTag.prop('tagName') === 'EM' ? nextTag.text() : '';
|
||||||
|
const src = $(this).attr('data-src'); // created by lozad.js
|
||||||
|
|
||||||
|
$(this).wrap(`<a href="${src}" title="${title}" class="popup"></a>`);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$('.popup').magnificPopup({
|
||||||
|
type: 'image',
|
||||||
|
closeOnContentClick: true,
|
||||||
|
showCloseBtn: false,
|
||||||
|
zoom: {
|
||||||
|
enabled: true,
|
||||||
|
duration: 300,
|
||||||
|
easing: 'ease-in-out'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/* markup the image links */
|
||||||
|
|
||||||
|
$(`${IMG_SCOPE} a`).has('img').addClass('img-link');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,40 +6,38 @@
|
|||||||
|
|
||||||
/* A tool for locale datetime */
|
/* A tool for locale datetime */
|
||||||
const LocaleHelper = (function () {
|
const LocaleHelper = (function () {
|
||||||
const $preferLocale = $('meta[name="prefer-datetime-locale"]');
|
const locale = $('html').attr('lang').substr(0, 2);
|
||||||
const locale = $preferLocale.length > 0 ?
|
const attrTimestamp = 'data-ts';
|
||||||
$preferLocale.attr('content').toLowerCase() : $('html').attr('lang').substr(0, 2);
|
const attrDateFormat = 'data-df';
|
||||||
const attrTimestamp = 'data-ts';
|
|
||||||
const attrDateFormat = 'data-df';
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
locale: () => locale,
|
locale: () => locale,
|
||||||
attrTimestamp: () => attrTimestamp,
|
attrTimestamp: () => attrTimestamp,
|
||||||
attrDateFormat: () => attrDateFormat,
|
attrDateFormat: () => attrDateFormat,
|
||||||
getTimestamp: ($elem) => Number($elem.attr(attrTimestamp)), // unix timestamp
|
getTimestamp: ($elem) => Number($elem.attr(attrTimestamp)), // unix timestamp
|
||||||
getDateFormat: ($elem) => $elem.attr(attrDateFormat)
|
getDateFormat: ($elem) => $elem.attr(attrDateFormat)
|
||||||
};
|
};
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
dayjs.locale(LocaleHelper.locale());
|
dayjs.locale(LocaleHelper.locale());
|
||||||
dayjs.extend(window.dayjs_plugin_localizedFormat);
|
dayjs.extend(window.dayjs_plugin_localizedFormat);
|
||||||
|
|
||||||
$(`[${LocaleHelper.attrTimestamp()}]`).each(function () {
|
$(`[${LocaleHelper.attrTimestamp()}]`).each(function () {
|
||||||
const date = dayjs.unix(LocaleHelper.getTimestamp($(this)));
|
const date = dayjs.unix(LocaleHelper.getTimestamp($(this)));
|
||||||
const text = date.format(LocaleHelper.getDateFormat($(this)));
|
const text = date.format(LocaleHelper.getDateFormat($(this)));
|
||||||
$(this).text(text);
|
$(this).text(text);
|
||||||
$(this).removeAttr(LocaleHelper.attrTimestamp());
|
$(this).removeAttr(LocaleHelper.attrTimestamp());
|
||||||
$(this).removeAttr(LocaleHelper.attrDateFormat());
|
$(this).removeAttr(LocaleHelper.attrDateFormat());
|
||||||
|
|
||||||
// setup tooltips
|
// setup tooltips
|
||||||
const tooltip = $(this).attr('data-toggle');
|
const tooltip = $(this).attr('data-toggle');
|
||||||
if (typeof tooltip === 'undefined' || tooltip !== 'tooltip') {
|
if (typeof tooltip === 'undefined' || tooltip !== 'tooltip') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooltipText = date.format('llll'); // see: https://day.js.org/docs/en/display/format#list-of-localized-formats
|
const tooltipText = date.format('llll'); // see: https://day.js.org/docs/en/display/format#list-of-localized-formats
|
||||||
$(this).attr('data-original-title', tooltipText);
|
$(this).attr('data-original-title', tooltipText);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/**
|
||||||
* Count page views form GA or local cache file.
|
* Count page views form GA or local cache file.
|
||||||
*
|
*
|
||||||
* Dependencies:
|
* Dependencies:
|
||||||
@@ -7,244 +7,244 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const getInitStatus = (function () {
|
const getInitStatus = (function () {
|
||||||
let hasInit = false;
|
let hasInit = false;
|
||||||
return () => {
|
return () => {
|
||||||
let ret = hasInit;
|
let ret = hasInit;
|
||||||
if (!hasInit) {
|
if (!hasInit) {
|
||||||
hasInit = true;
|
hasInit = true;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
const PvOpts = (function () {
|
const PvOpts = (function () {
|
||||||
function getContent(selector) {
|
function getContent(selector) {
|
||||||
return $(selector).attr("content");
|
return $(selector).attr("content");
|
||||||
}
|
|
||||||
|
|
||||||
function hasContent(selector) {
|
|
||||||
let content = getContent(selector);
|
|
||||||
return (typeof content !== "undefined" && content !== false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
getProxyMeta() {
|
|
||||||
return getContent("meta[name=pv-proxy-endpoint]");
|
|
||||||
},
|
|
||||||
getLocalMeta() {
|
|
||||||
return getContent("meta[name=pv-cache-path]");
|
|
||||||
},
|
|
||||||
hasProxyMeta() {
|
|
||||||
return hasContent("meta[name=pv-proxy-endpoint]");
|
|
||||||
},
|
|
||||||
hasLocalMeta() {
|
|
||||||
return hasContent("meta[name=pv-cache-path]");
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
function hasContent(selector) {
|
||||||
|
let content = getContent(selector);
|
||||||
|
return (typeof content !== "undefined" && content !== false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
getProxyMeta() {
|
||||||
|
return getContent("meta[name=pv-proxy-endpoint]");
|
||||||
|
},
|
||||||
|
getLocalMeta() {
|
||||||
|
return getContent("meta[name=pv-cache-path]");
|
||||||
|
},
|
||||||
|
hasProxyMeta() {
|
||||||
|
return hasContent("meta[name=pv-proxy-endpoint]");
|
||||||
|
},
|
||||||
|
hasLocalMeta() {
|
||||||
|
return hasContent("meta[name=pv-cache-path]");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
const PvStorage = (function () {
|
const PvStorage = (function () {
|
||||||
const Keys = {
|
const Keys = {
|
||||||
KEY_PV: "pv",
|
KEY_PV: "pv",
|
||||||
KEY_PV_SRC: "pv_src",
|
KEY_PV_SRC: "pv_src",
|
||||||
KEY_CREATION: "pv_created_date"
|
KEY_CREATION: "pv_created_date"
|
||||||
};
|
};
|
||||||
|
|
||||||
const Source = {
|
const Source = {
|
||||||
LOCAL: "same-origin",
|
LOCAL: "same-origin",
|
||||||
PROXY: "cors"
|
PROXY: "cors"
|
||||||
};
|
};
|
||||||
|
|
||||||
function get(key) {
|
function get(key) {
|
||||||
return localStorage.getItem(key);
|
return localStorage.getItem(key);
|
||||||
}
|
|
||||||
|
|
||||||
function set(key, val) {
|
|
||||||
localStorage.setItem(key, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveCache(pv, src) {
|
|
||||||
set(Keys.KEY_PV, pv);
|
|
||||||
set(Keys.KEY_PV_SRC, src);
|
|
||||||
set(Keys.KEY_CREATION, new Date().toJSON());
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
keysCount() {
|
|
||||||
return Object.keys(Keys).length;
|
|
||||||
},
|
|
||||||
hasCache() {
|
|
||||||
return (localStorage.getItem(Keys.KEY_PV) !== null);
|
|
||||||
},
|
|
||||||
getCache() {
|
|
||||||
return JSON.parse(localStorage.getItem(Keys.KEY_PV));
|
|
||||||
},
|
|
||||||
saveLocalCache(pv) {
|
|
||||||
saveCache(pv, Source.LOCAL);
|
|
||||||
},
|
|
||||||
saveProxyCache(pv) {
|
|
||||||
saveCache(pv, Source.PROXY);
|
|
||||||
},
|
|
||||||
isExpired() {
|
|
||||||
let date = new Date(get(Keys.KEY_CREATION));
|
|
||||||
date.setHours(date.getHours() + 1); // per hour
|
|
||||||
return Date.now() >= date.getTime();
|
|
||||||
},
|
|
||||||
isFromLocal() {
|
|
||||||
return get(Keys.KEY_PV_SRC) === Source.LOCAL;
|
|
||||||
},
|
|
||||||
isFromProxy() {
|
|
||||||
return get(Keys.KEY_PV_SRC) === Source.PROXY;
|
|
||||||
},
|
|
||||||
newerThan(pv) {
|
|
||||||
return PvStorage.getCache().totalsForAllResults["ga:pageviews"] > pv.totalsForAllResults["ga:pageviews"];
|
|
||||||
},
|
|
||||||
inspectKeys() {
|
|
||||||
if (localStorage.length !== PvStorage.keysCount()) {
|
|
||||||
localStorage.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let i = 0; i < localStorage.length; i++){
|
|
||||||
const key = localStorage.key(i);
|
|
||||||
switch (key) {
|
|
||||||
case Keys.KEY_PV:
|
|
||||||
case Keys.KEY_PV_SRC:
|
|
||||||
case Keys.KEY_CREATION:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
localStorage.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
function set(key, val) {
|
||||||
|
localStorage.setItem(key, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveCache(pv, src) {
|
||||||
|
set(Keys.KEY_PV, pv);
|
||||||
|
set(Keys.KEY_PV_SRC, src);
|
||||||
|
set(Keys.KEY_CREATION, new Date().toJSON());
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
keysCount() {
|
||||||
|
return Object.keys(Keys).length;
|
||||||
|
},
|
||||||
|
hasCache() {
|
||||||
|
return (localStorage.getItem(Keys.KEY_PV) !== null);
|
||||||
|
},
|
||||||
|
getCache() {
|
||||||
|
return JSON.parse(localStorage.getItem(Keys.KEY_PV));
|
||||||
|
},
|
||||||
|
saveLocalCache(pv) {
|
||||||
|
saveCache(pv, Source.LOCAL);
|
||||||
|
},
|
||||||
|
saveProxyCache(pv) {
|
||||||
|
saveCache(pv, Source.PROXY);
|
||||||
|
},
|
||||||
|
isExpired() {
|
||||||
|
let date = new Date(get(Keys.KEY_CREATION));
|
||||||
|
date.setHours(date.getHours() + 1); // per hour
|
||||||
|
return Date.now() >= date.getTime();
|
||||||
|
},
|
||||||
|
isFromLocal() {
|
||||||
|
return get(Keys.KEY_PV_SRC) === Source.LOCAL;
|
||||||
|
},
|
||||||
|
isFromProxy() {
|
||||||
|
return get(Keys.KEY_PV_SRC) === Source.PROXY;
|
||||||
|
},
|
||||||
|
newerThan(pv) {
|
||||||
|
return PvStorage.getCache().totalsForAllResults["ga:pageviews"] > pv.totalsForAllResults["ga:pageviews"];
|
||||||
|
},
|
||||||
|
inspectKeys() {
|
||||||
|
if (localStorage.length !== PvStorage.keysCount()) {
|
||||||
|
localStorage.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < localStorage.length; i++) {
|
||||||
|
const key = localStorage.key(i);
|
||||||
|
switch (key) {
|
||||||
|
case Keys.KEY_PV:
|
||||||
|
case Keys.KEY_PV_SRC:
|
||||||
|
case Keys.KEY_CREATION:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
localStorage.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}()); /* PvStorage */
|
}()); /* PvStorage */
|
||||||
|
|
||||||
function countUp(min, max, destId) {
|
function countUp(min, max, destId) {
|
||||||
if (min < max) {
|
if (min < max) {
|
||||||
let numAnim = new CountUp(destId, min, max);
|
let numAnim = new CountUp(destId, min, max);
|
||||||
if (!numAnim.error) {
|
if (!numAnim.error) {
|
||||||
numAnim.start();
|
numAnim.start();
|
||||||
} else {
|
} else {
|
||||||
console.error(numAnim.error);
|
console.error(numAnim.error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function countPV(path, rows) {
|
function countPV(path, rows) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
if (typeof rows !== "undefined" ) {
|
if (typeof rows !== "undefined") {
|
||||||
for (let i = 0; i < rows.length; ++i) {
|
for (let i = 0; i < rows.length; ++i) {
|
||||||
const gaPath = rows[parseInt(i, 10)][0];
|
const gaPath = rows[parseInt(i, 10)][0];
|
||||||
if (gaPath === path) { /* path format see: site.permalink */
|
if (gaPath === path) { /* path format see: site.permalink */
|
||||||
count += parseInt(rows[parseInt(i, 10)][1], 10);
|
count += parseInt(rows[parseInt(i, 10)][1], 10);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
function tacklePV(rows, path, elem, hasInit) {
|
function tacklePV(rows, path, elem, hasInit) {
|
||||||
let count = countPV(path, rows);
|
let count = countPV(path, rows);
|
||||||
count = (count === 0 ? 1 : count);
|
count = (count === 0 ? 1 : count);
|
||||||
|
|
||||||
if (!hasInit) {
|
if (!hasInit) {
|
||||||
elem.text(new Intl.NumberFormat().format(count));
|
elem.text(new Intl.NumberFormat().format(count));
|
||||||
} else {
|
} else {
|
||||||
const initCount = parseInt(elem.text().replace(/,/g, ""), 10);
|
const initCount = parseInt(elem.text().replace(/,/g, ""), 10);
|
||||||
if (count > initCount) {
|
if (count > initCount) {
|
||||||
countUp(initCount, count, elem.attr("id"));
|
countUp(initCount, count, elem.attr("id"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayPageviews(data) {
|
function displayPageviews(data) {
|
||||||
if (typeof data === "undefined") {
|
if (typeof data === "undefined") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let hasInit = getInitStatus();
|
let hasInit = getInitStatus();
|
||||||
const rows = data.rows; /* could be undefined */
|
const rows = data.rows; /* could be undefined */
|
||||||
|
|
||||||
if ($("#post-list").length > 0) { /* the Home page */
|
if ($("#post-list").length > 0) { /* the Home page */
|
||||||
$(".post-preview").each(function() {
|
$(".post-preview").each(function () {
|
||||||
const path = $(this).find("a").attr("href");
|
const path = $(this).find("a").attr("href");
|
||||||
tacklePV(rows, path, $(this).find(".pageviews"), hasInit);
|
tacklePV(rows, path, $(this).find(".pageviews"), hasInit);
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if ($(".post").length > 0) { /* the post */
|
} else if ($(".post").length > 0) { /* the post */
|
||||||
const path = window.location.pathname;
|
const path = window.location.pathname;
|
||||||
tacklePV(rows, path, $("#pv"), hasInit);
|
tacklePV(rows, path, $("#pv"), hasInit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchProxyPageviews() {
|
function fetchProxyPageviews() {
|
||||||
if (PvOpts.hasProxyMeta()) {
|
if (PvOpts.hasProxyMeta()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: PvOpts.getProxyMeta(),
|
url: PvOpts.getProxyMeta(),
|
||||||
dataType: "jsonp",
|
dataType: "jsonp",
|
||||||
jsonpCallback: "displayPageviews",
|
jsonpCallback: "displayPageviews",
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
PvStorage.saveProxyCache(JSON.stringify(data));
|
PvStorage.saveProxyCache(JSON.stringify(data));
|
||||||
},
|
},
|
||||||
error: (jqXHR, textStatus, errorThrown) => {
|
error: (jqXHR, textStatus, errorThrown) => {
|
||||||
console.log("Failed to load pageviews from proxy server: " + errorThrown);
|
console.log("Failed to load pageviews from proxy server: " + errorThrown);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchLocalPageviews(hasCache = false) {
|
function fetchLocalPageviews(hasCache = false) {
|
||||||
return fetch(PvOpts.getLocalMeta())
|
return fetch(PvOpts.getLocalMeta())
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (hasCache) {
|
if (hasCache) {
|
||||||
// The cache from the proxy will sometimes be more recent than the local one
|
// The cache from the proxy will sometimes be more recent than the local one
|
||||||
if (PvStorage.isFromProxy() && PvStorage.newerThan(data)) {
|
if (PvStorage.isFromProxy() && PvStorage.newerThan(data)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
displayPageviews(data);
|
displayPageviews(data);
|
||||||
PvStorage.saveLocalCache(JSON.stringify(data));
|
PvStorage.saveLocalCache(JSON.stringify(data));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
if ($(".pageviews").length <= 0) {
|
if ($(".pageviews").length <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
PvStorage.inspectKeys();
|
|
||||||
|
|
||||||
if (PvStorage.hasCache()) {
|
|
||||||
displayPageviews(PvStorage.getCache());
|
|
||||||
|
|
||||||
if (PvStorage.isExpired()) {
|
|
||||||
if (PvOpts.hasLocalMeta()) {
|
|
||||||
fetchLocalPageviews(true).then(fetchProxyPageviews);
|
|
||||||
} else {
|
|
||||||
fetchProxyPageviews();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (PvStorage.isFromLocal()) {
|
|
||||||
fetchProxyPageviews();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // no cached
|
PvStorage.inspectKeys();
|
||||||
|
|
||||||
if (PvOpts.hasLocalMeta()) {
|
if (PvStorage.hasCache()) {
|
||||||
fetchLocalPageviews().then(fetchProxyPageviews);
|
displayPageviews(PvStorage.getCache());
|
||||||
} else {
|
|
||||||
fetchProxyPageviews();
|
if (PvStorage.isExpired()) {
|
||||||
|
if (PvOpts.hasLocalMeta()) {
|
||||||
|
fetchLocalPageviews(true).then(fetchProxyPageviews);
|
||||||
|
} else {
|
||||||
|
fetchProxyPageviews();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (PvStorage.isFromLocal()) {
|
||||||
|
fetchProxyPageviews();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else { // no cached
|
||||||
|
|
||||||
|
if (PvOpts.hasLocalMeta()) {
|
||||||
|
fetchLocalPageviews().then(fetchProxyPageviews);
|
||||||
|
} else {
|
||||||
|
fetchProxyPageviews();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,96 +1,96 @@
|
|||||||
/*
|
/**
|
||||||
Safari doesn't support CSS `scroll-behavior: smooth`,
|
Safari doesn't support CSS `scroll-behavior: smooth`,
|
||||||
so here is a compatible solution for all browser to smooth scrolling
|
so here is a compatible solution for all browser to smooth scrolling
|
||||||
|
|
||||||
See: <https://css-tricks.com/snippets/jquery/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.
|
Warning: It must be called after all `<a>` tags (e.g., the dynamic TOC) are ready.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
const $topbarTitle = $("#topbar-title");
|
const $topbarTitle = $("#topbar-title");
|
||||||
const REM = 16; // in pixels
|
const REM = 16; // in pixels
|
||||||
const ATTR_SCROLL_FOCUS = "scroll-focus";
|
const ATTR_SCROLL_FOCUS = "scroll-focus";
|
||||||
|
|
||||||
$("a[href*='#']")
|
$("a[href*='#']")
|
||||||
.not("[href='#']")
|
.not("[href='#']")
|
||||||
.not("[href='#0']")
|
.not("[href='#0']")
|
||||||
.click(function(event) {
|
.click(function (event) {
|
||||||
if (this.pathname.replace(/^\//, "") !==
|
if (this.pathname.replace(/^\//, "") !==
|
||||||
location.pathname.replace(/^\//, "")) {
|
location.pathname.replace(/^\//, "")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location.hostname !== this.hostname) {
|
if (location.hostname !== this.hostname) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hash = decodeURI(this.hash);
|
const hash = decodeURI(this.hash);
|
||||||
let toFootnoteRef = RegExp(/^#fnref:/).test(hash);
|
let toFootnoteRef = RegExp(/^#fnref:/).test(hash);
|
||||||
let toFootnote = toFootnoteRef ? false : RegExp(/^#fn:/).test(hash);
|
let toFootnote = toFootnoteRef ? false : RegExp(/^#fn:/).test(hash);
|
||||||
let selector = hash.includes(":") ? hash.replace(/\:/g, "\\:") : hash;
|
let selector = hash.includes(":") ? hash.replace(/:/g, "\\:") : hash;
|
||||||
let $target = $(selector);
|
let $target = $(selector);
|
||||||
|
|
||||||
let isMobileViews = $topbarTitle.is(":visible");
|
let isMobileViews = $topbarTitle.is(":visible");
|
||||||
let isPortrait = $(window).width() < $(window).height();
|
let isPortrait = $(window).width() < $(window).height();
|
||||||
|
|
||||||
if (typeof $target === "undefined") {
|
if (typeof $target === "undefined") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if (history.pushState) { /* add hash to URL */
|
if (history.pushState) { /* add hash to URL */
|
||||||
history.pushState(null, null, hash);
|
history.pushState(null, null, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
let curOffset = $(window).scrollTop();
|
let curOffset = $(window).scrollTop();
|
||||||
let destOffset = $target.offset().top -= REM / 2;
|
let destOffset = $target.offset().top -= REM / 2;
|
||||||
|
|
||||||
if (destOffset < curOffset) { // scroll up
|
if (destOffset < curOffset) { // scroll up
|
||||||
ScrollHelper.hideTopbar();
|
ScrollHelper.hideTopbar();
|
||||||
ScrollHelper.addScrollUpTask();
|
ScrollHelper.addScrollUpTask();
|
||||||
|
|
||||||
if (isMobileViews && isPortrait) {
|
if (isMobileViews && isPortrait) {
|
||||||
destOffset -= ScrollHelper.getTopbarHeight();
|
destOffset -= ScrollHelper.getTopbarHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // scroll down
|
} else { // scroll down
|
||||||
if (isMobileViews && isPortrait) {
|
if (isMobileViews && isPortrait) {
|
||||||
destOffset -= ScrollHelper.getTopbarHeight();
|
destOffset -= ScrollHelper.getTopbarHeight();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("html").animate({
|
$("html").animate({
|
||||||
scrollTop: destOffset
|
scrollTop: destOffset
|
||||||
}, 500, () => {
|
}, 500, () => {
|
||||||
$target.focus();
|
$target.focus();
|
||||||
|
|
||||||
/* clean up old scroll mark */
|
/* clean up old scroll mark */
|
||||||
if ($(`[${ATTR_SCROLL_FOCUS}=true]`).length) {
|
if ($(`[${ATTR_SCROLL_FOCUS}=true]`).length) {
|
||||||
$(`[${ATTR_SCROLL_FOCUS}=true]`).attr(ATTR_SCROLL_FOCUS, false);
|
$(`[${ATTR_SCROLL_FOCUS}=true]`).attr(ATTR_SCROLL_FOCUS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clean :target links */
|
/* Clean :target links */
|
||||||
if ($(":target").length) { /* element that visited by the URL with hash */
|
if ($(":target").length) { /* element that visited by the URL with hash */
|
||||||
$(":target").attr(ATTR_SCROLL_FOCUS, false);
|
$(":target").attr(ATTR_SCROLL_FOCUS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set scroll mark to footnotes */
|
/* set scroll mark to footnotes */
|
||||||
if (toFootnote || toFootnoteRef) {
|
if (toFootnote || toFootnoteRef) {
|
||||||
$target.attr(ATTR_SCROLL_FOCUS, true);
|
$target.attr(ATTR_SCROLL_FOCUS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($target.is(":focus")) { /* Checking if the target was focused */
|
if ($target.is(":focus")) { /* Checking if the target was focused */
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
||||||
$target.focus(); /* Set focus again */
|
$target.focus(); /* Set focus again */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ScrollHelper.hasScrollUpTask()) {
|
if (ScrollHelper.hasScrollUpTask()) {
|
||||||
ScrollHelper.popScrollUpTask();
|
ScrollHelper.popScrollUpTask();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}); /* click() */
|
}); /* click() */
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,46 +3,32 @@ layout: page
|
|||||||
# The Archives of posts.
|
# The Archives of posts.
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
{% assign df_strftime_m = site.data.locales[site.lang].df.archives.strftime | default: '/ %m' %}
|
||||||
|
{% assign df_dayjs_m = site.data.locales[site.lang].df.archives.dayjs | default: '/ MM' %}
|
||||||
|
|
||||||
{% if site.prefer_datetime_locale == 'en' or lang == 'en' %}
|
<div id="archives" class="pl-xl-3">
|
||||||
{% assign df_strftime_m = '%b' %}
|
|
||||||
{% assign df_dayjs_m = 'MMM' %}
|
|
||||||
{% else %}
|
|
||||||
{% assign df_strftime_m = '/ %m' %}
|
|
||||||
{% assign df_dayjs_m = '/ MM' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<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 cur_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
||||||
{% capture pre_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
|
|
||||||
{% if forloop.first %}
|
{% if cur_year != last_year %}
|
||||||
{% assign last_day = "" %}
|
{% unless forloop.first %}</ul>{% endunless %}
|
||||||
{% assign last_month = "" %}
|
<div class="year lead">{{ cur_year }}</div>
|
||||||
<span class="lead">{{this_year}}</span>
|
<ul class="list-unstyled">
|
||||||
<ul class="list-unstyled">
|
{% assign last_year = cur_year %}
|
||||||
{% endif %}
|
|
||||||
<li>
|
|
||||||
<div>
|
|
||||||
{% assign ts = post.date | date: '%s' %}
|
|
||||||
<span class="date day" data-ts="{{ ts }}" data-df="DD">
|
|
||||||
{{ post.date | date: "%d" }}
|
|
||||||
</span>
|
|
||||||
<span class="date month small text-muted" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">
|
|
||||||
{{ post.date | date: df_strftime_m }}
|
|
||||||
</span>
|
|
||||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{% if forloop.last %}
|
|
||||||
</ul>
|
|
||||||
{% elsif this_year != pre_year %}
|
|
||||||
</ul>
|
|
||||||
<span class="lead">{{pre_year}}</span>
|
|
||||||
<ul class="list-unstyled">
|
|
||||||
{% assign last_day = "" %}
|
|
||||||
{% assign last_month = "" %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<li>
|
||||||
|
{% assign ts = post.date | date: '%s' %}
|
||||||
|
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: "%d" }}</span>
|
||||||
|
<span class="date month small text-muted ml-1" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">
|
||||||
|
{{ post.date | date: df_strftime_m }}
|
||||||
|
</span>
|
||||||
|
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if forloop.last %}</ul>{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ layout: page
|
|||||||
# All the Categories of posts
|
# All the Categories of posts
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
{% assign HEAD_PREFIX = "h_" %}
|
{% assign HEAD_PREFIX = "h_" %}
|
||||||
{% assign LIST_PREFIX = "l_" %}
|
{% assign LIST_PREFIX = "l_" %}
|
||||||
|
|
||||||
@@ -48,22 +46,22 @@ layout: page
|
|||||||
{% if sub_categories_size > 0 %}
|
{% if sub_categories_size > 0 %}
|
||||||
{{ sub_categories_size }}
|
{{ sub_categories_size }}
|
||||||
{% if sub_categories_size > 1 %}
|
{% if sub_categories_size > 1 %}
|
||||||
{{ site.data.locales[lang].categories.category_measure.plural
|
{{ site.data.locales[site.lang].categories.category_measure.plural
|
||||||
| default: site.data.locales[lang].categories.category_measure }}
|
| default: site.data.locales[site.lang].categories.category_measure }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ site.data.locales[lang].categories.category_measure.singular
|
{{ site.data.locales[site.lang].categories.category_measure.singular
|
||||||
| default: site.data.locales[lang].categories.category_measure }}
|
| default: site.data.locales[site.lang].categories.category_measure }}
|
||||||
{% endif %},
|
{% endif %},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ top_posts_size }}
|
{{ top_posts_size }}
|
||||||
|
|
||||||
{% if top_posts_size > 1 %}
|
{% if top_posts_size > 1 %}
|
||||||
{{ site.data.locales[lang].categories.post_measure.plural
|
{{ site.data.locales[site.lang].categories.post_measure.plural
|
||||||
| default: site.data.locales[lang].categories.post_measure }}
|
| default: site.data.locales[site.lang].categories.post_measure }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ site.data.locales[lang].categories.post_measure.singular
|
{{ site.data.locales[site.lang].categories.post_measure.singular
|
||||||
| default: site.data.locales[lang].categories.post_measure }}
|
| default: site.data.locales[site.lang].categories.post_measure }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -99,11 +97,11 @@ layout: page
|
|||||||
{{ posts_size }}
|
{{ posts_size }}
|
||||||
|
|
||||||
{% if posts_size > 1 %}
|
{% if posts_size > 1 %}
|
||||||
{{ site.data.locales[lang].categories.post_measure.plural
|
{{ site.data.locales[site.lang].categories.post_measure.plural
|
||||||
| default: site.data.locales[lang].categories.post_measure }}
|
| default: site.data.locales[site.lang].categories.post_measure }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ site.data.locales[lang].categories.post_measure.singular
|
{{ site.data.locales[site.lang].categories.post_measure.singular
|
||||||
| default: site.data.locales[lang].categories.post_measure }}
|
| default: site.data.locales[site.lang].categories.post_measure }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ layout: page
|
|||||||
# The Category layout
|
# The Category layout
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
<div id="page-category">
|
<div id="page-category">
|
||||||
<h1 class="pl-lg-2">
|
<h1 class="pl-lg-2">
|
||||||
<i class="far fa-folder-open fa-fw text-muted"></i>
|
<i class="far fa-folder-open fa-fw text-muted"></i>
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ layout: compress
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
{% include assets-origin.html %}
|
{% include assets-origin.html %}
|
||||||
|
|
||||||
{% capture prefer_mode %}
|
{% capture prefer_mode %}
|
||||||
@@ -15,7 +13,8 @@ layout: compress
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<html lang="{{ site.lang }}"{{ prefer_mode }}>
|
<!-- `site.alt_lang` can specify a language different from the UI -->
|
||||||
|
<html lang="{{ site.alt_lang | default: site.lang }}"{{ prefer_mode }}>
|
||||||
|
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
|
|
||||||
@@ -27,17 +26,15 @@ layout: compress
|
|||||||
|
|
||||||
<div id="main-wrapper" class="d-flex justify-content-center">
|
<div id="main-wrapper" class="d-flex justify-content-center">
|
||||||
<div id="main" class="container pl-xl-4 pr-xl-4">
|
<div id="main" class="container pl-xl-4 pr-xl-4">
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
|
||||||
{% include footer.html %}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include search-results.html %}
|
{% include search-results.html %}
|
||||||
|
|
||||||
</div> <!-- #main-wrapper -->
|
</div> <!-- #main-wrapper -->
|
||||||
|
|
||||||
|
{% include footer.html %}
|
||||||
|
|
||||||
{% if page.mermaid %}
|
{% if page.mermaid %}
|
||||||
{% include mermaid.html %}
|
{% include mermaid.html %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -57,9 +54,9 @@ layout: compress
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toast-body text-center pt-0">
|
<div class="toast-body text-center pt-0">
|
||||||
<p class="pl-2 pr-2 mb-3">{{ site.data.locales[lang].notification.update_found }}</p>
|
<p class="pl-2 pr-2 mb-3">{{ site.data.locales[site.lang].notification.update_found }}</p>
|
||||||
<button type="button" class="btn btn-primary" aria-label="Update">
|
<button type="button" class="btn btn-primary" aria-label="Update">
|
||||||
{{ site.data.locales[lang].notification.update }}
|
{{ site.data.locales[site.lang].notification.update }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ layout: page
|
|||||||
# The Home page layout
|
# The Home page layout
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
{% assign pinned = site.posts | where: "pin", "true" %}
|
{% assign pinned = site.posts | where: "pin", "true" %}
|
||||||
{% assign default = site.posts | where_exp: "item", "item.pin != true and item.hidden != true" %}
|
{% assign default = site.posts | where_exp: "item", "item.pin != true and item.hidden != true" %}
|
||||||
|
|
||||||
@@ -79,7 +77,7 @@ layout: page
|
|||||||
{% if post.pin %}
|
{% if post.pin %}
|
||||||
<div class="pin">
|
<div class="pin">
|
||||||
<i class="fas fa-thumbtack fa-fw"></i>
|
<i class="fas fa-thumbtack fa-fw"></i>
|
||||||
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
|
<span>{{ site.data.locales[site.lang].post.pin_prompt }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
{% include assets-origin.html %}
|
{% include assets-origin.html %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -20,8 +18,9 @@ layout: default
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% if page.layout == 'page' or page.collection == 'tabs'%}
|
{% if page.layout == 'page' or page.collection == 'tabs' %}
|
||||||
{% assign title = site.data.locales[lang].tabs[tab_key] | default: page.title %}
|
{% assign tab_key = page.title | downcase %}
|
||||||
|
{% assign title = site.data.locales[site.lang].tabs[tab_key] | default: page.title %}
|
||||||
<h1 class="dynamic-title">
|
<h1 class="dynamic-title">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</h1>
|
</h1>
|
||||||
@@ -35,7 +34,7 @@ layout: default
|
|||||||
</div>
|
</div>
|
||||||
</div> <!-- #core-wrapper -->
|
</div> <!-- #core-wrapper -->
|
||||||
|
|
||||||
<!-- pannel -->
|
<!-- panel -->
|
||||||
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted">
|
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted">
|
||||||
|
|
||||||
<div class="access">
|
<div class="access">
|
||||||
@@ -43,7 +42,7 @@ layout: default
|
|||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% for _include in layout.pannel_includes %}
|
{% for _include in layout.panel_includes %}
|
||||||
{% assign _include_path = _include | append: '.html' %}
|
{% assign _include_path = _include | append: '.html' %}
|
||||||
{% include {{ _include_path }} %}
|
{% include {{ _include_path }} %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -54,7 +53,7 @@ layout: default
|
|||||||
<!-- tail -->
|
<!-- tail -->
|
||||||
{% if layout.tail_includes %}
|
{% if layout.tail_includes %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 pl-3 pr-3 pr-xl-4">
|
<div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 pl-3 pr-3 pr-xl-4 mt-5">
|
||||||
{% for _include in layout.tail_includes %}
|
{% for _include in layout.tail_includes %}
|
||||||
{% assign _include_path = _include | append: '.html' %}
|
{% assign _include_path = _include | append: '.html' %}
|
||||||
{% include {{ _include_path }} %}
|
{% include {{ _include_path }} %}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: page
|
layout: page
|
||||||
refactor: true
|
refactor: true
|
||||||
pannel_includes:
|
panel_includes:
|
||||||
- toc
|
- toc
|
||||||
tail_includes:
|
tail_includes:
|
||||||
- related-posts
|
- related-posts
|
||||||
@@ -9,32 +9,30 @@ tail_includes:
|
|||||||
- comments
|
- comments
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
<h1 data-toc-skip>{{ page.title }}</h1>
|
<h1 data-toc-skip>{{ page.title }}</h1>
|
||||||
|
|
||||||
<div class="post-meta text-muted">
|
<div class="post-meta text-muted">
|
||||||
<!-- published date -->
|
<!-- published date -->
|
||||||
<span>
|
<span>
|
||||||
{{ site.data.locales[lang].post.posted }}
|
{{ site.data.locales[site.lang].post.posted }}
|
||||||
{% include datetime.html date=page.date tooltip=true %}
|
{% include datetime.html date=page.date tooltip=true %}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- lastmod date -->
|
<!-- lastmod date -->
|
||||||
{% if page.last_modified_at %}
|
{% if page.last_modified_at %}
|
||||||
<span>
|
<span>
|
||||||
{{ site.data.locales[lang].post.updated }}
|
{{ site.data.locales[site.lang].post.updated }}
|
||||||
{% include datetime.html date=page.last_modified_at tooltip=true %}
|
{% include datetime.html date=page.last_modified_at tooltip=true %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.image.path %}
|
{% if page.image %}
|
||||||
{% capture bg %}
|
{% capture bg %}
|
||||||
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
|
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<div class="mt-3 mb-3">
|
<div class="mt-3 mb-3">
|
||||||
<img src="{{ page.image.path }}" class="preview-img {{ bg | strip }}"
|
<img src="{{ page.image.path | default: page.image }}" class="preview-img {{ bg | strip }}"
|
||||||
alt="{{ page.image.alt | default: "Preview Image" }}"
|
alt="{{ page.image.alt | default: "Preview Image" }}"
|
||||||
|
|
||||||
{% if page.image.width %}
|
{% if page.image.width %}
|
||||||
@@ -50,32 +48,32 @@ tail_includes:
|
|||||||
{% endif %}>
|
{% endif %}>
|
||||||
|
|
||||||
{% if page.image.alt %}
|
{% if page.image.alt %}
|
||||||
<figcaption class="pt-2 pb-2">{{ page.image.alt }}</figcaption>
|
<figcaption class="text-center pt-2 pb-2">{{ page.image.alt }}</figcaption>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<!-- author -->
|
<!-- author(s) -->
|
||||||
<span>
|
<span>
|
||||||
{% capture author_name %}{{ site.data.authors[page.author].name | default: site.social.name }}{% endcapture %}
|
|
||||||
{% assign author_link = nil %}
|
|
||||||
|
|
||||||
{% if page.author %}
|
{% if page.author %}
|
||||||
{% assign author_link = site.data.authors[page.author].url %}
|
{% assign authors = page.author %}
|
||||||
{% elsif author_name == site.social.name %}
|
{% elsif page.authors %}
|
||||||
{% assign author_link = site.social.links[0] %}
|
{% assign authors = page.authors %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ site.data.locales[lang].post.written_by }}
|
{{ site.data.locales[site.lang].post.written_by }}
|
||||||
|
|
||||||
<em>
|
<em>
|
||||||
{% if author_link %}
|
{% if authors %}
|
||||||
<a href="{{ author_link }}">{{ author_name }}</a>
|
{% for author in authors %}
|
||||||
{% else %}
|
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
|
||||||
{{ author_name }}
|
{% unless forloop.last %}</em>, <em>{% endunless %}
|
||||||
{% endif %}
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>
|
||||||
|
{% endif %}
|
||||||
</em>
|
</em>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -86,7 +84,7 @@ tail_includes:
|
|||||||
<em id="pv" class="pageviews">
|
<em id="pv" class="pageviews">
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
||||||
</em>
|
</em>
|
||||||
{{ site.data.locales[lang].post.pageview_measure }}
|
{{ site.data.locales[site.lang].post.pageview_measure }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -132,15 +130,15 @@ tail_includes:
|
|||||||
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
||||||
<div class="license-wrapper">
|
<div class="license-wrapper">
|
||||||
|
|
||||||
{% if site.data.locales[lang].copyright.license.template %}
|
{% if site.data.locales[site.lang].copyright.license.template %}
|
||||||
|
|
||||||
{% capture _replacement %}
|
{% capture _replacement %}
|
||||||
<a href="{{ site.data.locales[lang].copyright.license.link }}">
|
<a href="{{ site.data.locales[site.lang].copyright.license.link }}">
|
||||||
{{ site.data.locales[lang].copyright.license.name }}
|
{{ site.data.locales[site.lang].copyright.license.name }}
|
||||||
</a>
|
</a>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
{{ site.data.locales[site.lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ layout: page
|
|||||||
# The layout for Tag page
|
# The layout for Tag page
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
<div id="page-tag">
|
<div id="page-tag">
|
||||||
<h1 class="pl-lg-2">
|
<h1 class="pl-lg-2">
|
||||||
<i class="fa fa-tag fa-fw text-muted"></i>
|
<i class="fa fa-tag fa-fw text-muted"></i>
|
||||||
|
|||||||
@@ -30,17 +30,7 @@ This post is to show Markdown syntax rendering on [**Chirpy**](https://github.co
|
|||||||
|
|
||||||
## Paragraph
|
## Paragraph
|
||||||
|
|
||||||
I wandered lonely as a cloud
|
Quisque egestas convallis ipsum, ut sollicitudin risus tincidunt a. Maecenas interdum malesuada egestas. Duis consectetur porta risus, sit amet vulputate urna facilisis ac. Phasellus semper dui non purus ultrices sodales. Aliquam ante lorem, ornare a feugiat ac, finibus nec mauris. Vivamus ut tristique nisi. Sed vel leo vulputate, efficitur risus non, posuere mi. Nullam tincidunt bibendum rutrum. Proin commodo ornare sapien. Vivamus interdum diam sed sapien blandit, sit amet aliquam risus mattis. Nullam arcu turpis, mollis quis laoreet at, placerat id nibh. Suspendisse venenatis eros eros.
|
||||||
|
|
||||||
That floats on high o'er vales and hills,
|
|
||||||
|
|
||||||
When all at once I saw a crowd,
|
|
||||||
|
|
||||||
A host, of golden daffodils;
|
|
||||||
|
|
||||||
Beside the lake, beneath the trees,
|
|
||||||
|
|
||||||
Fluttering and dancing in the breeze.
|
|
||||||
|
|
||||||
## Lists
|
## Lists
|
||||||
|
|
||||||
@@ -53,17 +43,15 @@ Fluttering and dancing in the breeze.
|
|||||||
### Unordered list
|
### Unordered list
|
||||||
|
|
||||||
- Chapter
|
- Chapter
|
||||||
- Section
|
+ Section
|
||||||
- Paragraph
|
* Paragraph
|
||||||
|
|
||||||
### Task list
|
### ToDo list
|
||||||
|
|
||||||
- [ ] TODO
|
- [ ] Job
|
||||||
- [x] Completed
|
+ [x] Step 1
|
||||||
- [ ] Defeat COVID-19
|
+ [x] Step 2
|
||||||
- [x] Vaccine production
|
+ [ ] Step 3
|
||||||
- [ ] Economic recovery
|
|
||||||
- [ ] People smile again
|
|
||||||
|
|
||||||
### Description list
|
### Description list
|
||||||
|
|
||||||
@@ -118,30 +106,24 @@ _Full screen width and center alignment_
|
|||||||
|
|
||||||
- Shadow
|
- Shadow
|
||||||
|
|
||||||
{: .shadow width="1548" height="864" style="max-width: 90%" }
|
{: .shadow width="1548" height="864" .w-75 }
|
||||||
_shadow effect (visible in light mode)_
|
_shadow effect (visible in light mode)_
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
- Left aligned
|
- Left aligned
|
||||||
|
|
||||||
{: width="972" height="589" style="max-width: 70%" .normal}
|
{: width="972" height="589" .w-75 .normal}
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
- Float to left
|
- Float to left
|
||||||
|
|
||||||
{: width="972" height="589" style="max-width: 200px" .left}
|
{: width="972" height="589" .w-50 .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."
|
Praesent maximus aliquam sapien. Sed vel neque in dolor pulvinar auctor. Maecenas pharetra, sem sit amet interdum posuere, tellus lacus eleifend magna, ac lobortis felis ipsum id sapien. Proin ornare rutrum metus, ac convallis diam volutpat sit amet. Phasellus volutpat, elit sit amet tincidunt mollis, felis mi scelerisque mauris, ut facilisis leo magna accumsan sapien. In rutrum vehicula nisl eget tempor. Nullam maximus ullamcorper libero non maximus. Integer ultricies velit id convallis varius. Praesent eu nisl eu urna finibus ultrices id nec ex. Mauris ac mattis quam. Fusce aliquam est nec sapien bibendum, vitae malesuada ligula condimentum. Phasellus a tortor aliquam, tristique felis sit amet, elementum enim. Integer vestibulum vitae nulla nec pretium.
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
- Float to right
|
- Float to right
|
||||||
|
|
||||||
{: width="972" height="589" style="max-width: 200px" .right}
|
{: width="972" height="589" .w-50 .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."
|
Praesent maximus aliquam sapien. Sed vel neque in dolor pulvinar auctor. Maecenas pharetra, sem sit amet interdum posuere, tellus lacus eleifend magna, ac lobortis felis ipsum id sapien. Proin ornare rutrum metus, ac convallis diam volutpat sit amet. Phasellus volutpat, elit sit amet tincidunt mollis, felis mi scelerisque mauris, ut facilisis leo magna accumsan sapien. In rutrum vehicula nisl eget tempor. Nullam maximus ullamcorper libero non maximus. Integer ultricies velit id convallis varius. Praesent eu nisl eu urna finibus ultrices id nec ex. Mauris ac mattis quam. Fusce aliquam est nec sapien bibendum, vitae malesuada ligula condimentum. Phasellus a tortor aliquam, tristique felis sit amet, elementum enim. Integer vestibulum vitae nulla nec pretium.
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
## Mermaid SVG
|
## Mermaid SVG
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ tags: [bee]
|
|||||||
|
|
||||||
The author information of the post usually does not need to be filled in the _Front Matter_ , they will be obtained from variables `social.name` and the first entry of `social.links` of the configuration file by default. But you can also override it as follows:
|
The author information of the post usually does not need to be filled in the _Front Matter_ , they will be obtained from variables `social.name` and the first entry of `social.links` of the configuration file by default. But you can also override it as follows:
|
||||||
|
|
||||||
Add author information in `_data/authors.yml` (If your website doesn't have this file, don't hesitate to create one.)
|
Adding author information in `_data/authors.yml` (If your website doesn't have this file, don't hesitate to create one).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
<author_id>:
|
<author_id>:
|
||||||
@@ -58,15 +58,21 @@ Add author information in `_data/authors.yml` (If your website doesn't have this
|
|||||||
```
|
```
|
||||||
{: file="_data/authors.yml" }
|
{: file="_data/authors.yml" }
|
||||||
|
|
||||||
And then set up the custom author in the post's YAML block:
|
|
||||||
|
And then use `author` to specify a single entry or `authors` to specify multiple entries:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
author: <author_id>
|
author: <author_id> # for single entry
|
||||||
|
# or
|
||||||
|
authors: [<author1_id>, <author2_id>] # for multiple entries
|
||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
> Another benefit of reading the author information from the file `_data/authors.yml`{: .filepath } is that the page will have the meta tag `twitter:creator`, which enriches the [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started#card-and-content-attribution) and is good for SEO.
|
|
||||||
|
Having said that, the key `author` can also identify multiple entries.
|
||||||
|
|
||||||
|
> The benefit of reading the author information from the file `_data/authors.yml`{: .filepath } is that the page will have the meta tag `twitter:creator`, which enriches the [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started#card-and-content-attribution) and is good for SEO.
|
||||||
{: .prompt-info }
|
{: .prompt-info }
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
@@ -237,7 +243,7 @@ If you want to add an image to the top of the post contents, specify the attribu
|
|||||||
```yaml
|
```yaml
|
||||||
---
|
---
|
||||||
image:
|
image:
|
||||||
path: /path/to/image/file
|
path: /path/to/image
|
||||||
width: 1000 # in pixels
|
width: 1000 # in pixels
|
||||||
height: 400 # in pixels
|
height: 400 # in pixels
|
||||||
alt: image alternative text
|
alt: image alternative text
|
||||||
@@ -248,6 +254,12 @@ Except for `alt`, all other options are necessary, especially the `width` and `h
|
|||||||
|
|
||||||
Starting from _Chirpy v5.0.0_, the attributes `height` and `width` can be abbreviated: `height` → `h`, `width` → `w`. In addition, the [`img_path`](#image-path) can also be passed to the preview image, that is, when it has been set, the attribute `path` only needs the image file name.
|
Starting from _Chirpy v5.0.0_, the attributes `height` and `width` can be abbreviated: `height` → `h`, `width` → `w`. In addition, the [`img_path`](#image-path) can also be passed to the preview image, that is, when it has been set, the attribute `path` only needs the image file name.
|
||||||
|
|
||||||
|
For simple use, you can also just use `image` to define the path.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
image: /path/to/image
|
||||||
|
```
|
||||||
|
|
||||||
## Pinned Posts
|
## Pinned Posts
|
||||||
|
|
||||||
You can pin one or more posts to the top of the home page, and the fixed posts are sorted in reverse order according to their release date. Enable by:
|
You can pin one or more posts to the top of the home page, and the fixed posts are sorted in reverse order according to their release date. Enable by:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Update the variables of `_config.yml`{: .filepath} as needed. Some of them are t
|
|||||||
- `timezone`
|
- `timezone`
|
||||||
- `lang`
|
- `lang`
|
||||||
|
|
||||||
### Customing Stylesheet
|
### Customizing Stylesheet
|
||||||
|
|
||||||
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss`{: .filepath} to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss`{: .filepath} to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
||||||
|
|
||||||
@@ -105,31 +105,21 @@ Before the deployment begins, check out the file `_config.yml`{: .filepath} and
|
|||||||
|
|
||||||
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||||
|
|
||||||
### Deploy by Using Github Actions
|
### Deploy by Using GitHub Actions
|
||||||
|
|
||||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the GitHub Pages service.
|
Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`{: .filepath}. Otherwise, create a new one and fill in the contents of the [sample file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name. And then rename your repository to `<GH_USERNAME>.github.io` on GitHub.
|
||||||
|
|
||||||
Quickly check the files needed for GitHub Actions build:
|
Furthermore, if you have committed `Gemfile.lock`{: .filepath} to the repository and your local machine is not Linux, go the the root directory of your site and update the platform list:
|
||||||
|
|
||||||
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`{: .filepath}. Otherwise, create a new one and fill in the contents of the [sample file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
|
```console
|
||||||
|
$ bundle lock --add-platform x86_64-linux
|
||||||
|
```
|
||||||
|
|
||||||
- Ensure your Jekyll site has file `tools/deploy.sh`{: .filepath}. Otherwise, copy it from here to your Jekyll site.
|
Now publish your Jekyll site:
|
||||||
|
|
||||||
- Furthermore, if you have committed `Gemfile.lock`{: .filepath} to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lock file:
|
1. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar. Then, in the **Source** section (under _Build and deployment_), select [**GitHub Actions**][pages-workflow-src] from the dropdown menu.
|
||||||
|
|
||||||
```console
|
2. Push any commit to remote to trigger the GitHub Actions workflow. In the _Actions_ tab of your repository, you should see the workflow _Build and Deploy_ running. Once the build is complete and successful, the site should be deployed automatically.
|
||||||
$ bundle lock --add-platform x86_64-linux
|
|
||||||
```
|
|
||||||
|
|
||||||
After the above steps, rename your repository to `<GH_USERNAME>.github.io` on GitHub.
|
|
||||||
|
|
||||||
Now publish your Jekyll site by:
|
|
||||||
|
|
||||||
1. Push any commit to remote to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
|
||||||
|
|
||||||
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
|
||||||
|
|
||||||
{: width="1580" height="250" }
|
|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
@@ -182,5 +172,5 @@ The merge is likely to conflict with your local modifications. Please be patient
|
|||||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||||
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||||
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
||||||
[pages-src]: https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
|
[pages-workflow-src]: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow
|
||||||
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ categories: [Blogging, Tutorial]
|
|||||||
tags: [google analytics, pageviews]
|
tags: [google analytics, pageviews]
|
||||||
---
|
---
|
||||||
|
|
||||||
|
> The content of this post applies only to [_Universal Analytics property_](https://support.google.com/analytics/answer/10220206) (UA), not [_Google Analytics 4_](https://support.google.com/analytics/answer/10089681) (GA 4). In addition, since [UA is about to be deprecated on Jul 1, 2023](https://support.google.com/analytics/answer/11583528), the Page Views feature of [_Chirpy_][chirpy-homepage] will also be deprecated at that time.
|
||||||
|
{: .prompt-danger }
|
||||||
|
|
||||||
This post is to enable Page Views on the [**Chirpy**][chirpy-homepage] theme based blog that you just built. This requires technical knowledge and it's recommended to keep the `google_analytics.pv.*` empty unless you have a good reason. If your website has low traffic, the page views count would discourage you to write more blogs. With that said, let's start with the setup.
|
This post is to enable Page Views on the [**Chirpy**][chirpy-homepage] theme based blog that you just built. This requires technical knowledge and it's recommended to keep the `google_analytics.pv.*` empty unless you have a good reason. If your website has low traffic, the page views count would discourage you to write more blogs. With that said, let's start with the setup.
|
||||||
|
|
||||||
|
|||||||
@@ -5,22 +5,22 @@
|
|||||||
html {
|
html {
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
&:not([data-mode]),
|
&:not([data-mode]),
|
||||||
&[data-mode=light] {
|
&[data-mode="light"] {
|
||||||
@include light-scheme;
|
@include light-scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-mode=dark] {
|
&[data-mode="dark"] {
|
||||||
@include dark-scheme;
|
@include dark-scheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
&:not([data-mode]),
|
&:not([data-mode]),
|
||||||
&[data-mode=dark] {
|
&[data-mode="dark"] {
|
||||||
@include dark-scheme;
|
@include dark-scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-mode=light] {
|
&[data-mode="light"] {
|
||||||
@include light-scheme;
|
@include light-scheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,11 +29,11 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
line-height: 1.75rem;
|
|
||||||
background: var(--body-bg);
|
background: var(--body-bg);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif;
|
font-family: "Source Sans Pro", "Microsoft Yahei", sans-serif;
|
||||||
|
line-height: 1.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Typography --- */
|
/* --- Typography --- */
|
||||||
@@ -76,14 +76,6 @@ h5 {
|
|||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
ol,
|
|
||||||
ul {
|
|
||||||
ol,
|
|
||||||
ul {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@extend %link-color;
|
@extend %link-color;
|
||||||
}
|
}
|
||||||
@@ -102,27 +94,28 @@ blockquote {
|
|||||||
display: flex;
|
display: flex;
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 0.75rem 1.2rem;
|
padding: 1rem;
|
||||||
color: var(--prompt-text-color);
|
color: var(--prompt-text-color);
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
margin-right: 1rem;
|
|
||||||
font-family: "Font Awesome 5 Free";
|
font-family: "Font Awesome 5 Free";
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 1.25rem;
|
width: 1.25rem;
|
||||||
|
margin-right: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
p:last-child {
|
> div {
|
||||||
margin-bottom: 0rem;
|
max-width: calc(100% - 2rem);
|
||||||
|
|
||||||
|
> :last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include prompt("tip", "\f0eb", 400);
|
@include prompt("tip", "\f0eb", 400);
|
||||||
|
|
||||||
@include prompt("info", "\f06a");
|
@include prompt("info", "\f06a");
|
||||||
|
|
||||||
@include prompt("warning", "\f06a");
|
@include prompt("warning", "\f06a");
|
||||||
|
|
||||||
@include prompt("danger", "\f071");
|
@include prompt("danger", "\f071");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,11 +141,10 @@ kbd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
@include pl-pr(1.5rem);
|
|
||||||
|
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
|
background-color: var(--main-bg);
|
||||||
|
|
||||||
> div.d-flex {
|
div.d-flex {
|
||||||
height: $footer-height;
|
height: $footer-height;
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
@@ -172,7 +164,6 @@ footer {
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
|
|
||||||
@include no-text-decoration;
|
@include no-text-decoration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,6 +180,11 @@ i { /* fontawesome icons */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes fade-in {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
from { opacity: 0; }
|
from { opacity: 0; }
|
||||||
to { opacity: 1; }
|
to { opacity: 1; }
|
||||||
@@ -197,7 +193,8 @@ i { /* fontawesome icons */
|
|||||||
img[data-src] {
|
img[data-src] {
|
||||||
margin: 0.5rem 0;
|
margin: 0.5rem 0;
|
||||||
|
|
||||||
&[data-loaded=true] {
|
&[data-loaded="true"] {
|
||||||
|
-webkit-animation: fade-in linear 0.5s;
|
||||||
animation: fade-in linear 0.5s;
|
animation: fade-in linear 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,6 +209,7 @@ img[data-src] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.shadow {
|
&.shadow {
|
||||||
|
-webkit-filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
||||||
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
||||||
box-shadow: none !important; /* cover the Bootstrap 4.6.1 styles */
|
box-shadow: none !important; /* cover the Bootstrap 4.6.1 styles */
|
||||||
}
|
}
|
||||||
@@ -228,7 +226,7 @@ img[data-src] {
|
|||||||
margin-bottom: 4rem;
|
margin-bottom: 4rem;
|
||||||
|
|
||||||
&:only-child {
|
&:only-child {
|
||||||
position: -webkit-sticky; /* Safari */
|
position: -webkit-sticky;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +242,6 @@ img[data-src] {
|
|||||||
.post-content {
|
.post-content {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#panel-wrapper {
|
#panel-wrapper {
|
||||||
@@ -266,12 +263,12 @@ img[data-src] {
|
|||||||
&:hover {
|
&:hover {
|
||||||
background-color: #2a408e;
|
background-color: #2a408e;
|
||||||
border-color: #2a408e;
|
border-color: #2a408e;
|
||||||
color: #fff;
|
color: #ffffff;
|
||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-topbar-visible=true] & > div {
|
[data-topbar-visible="true"] & > div {
|
||||||
top: 6rem;
|
top: 6rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -296,7 +293,6 @@ img[data-src] {
|
|||||||
|
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.footnotes > ol {
|
.footnotes > ol {
|
||||||
@@ -316,10 +312,11 @@ img[data-src] {
|
|||||||
|
|
||||||
/* [scroll-focus] added by `smooth-scroll.js` */
|
/* [scroll-focus] added by `smooth-scroll.js` */
|
||||||
&:target:not([scroll-focus]),
|
&:target:not([scroll-focus]),
|
||||||
&[scroll-focus=true] > p {
|
&[scroll-focus="true"] > p {
|
||||||
background-color: var(--footnote-target-bg);
|
background-color: var(--footnote-target-bg);
|
||||||
|
width: -moz-fit-content;
|
||||||
|
width: -webkit-fit-content;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
|
||||||
transition: background-color 1.5s ease-in-out;
|
transition: background-color 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -331,7 +328,6 @@ img[data-src] {
|
|||||||
@include pl-pr(2px);
|
@include pl-pr(2px);
|
||||||
|
|
||||||
border-bottom-style: none !important;
|
border-bottom-style: none !important;
|
||||||
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
|
||||||
transition: background-color 1.5s ease-in-out;
|
transition: background-color 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +417,6 @@ img[data-src] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} /* a */
|
} /* a */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.pageviews .fa-spinner {
|
.pageviews .fa-spinner {
|
||||||
@@ -449,10 +444,8 @@ img[data-src] {
|
|||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
font-size: 1.08rem;
|
font-size: 1.08rem;
|
||||||
line-height: 1.8;
|
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
word-wrap: break-word;
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
&:not(.img-link) {
|
&:not(.img-link) {
|
||||||
@@ -466,17 +459,40 @@ img[data-src] {
|
|||||||
&.img-link {
|
&.img-link {
|
||||||
@extend %img-caption;
|
@extend %img-caption;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ol,
|
||||||
ul {
|
ul {
|
||||||
/* attribute 'hide-bullet' was added by liquid */
|
&:not([class]),
|
||||||
.task-list-item[hide-bullet] {
|
&.task-list {
|
||||||
|
-webkit-padding-start: 1.75rem;
|
||||||
|
padding-inline-start: 1.75rem;
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin: 0.25rem 0;
|
||||||
|
padding-left: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol,
|
||||||
|
ul {
|
||||||
|
-webkit-padding-start: 1.25rem;
|
||||||
|
padding-inline-start: 1.25rem;
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.task-list {
|
||||||
|
-webkit-padding-start: 1.25rem;
|
||||||
|
padding-inline-start: 1.25rem;
|
||||||
|
|
||||||
|
li {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
> i { /* checkbox icon */
|
> i { /* checkbox icon */
|
||||||
margin: 0 0.4rem 0.2rem -1.4rem;
|
width: 2rem;
|
||||||
vertical-align: middle;
|
margin-left: -1.25rem;
|
||||||
color: var(--checkbox-color);
|
color: var(--checkbox-color);
|
||||||
|
|
||||||
&.checked {
|
&.checked {
|
||||||
@@ -484,39 +500,21 @@ img[data-src] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
ul {
|
||||||
|
-webkit-padding-start: 1.75rem;
|
||||||
input[type=checkbox] {
|
padding-inline-start: 1.75rem;
|
||||||
margin: 0 0.5rem 0.2rem -1.3rem;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* ul */
|
|
||||||
|
|
||||||
> ol,
|
|
||||||
> ul {
|
|
||||||
padding-left: 2rem;
|
|
||||||
|
|
||||||
li {
|
|
||||||
ol,
|
|
||||||
ul { /* sub list */
|
|
||||||
padding-left: 2rem;
|
|
||||||
margin-top: 0.3rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
input[type="checkbox"] {
|
||||||
|
margin: 0 0.5rem 0.2rem -1.3rem;
|
||||||
> ol {
|
vertical-align: middle;
|
||||||
li {
|
|
||||||
padding-left: 0.25em;
|
|
||||||
}
|
}
|
||||||
}
|
} /* ul */
|
||||||
|
|
||||||
dl > dd {
|
dl > dd {
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* .post-content */
|
} /* .post-content */
|
||||||
|
|
||||||
.tag:hover {
|
.tag:hover {
|
||||||
@@ -581,7 +579,6 @@ img[data-src] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.flex-grow-1 {
|
.flex-grow-1 {
|
||||||
-ms-flex-positive: 1 !important;
|
|
||||||
flex-grow: 1 !important;
|
flex-grow: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -673,9 +670,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 2px solid rgba(222, 222, 222, 0.7);
|
border: 2px solid rgba(222, 222, 222, 0.7);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
-webkit-transform: translateZ(0);
|
||||||
transform: translateZ(0); /* fixed the zoom in Safari */
|
transform: translateZ(0); /* fixed the zoom in Safari */
|
||||||
-webkit-transition: border-color 0.35s ease-in-out;
|
|
||||||
-moz-transition: border-color 0.35s ease-in-out;
|
|
||||||
transition: border-color 0.35s ease-in-out;
|
transition: border-color 0.35s ease-in-out;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -686,13 +682,11 @@ $sidebar-display: "sidebar-display";
|
|||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
-webkit-transition: transform 0.5s;
|
transition: -webkit-transform 0.5s;
|
||||||
-moz-transition: transform 0.5s;
|
|
||||||
transition: transform 0.5s;
|
transition: transform 0.5s;
|
||||||
|
transition: transform 0.5s, -webkit-transform 0.5s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
-ms-transform: scale(1.2);
|
|
||||||
-moz-transform: scale(1.2);
|
|
||||||
-webkit-transform: scale(1.2);
|
-webkit-transform: scale(1.2);
|
||||||
transform: scale(1.2);
|
transform: scale(1.2);
|
||||||
}
|
}
|
||||||
@@ -700,23 +694,27 @@ $sidebar-display: "sidebar-display";
|
|||||||
} /* #avatar */
|
} /* #avatar */
|
||||||
|
|
||||||
.site-title {
|
.site-title {
|
||||||
|
margin-top: 0.55rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@extend %clickable-transition;
|
@extend %clickable-transition;
|
||||||
|
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
color: rgba(134, 133, 133, 99%);
|
color: rgba(134, 133, 133, 0.99);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-subtitle {
|
.site-subtitle {
|
||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
color: var(--sidebar-muted-color);
|
color: var(--sidebar-muted-color);
|
||||||
line-height: 1.2rem;
|
line-height: 1.25rem;
|
||||||
word-spacing: 1px;
|
word-spacing: 1px;
|
||||||
margin: 0.5rem 1.5rem 0.5rem 1.5rem;
|
margin: 0.2rem 1.5rem 0.5rem 1.5rem;
|
||||||
min-height: 3rem; /* avoid vertical shifting in multi-line words */
|
min-height: 3rem; /* avoid vertical shifting in multi-line words */
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -797,9 +795,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
@include fix-cursor($top);
|
@include fix-cursor($top);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* @for */
|
} /* @for */
|
||||||
|
|
||||||
} /* ul */
|
} /* ul */
|
||||||
|
|
||||||
.sidebar-bottom {
|
.sidebar-bottom {
|
||||||
@@ -850,16 +846,11 @@ $sidebar-display: "sidebar-display";
|
|||||||
height: 3px;
|
height: 3px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* .sidebar-bottom */
|
} /* .sidebar-bottom */
|
||||||
|
|
||||||
} /* #sidebar */
|
} /* #sidebar */
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
#sidebar ul > li:last-child::after {
|
#sidebar ul > li:last-child::after {
|
||||||
-webkit-transition: top 0.5s ease;
|
|
||||||
-moz-transition: top 0.5s ease;
|
|
||||||
-o-transition: top 0.5s ease;
|
|
||||||
transition: top 0.5s ease;
|
transition: top 0.5s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -893,14 +884,14 @@ $sidebar-display: "sidebar-display";
|
|||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.07);
|
||||||
background-color: var(--topbar-wrapper-bg);
|
background-color: var(--topbar-wrapper-bg);
|
||||||
|
|
||||||
[data-topbar-visible=false] & {
|
[data-topbar-visible="false"] & {
|
||||||
top: -$topbar-height; /* same as topbar height. */
|
top: -$topbar-height; /* same as topbar height. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#topbar {
|
#topbar {
|
||||||
i { /* icons */
|
i { /* icons */
|
||||||
color: #999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
#breadcrumb {
|
#breadcrumb {
|
||||||
@@ -964,9 +955,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
background: center;
|
background: center;
|
||||||
|
|
||||||
&.form-control {
|
&.form-control {
|
||||||
&::-webkit-input-placeholder { @include input-placeholder; }
|
|
||||||
&::-moz-placeholder { @include input-placeholder; }
|
&::-moz-placeholder { @include input-placeholder; }
|
||||||
&:-ms-input-placeholder { @include input-placeholder; }
|
&::-webkit-input-placeholder { @include input-placeholder; }
|
||||||
&::placeholder { @include input-placeholder; }
|
&::placeholder { @include input-placeholder; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1052,8 +1042,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#core-wrapper {
|
#core-wrapper {
|
||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height});
|
|
||||||
|
|
||||||
.categories,
|
.categories,
|
||||||
#tags,
|
#tags,
|
||||||
#archives {
|
#archives {
|
||||||
@@ -1061,6 +1049,10 @@ $sidebar-display: "sidebar-display";
|
|||||||
@extend %no-bottom-border;
|
@extend %no-bottom-border;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@at-root .row:only-child > #{&} {
|
||||||
|
padding-bottom: 3rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#mask {
|
#mask {
|
||||||
@@ -1082,9 +1074,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
/* --- main wrapper --- */
|
/* --- main wrapper --- */
|
||||||
|
|
||||||
#main-wrapper {
|
#main-wrapper {
|
||||||
background-color: var(--main-wrapper-bg);
|
background-color: var(--main-bg);
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 100vh;
|
min-height: calc(100vh - #{$footer-height});
|
||||||
|
|
||||||
@include pl-pr(0);
|
@include pl-pr(0);
|
||||||
}
|
}
|
||||||
@@ -1116,7 +1108,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
height: $size;
|
height: $size;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid var(--btn-backtotop-border-color);
|
border: 1px solid var(--btn-backtotop-border-color);
|
||||||
|
transition: -webkit-transform 0.2s ease-out;
|
||||||
transition: transform 0.2s ease-out;
|
transition: transform 0.2s ease-out;
|
||||||
|
transition: transform 0.2s ease-out, -webkit-transform 0.2s ease-out;
|
||||||
-webkit-transition: transform 0.2s ease-out;
|
-webkit-transition: transform 0.2s ease-out;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
@@ -1132,6 +1126,13 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#notification {
|
#notification {
|
||||||
|
@-webkit-keyframes popup {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes popup {
|
@keyframes popup {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -1146,7 +1147,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toast-body {
|
.toast-body {
|
||||||
font-family: 'Lato';
|
font-family: Lato, sans-serif;
|
||||||
line-height: 1.25rem;
|
line-height: 1.25rem;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
@@ -1169,11 +1170,12 @@ $sidebar-display: "sidebar-display";
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
bottom: 20%;
|
bottom: 20%;
|
||||||
|
-webkit-transform: translateX(-50%);
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
-webkit-animation: popup 0.8s;
|
||||||
animation: popup 0.8s;
|
animation: popup 0.8s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1189,10 +1191,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
footer {
|
footer {
|
||||||
height: $footer-height-mobile;
|
height: $footer-height-mobile;
|
||||||
|
|
||||||
> div.d-flex {
|
div.d-flex {
|
||||||
padding: 1.5rem 0;
|
padding: 1.5rem 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
-ms-flex-pack: distribute !important;
|
|
||||||
justify-content: space-around !important;
|
justify-content: space-around !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1202,6 +1203,10 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main-wrapper {
|
||||||
|
min-height: calc(100vh - #{$footer-height-mobile});
|
||||||
|
}
|
||||||
|
|
||||||
#core-wrapper {
|
#core-wrapper {
|
||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height-mobile}) !important;
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height-mobile}) !important;
|
||||||
|
|
||||||
@@ -1211,12 +1216,14 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
> blockquote[class^=prompt-] {
|
> blockquote[class^="prompt-"] {
|
||||||
|
@include pl-pr(1.25rem);
|
||||||
@include ml-mr(-1.25rem);
|
@include ml-mr(-1.25rem);
|
||||||
|
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
max-width: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#avatar > a {
|
#avatar > a {
|
||||||
@@ -1227,7 +1234,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
.site-subtitle {
|
.site-subtitle {
|
||||||
@include ml-mr(1.8rem);
|
@include ml-mr(1.8rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 768px) {
|
@media all and (max-width: 768px) {
|
||||||
@@ -1249,11 +1255,10 @@ $sidebar-display: "sidebar-display";
|
|||||||
@media all and (max-width: 849px) {
|
@media all and (max-width: 849px) {
|
||||||
@mixin slide($append: null) {
|
@mixin slide($append: null) {
|
||||||
$basic: transform 0.4s ease;
|
$basic: transform 0.4s ease;
|
||||||
|
|
||||||
@if $append {
|
@if $append {
|
||||||
-webkit-transition: $basic, $append;
|
|
||||||
transition: $basic, $append;
|
transition: $basic, $append;
|
||||||
} @else {
|
} @else {
|
||||||
-webkit-transition: $basic;
|
|
||||||
transition: $basic;
|
transition: $basic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1263,13 +1268,20 @@ $sidebar-display: "sidebar-display";
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
@include slide;
|
||||||
|
}
|
||||||
|
|
||||||
[#{$sidebar-display}] {
|
[#{$sidebar-display}] {
|
||||||
#sidebar {
|
#sidebar {
|
||||||
|
-webkit-transform: translateX(0);
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#topbar-wrapper,
|
#topbar-wrapper,
|
||||||
#main-wrapper {
|
#main-wrapper,
|
||||||
|
footer {
|
||||||
|
-webkit-transform: translateX(#{$sidebar-width});
|
||||||
transform: translateX(#{$sidebar-width});
|
transform: translateX(#{$sidebar-width});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1281,8 +1293,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
-webkit-transform: translateX(-#{$sidebar-width});
|
-webkit-transform: translateX(-#{$sidebar-width});
|
||||||
|
|
||||||
.cursor {
|
.cursor {
|
||||||
-webkit-transition: none;
|
|
||||||
-moz-transition: none;
|
|
||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1294,7 +1304,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#topbar,
|
#topbar,
|
||||||
#main {
|
#main,
|
||||||
|
footer > .container {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1329,8 +1340,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#tags {
|
#tags {
|
||||||
-webkit-box-pack: center !important;
|
|
||||||
-ms-flex-pack: center !important;
|
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1341,18 +1350,17 @@ $sidebar-display: "sidebar-display";
|
|||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* max-width: 849px */
|
} /* max-width: 849px */
|
||||||
|
|
||||||
@media all and (max-width: 849px) and (orientation: portrait) {
|
@media all and (max-width: 849px) and (orientation: portrait) {
|
||||||
[data-topbar-visible=false] #topbar-wrapper {
|
[data-topbar-visible="false"] #topbar-wrapper {
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Phone & Pad */
|
/* Phone & Pad */
|
||||||
@media all and (min-width: 577px) and (max-width: 1199px) {
|
@media all and (min-width: 577px) and (max-width: 1199px) {
|
||||||
footer > .d-flex > div {
|
footer .d-flex > div {
|
||||||
width: 312px;
|
width: 312px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1364,7 +1372,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-wrapper {
|
#main-wrapper,
|
||||||
|
footer {
|
||||||
margin-left: $sidebar-width;
|
margin-left: $sidebar-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1395,21 +1404,14 @@ $sidebar-display: "sidebar-display";
|
|||||||
right: 5%;
|
right: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#topbar {
|
|
||||||
@include pl-pr(2rem);
|
|
||||||
}
|
|
||||||
|
|
||||||
#topbar-title {
|
#topbar-title {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pad horizontal */
|
/* Pad horizontal */
|
||||||
@media all and (min-width: 992px) and (max-width: 1199px) {
|
@media all and (min-width: 992px) and (max-width: 1199px) {
|
||||||
#main .col-lg-11 {
|
#main .col-lg-11 {
|
||||||
-webkit-box-flex: 0;
|
|
||||||
-ms-flex: 0 0 96%;
|
|
||||||
flex: 0 0 96%;
|
flex: 0 0 96%;
|
||||||
max-width: 96%;
|
max-width: 96%;
|
||||||
}
|
}
|
||||||
@@ -1438,7 +1440,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#topbar-wrapper {
|
#topbar-wrapper {
|
||||||
left: 210px;
|
left: $sidebar-width-small;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-results > div {
|
#search-results > div {
|
||||||
@@ -1456,8 +1458,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-wrapper {
|
#main-wrapper,
|
||||||
margin-left: 210px;
|
footer {
|
||||||
|
margin-left: $sidebar-width-small;
|
||||||
}
|
}
|
||||||
|
|
||||||
#breadcrumb {
|
#breadcrumb {
|
||||||
@@ -1467,7 +1470,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
word-break: keep-all;
|
word-break: keep-all;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* panel hidden */
|
/* panel hidden */
|
||||||
@@ -1477,8 +1479,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#main > div.row {
|
#main > div.row {
|
||||||
-webkit-box-pack: center !important;
|
|
||||||
-ms-flex-pack: center !important;
|
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1495,7 +1495,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#search-input {
|
#search-input {
|
||||||
-webkit-transition: all 0.3s ease-in-out;
|
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1520,10 +1519,11 @@ $sidebar-display: "sidebar-display";
|
|||||||
font-size: 1.03rem;
|
font-size: 1.03rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer > div.d-felx {
|
footer {
|
||||||
width: 85%;
|
div.d-felx {
|
||||||
|
width: 85%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1400px) {
|
@media all and (min-width: 1400px) {
|
||||||
@@ -1533,7 +1533,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1650px) {
|
@media all and (min-width: 1650px) {
|
||||||
#main-wrapper {
|
#main-wrapper,
|
||||||
|
footer {
|
||||||
margin-left: $sidebar-width-large;
|
margin-left: $sidebar-width-large;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1546,7 +1547,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#topbar,
|
#topbar,
|
||||||
#main {
|
#main,
|
||||||
|
footer > .container {
|
||||||
max-width: $main-content-max-width;
|
max-width: $main-content-max-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1590,6 +1592,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
.site-title {
|
.site-title {
|
||||||
@extend %profile-ml;
|
@extend %profile-ml;
|
||||||
|
|
||||||
|
margin-top: 0.4rem;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
font-size: 1.7rem;
|
font-size: 1.7rem;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
@@ -1600,9 +1604,8 @@ $sidebar-display: "sidebar-display";
|
|||||||
@extend %profile-ml;
|
@extend %profile-ml;
|
||||||
|
|
||||||
word-spacing: 0;
|
word-spacing: 0;
|
||||||
margin-top: 0.3rem;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* .profile-wrapper (min-width: 1650px) */
|
} /* .profile-wrapper (min-width: 1650px) */
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
@@ -1628,7 +1631,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1639,8 +1641,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
$icon-block-size: 2rem;
|
$icon-block-size: 2rem;
|
||||||
|
|
||||||
&.justify-content-center {
|
&.justify-content-center {
|
||||||
-webkit-box-pack: start !important;
|
|
||||||
-ms-flex-pack: start !important;
|
|
||||||
justify-content: flex-start !important;
|
justify-content: flex-start !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1665,6 +1665,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
-webkit-transform: translate(-50%, -50%);
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1672,9 +1673,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
.icon-border {
|
.icon-border {
|
||||||
top: 0.9rem;
|
top: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* .sidebar-bottom */
|
} /* .sidebar-bottom */
|
||||||
|
|
||||||
} /* #sidebar */
|
} /* #sidebar */
|
||||||
|
|
||||||
} /* min-width: 1650px */
|
} /* min-width: 1650px */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
%heading {
|
%heading {
|
||||||
color: var(--heading-color);
|
color: var(--heading-color);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
font-family: Lato, "Microsoft Yahei", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
%section {
|
%section {
|
||||||
@@ -73,6 +73,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%no-cursor {
|
%no-cursor {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +103,8 @@
|
|||||||
|
|
||||||
%sidebar-links {
|
%sidebar-links {
|
||||||
color: rgba(117, 117, 117, 0.9);
|
color: rgba(117, 117, 117, 0.9);
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +138,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
-webkit-transform: translateX(-50%);
|
-webkit-transform: translateX(-50%);
|
||||||
-ms-transform: translateX(-50%);
|
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,22 +8,22 @@
|
|||||||
html {
|
html {
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
&:not([data-mode]),
|
&:not([data-mode]),
|
||||||
&[data-mode=light] {
|
&[data-mode="light"] {
|
||||||
@include light-syntax;
|
@include light-syntax;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-mode=dark] {
|
&[data-mode="dark"] {
|
||||||
@include dark-syntax;
|
@include dark-syntax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
&:not([data-mode]),
|
&:not([data-mode]),
|
||||||
&[data-mode=dark] {
|
&[data-mode="dark"] {
|
||||||
@include dark-syntax;
|
@include dark-syntax;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-mode=light] {
|
&[data-mode="light"] {
|
||||||
@include light-syntax;
|
@include light-syntax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,29 +87,27 @@ $code-radius: 6px;
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
color: var(--highlight-lineno-color);
|
color: var(--highlight-lineno-color);
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-khtml-user-select: none;
|
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
|
||||||
-o-user-select: none;
|
-o-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the dollar sign to non-selectable */
|
/* set the dollar sign to non-selectable */
|
||||||
.gp {
|
.gp {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* .highlight */
|
} /* .highlight */
|
||||||
|
|
||||||
code {
|
code {
|
||||||
-webkit-hyphens: none;
|
-webkit-hyphens: none;
|
||||||
-ms-hyphens: none;
|
|
||||||
-moz-hyphens: none;
|
|
||||||
hyphens: none;
|
hyphens: none;
|
||||||
|
|
||||||
&.highlighter-rouge {
|
&.highlighter-rouge {
|
||||||
font-size: $code-font-size;
|
font-size: $code-font-size;
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
|
word-break: break-word;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: var(--inline-code-bg);
|
background-color: var(--inline-code-bg);
|
||||||
}
|
}
|
||||||
@@ -151,16 +149,15 @@ td.rouge-code {
|
|||||||
border-bottom: none !important;
|
border-bottom: none !important;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide line numbers for default, console, and terminal code snippets */
|
/* Hide line numbers for default, console, and terminal code snippets */
|
||||||
div {
|
div {
|
||||||
&[class^='highlighter-rouge'],
|
&[class^="highlighter-rouge"],
|
||||||
|
&.nolineno,
|
||||||
&.language-plaintext.highlighter-rouge,
|
&.language-plaintext.highlighter-rouge,
|
||||||
&.language-console.highlighter-rouge,
|
&.language-console.highlighter-rouge,
|
||||||
&.language-terminal.highlighter-rouge,
|
&.language-terminal.highlighter-rouge {
|
||||||
&.nolineno {
|
|
||||||
pre.lineno {
|
pre.lineno {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -251,6 +248,10 @@ div {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
&:not([timeout]):hover {
|
&:not([timeout]):hover {
|
||||||
background-color: rgba(128, 128, 128, 0.37);
|
background-color: rgba(128, 128, 128, 0.37);
|
||||||
|
|
||||||
@@ -258,18 +259,12 @@ div {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
.post-content {
|
.post-content {
|
||||||
> div[class^='language-'] {
|
> div[class^="language-"] {
|
||||||
@include ml-mr(-1.25rem);
|
@include ml-mr(-1.25rem);
|
||||||
|
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
|||||||
@@ -13,20 +13,16 @@ $sidebar-width-large: 350px !default; /* screen width: >= 1650px */
|
|||||||
$tab-count: 5 !default; /* backward compatible (version <= 4.0.2) */
|
$tab-count: 5 !default; /* backward compatible (version <= 4.0.2) */
|
||||||
$tab-height: 3rem !default;
|
$tab-height: 3rem !default;
|
||||||
$tab-cursor-height: 1.6rem !default;
|
$tab-cursor-height: 1.6rem !default;
|
||||||
|
|
||||||
$cursor-width: 2px !default; /* the cursor width of the selected tab */
|
$cursor-width: 2px !default; /* the cursor width of the selected tab */
|
||||||
|
|
||||||
/* other framework sizes */
|
/* other framework sizes */
|
||||||
|
|
||||||
$topbar-height: 3rem !default;
|
$topbar-height: 3rem !default;
|
||||||
|
|
||||||
$search-max-width: 210px !default;
|
$search-max-width: 210px !default;
|
||||||
|
|
||||||
$footer-height: 5rem !default;
|
$footer-height: 5rem !default;
|
||||||
$footer-height-mobile: 6rem !default; /* screen width: <= 576px */
|
$footer-height-mobile: 6rem !default; /* screen width: <= 576px */
|
||||||
|
|
||||||
$main-content-max-width: 1250px !default;
|
$main-content-max-width: 1250px !default;
|
||||||
|
|
||||||
$bottom-min-height: 35rem !default;
|
$bottom-min-height: 35rem !default;
|
||||||
|
|
||||||
/* syntax highlight */
|
/* syntax highlight */
|
||||||
|
|||||||
@@ -3,7 +3,24 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@mixin dark-syntax {
|
@mixin dark-syntax {
|
||||||
|
--highlight-bg-color: #252525;
|
||||||
|
--highlighter-rouge-color: #de6b18;
|
||||||
|
--highlight-lineno-color: #6c6c6d;
|
||||||
|
--inline-code-bg: #272822;
|
||||||
|
--code-header-text-color: #6a6a6a;
|
||||||
|
--code-header-muted-color: rgb(60, 60, 60);
|
||||||
|
--code-header-icon-color: rgb(86, 86, 86);
|
||||||
|
--clipboard-checked-color: #2bcc2b;
|
||||||
|
--filepath-text-color: #bdbdbd;
|
||||||
|
|
||||||
|
pre { color: #bfbfbf; } /* override Bootstrap */
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
.gp { color: #818c96; }
|
||||||
|
}
|
||||||
|
|
||||||
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
||||||
|
|
||||||
.highlight pre { background-color: var(--highlight-bg-color); }
|
.highlight pre { background-color: var(--highlight-bg-color); }
|
||||||
.highlight .hll { background-color: var(--highlight-bg-color); }
|
.highlight .hll { background-color: var(--highlight-bg-color); }
|
||||||
.highlight .c { color: #75715e; } /* Comment */
|
.highlight .c { color: #75715e; } /* Comment */
|
||||||
@@ -67,22 +84,4 @@
|
|||||||
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
||||||
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
||||||
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
||||||
|
|
||||||
/* ----- custom styles ------ */
|
|
||||||
|
|
||||||
--highlight-bg-color: #252525;
|
|
||||||
--highlighter-rouge-color: #de6b18;
|
|
||||||
--highlight-lineno-color: #6c6c6d;
|
|
||||||
--inline-code-bg: #272822;
|
|
||||||
--code-header-text-color: #6a6a6a;
|
|
||||||
--code-header-muted-color: rgb(60 60 60);
|
|
||||||
--code-header-icon-color: rgb(86 86 86);
|
|
||||||
--clipboard-checked-color: #2bcc2b;
|
|
||||||
--filepath-text-color: #bdbdbd;
|
|
||||||
|
|
||||||
.highlight {
|
|
||||||
.gp { color: #818c96; }
|
|
||||||
}
|
|
||||||
|
|
||||||
pre { color: #bfbfbf; } /* override Bootstrap */
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
@mixin dark-scheme {
|
@mixin dark-scheme {
|
||||||
/* Framework color */
|
/* Framework color */
|
||||||
--body-bg: var(--main-wrapper-bg);
|
--body-bg: var(--main-bg);
|
||||||
--mask-bg: rgb(68, 69, 70);
|
--mask-bg: rgb(68, 69, 70);
|
||||||
--main-wrapper-bg: rgb(27, 27, 30);
|
--main-bg: rgb(27, 27, 30);
|
||||||
--main-border-color: rgb(44, 45, 45);
|
--main-border-color: rgb(44, 45, 45);
|
||||||
|
|
||||||
/* Common color */
|
/* Common color */
|
||||||
@@ -21,18 +21,18 @@
|
|||||||
--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-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-color: rgb(118, 120, 121);
|
||||||
--checkbox-checked-color: var(--link-color);
|
--checkbox-checked-color: var(--link-color);
|
||||||
|
|
||||||
/* Sidebar */
|
/* Sidebar */
|
||||||
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
|
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
|
||||||
--sidebar-muted-color: #6d6c6b;
|
--sidebar-muted-color: #6d6c6b;
|
||||||
--sidebar-active-color: rgb(255 255 255 / 80%);
|
--sidebar-active-color: rgb(255, 255, 255, 0.8);
|
||||||
--nav-cursor-color: rgb(183, 182, 182);
|
--nav-cursor-color: rgb(183, 182, 182);
|
||||||
--sidebar-btn-bg: rgb(117 116 116 / 20%);
|
--sidebar-btn-bg: rgb(117, 116, 116, 0.2);
|
||||||
|
|
||||||
/* Topbar */
|
/* Topbar */
|
||||||
--topbar-text-color: var(--text-color);
|
--topbar-text-color: var(--text-color);
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
--btn-paginator-hover-color: rgb(64, 65, 66);
|
--btn-paginator-hover-color: rgb(64, 65, 66);
|
||||||
--btn-paginator-border-color: var(--btn-border-color);
|
--btn-paginator-border-color: var(--btn-border-color);
|
||||||
--btn-text-color: var(--text-color);
|
--btn-text-color: var(--text-color);
|
||||||
--pin-bg: rgb(34 35 37);
|
--pin-bg: rgb(34, 35, 37);
|
||||||
--pin-color: inherit;
|
--pin-color: inherit;
|
||||||
|
|
||||||
/* Posts */
|
/* Posts */
|
||||||
@@ -64,19 +64,19 @@
|
|||||||
--relate-post-date: var(--text-muted-color);
|
--relate-post-date: var(--text-muted-color);
|
||||||
--card-bg: rgb(39, 40, 43);
|
--card-bg: rgb(39, 40, 43);
|
||||||
--card-border-color: rgb(53, 53, 60);
|
--card-border-color: rgb(53, 53, 60);
|
||||||
--card-box-shadow: var(--main-wrapper-bg);
|
--card-box-shadow: var(--main-bg);
|
||||||
--preview-img-bg: radial-gradient(circle, rgb(22 22 24) 0%, rgb(32 32 32) 100%);
|
--preview-img-bg: radial-gradient(circle, rgb(22, 22, 24) 0%, rgb(32, 32, 32) 100%);
|
||||||
--kbd-wrap-color: #6a6a6a;
|
--kbd-wrap-color: #6a6a6a;
|
||||||
--kbd-text-color: #d3d3d3;
|
--kbd-text-color: #d3d3d3;
|
||||||
--kbd-bg-color: #242424;
|
--kbd-bg-color: #242424;
|
||||||
--prompt-text-color: rgb(216 212 212 / 75%);
|
--prompt-text-color: rgb(216, 212, 212, 0.75);
|
||||||
--prompt-tip-bg: rgba(77, 187, 95, 0.2);
|
--prompt-tip-bg: rgba(77, 187, 95, 0.2);
|
||||||
--prompt-tip-icon-color: rgb(5 223 5 / 68%);
|
--prompt-tip-icon-color: rgb(5, 223, 5, 0.68);
|
||||||
--prompt-info-bg: rgb(7 59 104 / 80%);
|
--prompt-info-bg: rgb(7, 59, 104, 0.8);
|
||||||
--prompt-info-icon-color: #0075d1;
|
--prompt-info-icon-color: #0075d1;
|
||||||
--prompt-warning-bg: rgb(90 69 3 / 95%);
|
--prompt-warning-bg: rgb(90, 69, 3, 0.95);
|
||||||
--prompt-warning-icon-color: rgb(255 165 0 / 80%);
|
--prompt-warning-icon-color: rgb(255, 165, 0, 0.8);
|
||||||
--prompt-danger-bg: rgb(86 28 8 / 80%);
|
--prompt-danger-bg: rgb(86, 28, 8, 0.8);
|
||||||
--prompt-danger-icon-color: #cd0202;
|
--prompt-danger-icon-color: #cd0202;
|
||||||
|
|
||||||
/* tags */
|
/* tags */
|
||||||
@@ -96,6 +96,7 @@
|
|||||||
--timeline-year-dot-color: var(--timeline-color);
|
--timeline-year-dot-color: var(--timeline-color);
|
||||||
|
|
||||||
.post img[data-src] {
|
.post img[data-src] {
|
||||||
|
-webkit-filter: brightness(95%);
|
||||||
filter: brightness(95%);
|
filter: brightness(95%);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,11 +105,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* posts' toc, override BS */
|
/* posts' toc, override BS */
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -150,8 +151,7 @@
|
|||||||
|
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
|
|
||||||
#disqus_thread {
|
#disqus_thread { /* stylelint-disable-line selector-id-pattern */
|
||||||
color-scheme: none;
|
color-scheme: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* dark-scheme */
|
} /* dark-scheme */
|
||||||
|
|||||||
@@ -76,9 +76,8 @@
|
|||||||
--code-header-icon-color: #d1d1d1;
|
--code-header-icon-color: #d1d1d1;
|
||||||
--clipboard-checked-color: #43c743;
|
--clipboard-checked-color: #43c743;
|
||||||
|
|
||||||
[class^=prompt-] {
|
[class^="prompt-"] {
|
||||||
--inline-code-bg: #fbfafa;
|
--inline-code-bg: #fbfafa;
|
||||||
--highlighter-rouge-color: rgb(82 82 82);
|
--highlighter-rouge-color: rgb(82, 82, 82);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* light-syntax */
|
} /* light-syntax */
|
||||||
|
|||||||
@@ -6,18 +6,18 @@
|
|||||||
/* Framework color */
|
/* Framework color */
|
||||||
--body-bg: #fafafa;
|
--body-bg: #fafafa;
|
||||||
--mask-bg: #c1c3c5;
|
--mask-bg: #c1c3c5;
|
||||||
--main-wrapper-bg: white;
|
--main-bg: white;
|
||||||
--main-border-color: #f3f3f3;
|
--main-border-color: #f3f3f3;
|
||||||
|
|
||||||
/* Common color */
|
/* Common color */
|
||||||
--text-color: #34343c;
|
--text-color: #34343c;
|
||||||
--text-muted-color: gray;
|
--text-muted-color: gray;
|
||||||
--heading-color: black;
|
--heading-color: black;
|
||||||
--blockquote-border-color: #eee;
|
--blockquote-border-color: #eeeeee;
|
||||||
--blockquote-text-color: #9a9a9a;
|
--blockquote-text-color: #9a9a9a;
|
||||||
--link-color: #2a408e;
|
--link-color: #2a408e;
|
||||||
--link-underline-color: #dee2e6;
|
--link-underline-color: #dee2e6;
|
||||||
--button-bg: #fff;
|
--button-bg: #ffffff;
|
||||||
--btn-border-color: #e9ecef;
|
--btn-border-color: #e9ecef;
|
||||||
--btn-backtotop-color: #686868;
|
--btn-backtotop-color: #686868;
|
||||||
--btn-backtotop-border-color: #f1f1f1;
|
--btn-backtotop-border-color: #f1f1f1;
|
||||||
@@ -35,8 +35,8 @@
|
|||||||
/* Topbar */
|
/* Topbar */
|
||||||
--topbar-text-color: rgb(78, 78, 78);
|
--topbar-text-color: rgb(78, 78, 78);
|
||||||
--topbar-wrapper-bg: white;
|
--topbar-wrapper-bg: white;
|
||||||
--search-wrapper-bg: rgb(245 245 245 / 50%);
|
--search-wrapper-bg: rgb(245, 245, 245, 0.5);
|
||||||
--search-wrapper-border-color: rgb(245 245 245);
|
--search-wrapper-border-color: rgb(245, 245, 245);
|
||||||
--search-tag-bg: #f8f9fa;
|
--search-tag-bg: #f8f9fa;
|
||||||
--search-icon-color: #c2c6cc;
|
--search-icon-color: #c2c6cc;
|
||||||
--input-focus-border-color: var(--btn-border-color);
|
--input-focus-border-color: var(--btn-border-color);
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
/* 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.76);
|
||||||
--label-color: #616161;
|
--label-color: #616161;
|
||||||
--relate-post-date: rgba(30, 55, 70, 0.4);
|
--relate-post-date: rgba(30, 55, 70, 0.4);
|
||||||
--footnote-target-bg: lightcyan;
|
--footnote-target-bg: lightcyan;
|
||||||
@@ -64,22 +64,22 @@
|
|||||||
--tb-odd-bg: #fbfcfd;
|
--tb-odd-bg: #fbfcfd;
|
||||||
--tb-border-color: #eaeaea;
|
--tb-border-color: #eaeaea;
|
||||||
--dash-color: silver;
|
--dash-color: silver;
|
||||||
--preview-img-bg: radial-gradient(circle, rgb(255 255 255) 0%, rgb(249 249 249) 100%);
|
--preview-img-bg: radial-gradient(circle, rgb(255, 255, 255) 0%, rgb(249, 249, 249) 100%);
|
||||||
--kbd-wrap-color: #bdbdbd;
|
--kbd-wrap-color: #bdbdbd;
|
||||||
--kbd-text-color: var(--text-color);
|
--kbd-text-color: var(--text-color);
|
||||||
--kbd-bg-color: white;
|
--kbd-bg-color: white;
|
||||||
--prompt-text-color: rgb(46 46 46 / 77%);
|
--prompt-text-color: rgb(46, 46, 46, 0.77);
|
||||||
--prompt-tip-bg: rgb(123 247 144 / 20%);
|
--prompt-tip-bg: rgb(123, 247, 144, 0.2);
|
||||||
--prompt-tip-icon-color: #03b303;
|
--prompt-tip-icon-color: #03b303;
|
||||||
--prompt-info-bg: #e1f5fe;
|
--prompt-info-bg: #e1f5fe;
|
||||||
--prompt-info-icon-color: #0070cb;
|
--prompt-info-icon-color: #0070cb;
|
||||||
--prompt-warning-bg: rgb(255 243 205);
|
--prompt-warning-bg: rgb(255, 243, 205);
|
||||||
--prompt-warning-icon-color: #ef9c03;
|
--prompt-warning-icon-color: #ef9c03;
|
||||||
--prompt-danger-bg: rgb(248 215 218 / 56%);
|
--prompt-danger-bg: rgb(248, 215, 218, 0.56);
|
||||||
--prompt-danger-icon-color: #df3c30;
|
--prompt-danger-icon-color: #df3c30;
|
||||||
|
|
||||||
[class^=prompt-] {
|
[class^="prompt-"] {
|
||||||
--link-underline-color: rgb(219 216 216);
|
--link-underline-color: rgb(219, 216, 216);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Categories */
|
/* Categories */
|
||||||
@@ -90,5 +90,4 @@
|
|||||||
--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;
|
||||||
|
|
||||||
} /* light-scheme */
|
} /* light-scheme */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* The styles for Jekyll theme Chirpy
|
* The styles for Jekyll theme Chirpy
|
||||||
*
|
*
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,139 +2,128 @@
|
|||||||
Style for Archives
|
Style for Archives
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%date-timeline {
|
|
||||||
content: "";
|
|
||||||
width: 4px;
|
|
||||||
left: 75px;
|
|
||||||
display: inline-block;
|
|
||||||
float: left;
|
|
||||||
position: relative;
|
|
||||||
background-color: var(--timeline-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
#archives {
|
#archives {
|
||||||
letter-spacing: 0.03rem;
|
letter-spacing: 0.03rem;
|
||||||
|
|
||||||
span.lead {
|
$timeline-width: 4px;
|
||||||
|
|
||||||
|
%timeline {
|
||||||
|
content: "";
|
||||||
|
width: $timeline-width;
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
background-color: var(--timeline-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.year {
|
||||||
|
height: 3.5rem;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 8px;
|
left: 2px;
|
||||||
|
margin-left: -$timeline-width;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
@extend %timeline;
|
||||||
|
|
||||||
|
height: 72px;
|
||||||
|
left: 79px;
|
||||||
|
bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child::before {
|
||||||
|
@extend %timeline;
|
||||||
|
|
||||||
|
height: 32px;
|
||||||
|
top: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
&::after { /* Year dot */
|
&::after { /* Year dot */
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
-webkit-border-radius: 50%;
|
|
||||||
-moz-border-radius: 50%;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
top: -26px;
|
left: 21.5px;
|
||||||
left: 63px;
|
|
||||||
border: 3px solid;
|
border: 3px solid;
|
||||||
background-color: var(--timeline-year-dot-color);
|
background-color: var(--timeline-year-dot-color);
|
||||||
border-color: var(--timeline-node-bg);
|
border-color: var(--timeline-node-bg);
|
||||||
box-shadow: 0 0 2px 0 #c2c6cc;
|
box-shadow: 0 0 2px 0 #c2c6cc;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
&:not(:first-child) {
|
|
||||||
position: relative;
|
|
||||||
left: 4px;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
left: 67px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // #archives span.lead
|
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
li {
|
li {
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
line-height: 3rem;
|
line-height: 3rem;
|
||||||
|
white-space: nowrap;
|
||||||
div {
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
a {
|
|
||||||
/* post title in Archvies */
|
|
||||||
margin-left: 2.5rem;
|
|
||||||
position: relative;
|
|
||||||
top: 0.1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:nth-child(odd) {
|
&:nth-child(odd) {
|
||||||
background-color: var(--main-wrapper-bg, #fff);
|
background-color: var(--main-bg, #ffffff);
|
||||||
background-image: linear-gradient(to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
background-image: linear-gradient(to left, #ffffff, #fbfbfb, #fbfbfb, #fbfbfb, #ffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::before {
|
||||||
@extend %date-timeline;
|
@extend %timeline;
|
||||||
|
|
||||||
height: 2.8rem;
|
top: 0;
|
||||||
top: -1.3rem;
|
left: 77px;
|
||||||
}
|
height: 3.1rem;
|
||||||
|
|
||||||
&:first-child::before {
|
|
||||||
@extend %date-timeline;
|
|
||||||
|
|
||||||
height: 3.06rem;
|
|
||||||
top: -1.61rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(:last-child) > li:last-child::after {
|
&:last-child li:last-child::before {
|
||||||
height: 3.4rem;
|
height: 1.5rem;
|
||||||
}
|
}
|
||||||
|
} /* #archives ul */
|
||||||
&:last-child > li:last-child::after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
} // #archives ul
|
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
right: 0.5rem;
|
||||||
|
|
||||||
&.month {
|
&.month {
|
||||||
width: 1.4rem;
|
width: 1.4rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
~ a::before {
|
|
||||||
/* A dot for Month and Day */
|
|
||||||
content: "";
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
-webkit-border-radius: 50%;
|
|
||||||
-moz-border-radius: 50%;
|
|
||||||
border-radius: 50%;
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
float: left;
|
|
||||||
top: 1.35rem;
|
|
||||||
left: 69px;
|
|
||||||
background-color: var(--timeline-node-bg);
|
|
||||||
box-shadow: 0 0 3px 0 #c2c6cc;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.day {
|
&.day {
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
font-family: 'Lato', sans-serif;
|
font-family: Lato, sans-serif;
|
||||||
text-align: center;
|
|
||||||
margin-right: -2px;
|
|
||||||
width: 1.2rem;
|
|
||||||
position: relative;
|
|
||||||
left: -0.15rem;
|
|
||||||
}
|
}
|
||||||
} // #archives .date
|
}
|
||||||
|
|
||||||
} // #archives
|
a {
|
||||||
|
/* post title in Archvies */
|
||||||
|
margin-left: 2.5rem;
|
||||||
|
position: relative;
|
||||||
|
top: 0.1rem;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
/* the dot before post title */
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
float: left;
|
||||||
|
top: 1.35rem;
|
||||||
|
left: 71px;
|
||||||
|
background-color: var(--timeline-node-bg);
|
||||||
|
box-shadow: 0 0 3px 0 #c2c6cc;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* #archives */
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
#archives {
|
#archives {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
i {
|
i {
|
||||||
@extend %category-icon-color;
|
@extend %category-icon-color;
|
||||||
|
|
||||||
font-size: 86%; // fontawesome icons
|
font-size: 86%; /* fontawesome icons */
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
@@ -28,10 +28,8 @@
|
|||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} /* .categories */
|
||||||
} // .categories
|
|
||||||
|
|
||||||
.category-trigger {
|
.category-trigger {
|
||||||
width: 1.7rem;
|
width: 1.7rem;
|
||||||
@@ -40,28 +38,29 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: #6c757d !important;
|
color: #6c757d !important;
|
||||||
|
|
||||||
|
i {
|
||||||
|
position: relative;
|
||||||
|
height: 0.7rem;
|
||||||
|
width: 1rem;
|
||||||
|
transition: -webkit-transform 300ms ease;
|
||||||
|
transition: transform 300ms ease;
|
||||||
|
transition: transform 300ms ease, -webkit-transform 300ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
i {
|
i {
|
||||||
color: var(--categories-icon-hover-color);
|
color: var(--categories-icon-hover-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
|
||||||
position: relative;
|
|
||||||
height: 0.7rem;
|
|
||||||
width: 1rem;
|
|
||||||
transition: transform 300ms ease;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (hover: hover) { // only works on desktop
|
@media (hover: hover) { /* only works on desktop */
|
||||||
.category-trigger:hover {
|
.category-trigger:hover {
|
||||||
background-color: var(--categories-hover-bg);
|
background-color: var(--categories-hover-bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.rotate {
|
.rotate {
|
||||||
-ms-transform: rotate(-90deg); /* IE 9 */
|
-webkit-transform: rotate(-90deg);
|
||||||
-webkit-transform: rotate(-90deg); /* Safari 3-8 */
|
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
padding: 0.6rem 0;
|
padding: 0.6rem 0;
|
||||||
|
|
||||||
&::before { // dot
|
&::before { /* dot */
|
||||||
background: #999;
|
background: #999999;
|
||||||
width: 5px;
|
width: 5px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#page-tag h1 > i { // tag icon
|
#page-tag h1 > i { /* tag icon */
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
a:hover {
|
a:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
|
|
||||||
margin-bottom: -1px; // Avoid jumping
|
margin-bottom: -1px; /* Avoid jumping */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
color: var(--btn-patinator-text-color);
|
color: var(--btn-patinator-text-color);
|
||||||
font-family: 'Lato', sans-serif;
|
font-family: Lato, sans-serif;
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -49,9 +49,8 @@
|
|||||||
&:last-child .page-link {
|
&:last-child .page-link {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
} // .page-item
|
} /* .page-item */
|
||||||
|
} /* .pagination */
|
||||||
} // .pagination
|
|
||||||
|
|
||||||
#post-list {
|
#post-list {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
@@ -83,6 +82,19 @@
|
|||||||
em {
|
em {
|
||||||
@extend %normal-font-style;
|
@extend %normal-font-style;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pin {
|
||||||
|
i {
|
||||||
|
-webkit-transform: rotate(45deg);
|
||||||
|
transform: rotate(45deg);
|
||||||
|
padding-left: 3px;
|
||||||
|
color: var(--pin-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
@@ -100,21 +112,8 @@
|
|||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} /* .post-preview */
|
||||||
.pin {
|
} /* #post-list */
|
||||||
> i {
|
|
||||||
transform: rotate(45deg);
|
|
||||||
padding-left: 3px;
|
|
||||||
color: var(--pin-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
> span {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // .post-preview
|
|
||||||
} // #post-list
|
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 830px) {
|
||||||
@@ -125,9 +124,7 @@
|
|||||||
&:not(:first-child):not(:last-child) {
|
&:not(:first-child):not(:last-child) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,18 +162,15 @@
|
|||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-index {
|
.page-index {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
} /* .pagination */
|
||||||
} // .pagination
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pannel hidden */
|
/* Panel hidden */
|
||||||
@media all and (max-width: 1200px) {
|
@media all and (max-width: 1200px) {
|
||||||
#post-list {
|
#post-list {
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
|
|||||||
@@ -26,6 +26,15 @@
|
|||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img.preview-img {
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 6px;
|
||||||
|
|
||||||
|
&.bg[data-loaded="true"] {
|
||||||
|
background: var(--preview-img-bg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h1 + .post-meta {
|
h1 + .post-meta {
|
||||||
span + span::before {
|
span + span::before {
|
||||||
@include dot;
|
@include dot;
|
||||||
@@ -40,23 +49,96 @@ h1 + .post-meta {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img.preview-img {
|
|
||||||
margin: 0;
|
|
||||||
border-radius: 6px;
|
|
||||||
|
|
||||||
&.bg[data-loaded=true] {
|
|
||||||
background: var(--preview-img-bg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-tail-wrapper {
|
.post-tail-wrapper {
|
||||||
margin-top: 6rem;
|
margin-top: 6rem;
|
||||||
border-bottom: 1px double var(--main-border-color);
|
border-bottom: 1px double var(--main-border-color);
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
|
|
||||||
|
.post-tail-bottom a {
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.license-wrapper {
|
||||||
|
line-height: 1.2rem;
|
||||||
|
|
||||||
|
> a {
|
||||||
|
color: var(--text-color);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
@extend %link-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
span:last-child {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
} /* .license-wrapper */
|
||||||
|
|
||||||
.post-meta a:not(:hover) {
|
.post-meta a:not(:hover) {
|
||||||
@extend %link-underline;
|
@extend %link-underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.share-wrapper {
|
||||||
|
vertical-align: middle;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
.share-icons {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
|
||||||
|
> i {
|
||||||
|
position: relative;
|
||||||
|
bottom: 1px;
|
||||||
|
|
||||||
|
@extend %cursor-pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
@extend %btn-share-hovor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
&:not(:last-child) {
|
||||||
|
margin-right: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
>i {
|
||||||
|
@extend %btn-share-hovor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fab {
|
||||||
|
&.fa-twitter {
|
||||||
|
@include btn-sharing-color(rgba(29, 161, 242, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fa-facebook-square {
|
||||||
|
@include btn-sharing-color(rgb(66, 95, 156));
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fa-telegram {
|
||||||
|
@include btn-sharing-color(rgb(39, 159, 217));
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fa-linkedin {
|
||||||
|
@include btn-sharing-color(rgb(0, 119, 181));
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fa-weibo {
|
||||||
|
@include btn-sharing-color(rgb(229, 20, 43));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* .share-icons */
|
||||||
|
|
||||||
|
.fas.fa-link {
|
||||||
|
@include btn-sharing-color(rgb(171, 171, 171));
|
||||||
|
}
|
||||||
|
} /* .share-wrapper */
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tags {
|
.post-tags {
|
||||||
@@ -74,7 +156,7 @@ img.preview-img {
|
|||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: #2a408e;
|
background: #2a408e;
|
||||||
color: #fff;
|
color: #ffffff;
|
||||||
border-color: #2a408e;
|
border-color: #2a408e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,15 +203,29 @@ img.preview-img {
|
|||||||
margin-top: 0.3rem;
|
margin-top: 0.3rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* .post-navigation */
|
} /* .post-navigation */
|
||||||
|
|
||||||
|
@-webkit-keyframes fade-up {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
position: relative;
|
||||||
|
top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes fade-up {
|
@keyframes fade-up {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 2rem;
|
top: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -143,19 +239,23 @@ img.preview-img {
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 4rem;
|
top: 4rem;
|
||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
|
-webkit-animation: fade-up 0.8s;
|
||||||
animation: fade-up 0.8s;
|
animation: fade-up 0.8s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#toc li a {
|
#toc {
|
||||||
font-size: 0.8rem;
|
ul.nav.navbar-nav {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
&.nav-link:not(.active) {
|
li {
|
||||||
color: inherit;
|
padding-top: 2px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nav[data-toggle=toc] {
|
nav[data-toggle="toc"] {
|
||||||
.nav {
|
.nav {
|
||||||
.nav > li > a.active {
|
.nav > li > a.active {
|
||||||
font-weight: 600 !important;
|
font-weight: 600 !important;
|
||||||
@@ -176,25 +276,6 @@ nav[data-toggle=toc] {
|
|||||||
color: var(--relate-post-date);
|
color: var(--relate-post-date);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
|
||||||
border-color: var(--card-border-color);
|
|
||||||
background-color: var(--card-bg);
|
|
||||||
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
|
||||||
-webkit-transition: all 0.3s ease-in-out;
|
|
||||||
-moz-transition: all 0.3s ease-in-out;
|
|
||||||
transition: all 0.3s ease-in-out;
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
@extend %text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
-webkit-transform: translate3d(0, -3px, 0);
|
|
||||||
transform: translate3d(0, -3px, 0);
|
|
||||||
box-shadow: 0 10px 15px -4px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
@@ -209,20 +290,20 @@ nav[data-toggle=toc] {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
.card {
|
||||||
list-style-type: none;
|
border-color: var(--card-border-color);
|
||||||
padding-inline-start: 1.5rem;
|
background-color: var(--card-bg);
|
||||||
|
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
||||||
|
transition: all 0.3s ease-in-out;
|
||||||
|
|
||||||
> li::before {
|
h3 {
|
||||||
background: #c2c9d4;
|
@extend %text-color;
|
||||||
width: 5px;
|
}
|
||||||
height: 5px;
|
|
||||||
border-radius: 1px;
|
&:hover {
|
||||||
display: block;
|
-webkit-transform: translate3d(0, -3px, 0);
|
||||||
content: "";
|
transform: translate3d(0, -3px, 0);
|
||||||
position: relative;
|
box-shadow: 0 10px 15px -4px rgba(0, 0, 0, 0.15);
|
||||||
top: 1rem;
|
|
||||||
right: 1rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,78 +315,15 @@ nav[data-toggle=toc] {
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#disqus_thread {
|
#disqus_thread { /* stylelint-disable-line selector-id-pattern */
|
||||||
min-height: 8.5rem;
|
min-height: 8.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-tail-bottom a {
|
|
||||||
color: inherit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%btn-share-hovor {
|
%btn-share-hovor {
|
||||||
color: var(--btn-share-hover-color) !important;
|
color: var(--btn-share-hover-color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-wrapper {
|
|
||||||
vertical-align: middle;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
.share-icons {
|
|
||||||
font-size: 1.2rem;
|
|
||||||
|
|
||||||
a {
|
|
||||||
&:not(:last-child) {
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
> i {
|
|
||||||
@extend %btn-share-hovor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> i {
|
|
||||||
position: relative;
|
|
||||||
bottom: 1px;
|
|
||||||
|
|
||||||
@extend %cursor-pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
@extend %btn-share-hovor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fab {
|
|
||||||
&.fa-twitter {
|
|
||||||
@include btn-sharing-color(rgba(29, 161, 242, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fa-facebook-square {
|
|
||||||
@include btn-sharing-color(rgb(66, 95, 156));
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fa-telegram {
|
|
||||||
@include btn-sharing-color(rgb(39, 159, 217));
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fa-weibo {
|
|
||||||
@include btn-sharing-color(rgb(229, 20, 43));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* .share-icons */
|
|
||||||
|
|
||||||
.fas.fa-link {
|
|
||||||
@include btn-sharing-color(rgb(171, 171, 171));
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* .share-wrapper */
|
|
||||||
|
|
||||||
.share-label {
|
.share-label {
|
||||||
@include label(inherit, 400, inherit);
|
@include label(inherit, 400, inherit);
|
||||||
|
|
||||||
@@ -314,30 +332,12 @@ nav[data-toggle=toc] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.license-wrapper {
|
|
||||||
line-height: 1.2rem;
|
|
||||||
|
|
||||||
> a {
|
|
||||||
color: var(--text-color);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
@extend %link-hover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
span:last-child {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* .license-wrapper */
|
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
.preview-img[data-src] {
|
.preview-img[data-src] {
|
||||||
margin-top: 2.2rem;
|
margin-top: 2.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tail-bottom {
|
.post-tail-bottom {
|
||||||
-ms-flex-wrap: wrap-reverse !important;
|
|
||||||
flex-wrap: wrap-reverse !important;
|
flex-wrap: wrap-reverse !important;
|
||||||
|
|
||||||
> div:first-child {
|
> div:first-child {
|
||||||
|
|||||||
@@ -14,6 +14,6 @@
|
|||||||
span {
|
span {
|
||||||
margin-left: 0.6em;
|
margin-left: 0.6em;
|
||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
font-family: 'Oswald', sans-serif;
|
font-family: Oswald, sans-serif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
title: About
|
# the default layout is 'page'
|
||||||
icon: fas fa-info-circle
|
icon: fas fa-info-circle
|
||||||
order: 4
|
order: 4
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
---
|
---
|
||||||
layout: archives
|
layout: archives
|
||||||
title: Archives
|
|
||||||
icon: fas fa-archive
|
icon: fas fa-archive
|
||||||
order: 3
|
order: 3
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
layout: categories
|
layout: categories
|
||||||
title: Categories
|
|
||||||
icon: fas fa-stream
|
icon: fas fa-stream
|
||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
layout: tags
|
layout: tags
|
||||||
title: Tags
|
|
||||||
icon: fas fa-tag
|
icon: fas fa-tag
|
||||||
order: 2
|
order: 2
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ redirect_from:
|
|||||||
- /posts/
|
- /posts/
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
<div class="lead">
|
<div class="lead">
|
||||||
<p>{{site.data.locales[lang].not_found.statment }}</p>
|
<p>{{site.data.locales[site.lang].not_found.statment }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ swcache: true
|
|||||||
"tags": {{ post.tags | join: ', ' | jsonify }},
|
"tags": {{ post.tags | join: ', ' | jsonify }},
|
||||||
"date": "{{ post.date }}",
|
"date": "{{ post.date }}",
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
"snippet": {{ content | strip_html | strip_newlines | jsonify }}
|
{% assign _content = content | strip_html | strip_newlines %}
|
||||||
|
"snippet": {{ _content | truncate: 200 | jsonify }},
|
||||||
|
"content": {{ _content | jsonify }}
|
||||||
}{% unless forloop.last %},{% endunless %}
|
}{% unless forloop.last %},{% endunless %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -5,51 +5,50 @@ layout: compress
|
|||||||
---
|
---
|
||||||
|
|
||||||
const resource = [
|
const resource = [
|
||||||
|
/* --- CSS --- */
|
||||||
|
'{{ "/assets/css/style.css" | relative_url }}',
|
||||||
|
|
||||||
/* --- CSS --- */
|
/* --- PWA --- */
|
||||||
'{{ "/assets/css/style.css" | relative_url }}',
|
'{{ "/app.js" | relative_url }}',
|
||||||
|
'{{ "/sw.js" | relative_url }}',
|
||||||
|
|
||||||
/* --- PWA --- */
|
/* --- HTML --- */
|
||||||
'{{ "/app.js" | relative_url }}',
|
'{{ "/index.html" | relative_url }}',
|
||||||
'{{ "/sw.js" | relative_url }}',
|
'{{ "/404.html" | relative_url }}',
|
||||||
|
|
||||||
/* --- HTML --- */
|
{% for tab in site.tabs %}
|
||||||
'{{ "/index.html" | relative_url }}',
|
'{{ tab.url | relative_url }}',
|
||||||
'{{ "/404.html" | relative_url }}',
|
{% endfor %}
|
||||||
{% for tab in site.tabs %}
|
|
||||||
'{{ tab.url | relative_url }}',
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
/* --- Favicons & compressed JS --- */
|
|
||||||
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
|
||||||
{% for file in cache_list %}
|
|
||||||
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
|
/* --- Favicons & compressed JS --- */
|
||||||
|
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
||||||
|
{% for file in cache_list %}
|
||||||
|
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
||||||
|
{% endfor %}
|
||||||
];
|
];
|
||||||
|
|
||||||
/* The request url with below domain will be cached */
|
/* The request url with below domain will be cached */
|
||||||
const allowedDomains = [
|
const allowedDomains = [
|
||||||
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
||||||
'www.googletagmanager.com',
|
'www.googletagmanager.com',
|
||||||
'www.google-analytics.com',
|
'www.google-analytics.com',
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
'{{ site.url | split: "//" | last }}',
|
'{{ site.url | split: "//" | last }}',
|
||||||
|
|
||||||
{% if site.img_cdn contains '//' and site.img_cdn %}
|
{% if site.img_cdn contains '//' and site.img_cdn %}
|
||||||
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
'fonts.gstatic.com',
|
'fonts.gstatic.com',
|
||||||
'fonts.googleapis.com',
|
'fonts.googleapis.com',
|
||||||
'cdn.jsdelivr.net',
|
'cdn.jsdelivr.net',
|
||||||
'polyfill.io'
|
'polyfill.io'
|
||||||
];
|
];
|
||||||
|
|
||||||
/* Requests that include the following path will be banned */
|
/* Requests that include the following path will be banned */
|
||||||
const denyUrls = [
|
const denyUrls = [
|
||||||
{% if site.google_analytics.pv.cache_path %}
|
{% if site.google_analytics.pv.cache_path %}
|
||||||
'{{ site.google_analytics.pv.cache_path | absolute_url }}'
|
'{{ site.google_analytics.pv.cache_path | absolute_url }}'
|
||||||
{% endif %}
|
{% endif %}
|
||||||
];
|
];
|
||||||
|
|||||||
4
assets/js/dist/categories.min.js
vendored
4
assets/js/dist/categories.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{const e=$(o.target);let t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();t.blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,a=!1,r=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,a=a||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===a,unlockTopbar:()=>a=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),a=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),a.addClass("unloaded"),e.addClass("unloaded"),r.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),r.removeClass("d-flex"),o.removeClass("unloaded"),a.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function u(){return t.hasClass("loaded")}e.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?u()?c.removeClass("unloaded"):f.off():(f.on(),u()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function a(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||a()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&a()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var e="div.post>h1:first-of-type";const t=$(e),n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=t.text().trim(),a=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(l);let o=new IntersectionObserver(o=>{var e,t;a?(t=$(window).scrollTop(),e=r<t,r=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):a=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});o.observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),$(function(){const o=$(".collapse");o.on("hide.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$("#"+o).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$("#"+o).addClass("hide-border-bottom"))})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{o=$(o.target);(o.prop("tagName")==="button".toUpperCase()?o:o.parent()).blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let a=0,r=!1,l=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{a+=1,r=r||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===l,lockOrientation:()=>l=!0,unLockOrientation:()=>l=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),a=$("#main"),r=$("#topbar-title"),l=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),r.addClass("unloaded"),e.addClass("unloaded"),l.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),l.removeClass("d-flex"),o.removeClass("unloaded"),r.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function u(){return t.hasClass("loaded")}e.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){l.addClass("input-focus")}),i.focusout(function(){l.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?u()?c.removeClass("unloaded"):f.off():(f.on(),u()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,a=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(a-o)<=t)){if(o>a)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=o}}(),o=!1)},250)}),$(function(){var o="div.post>h1:first-of-type",e=$(o);const n=$("#topbar-title");if(0!==e.length&&!e.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=e.text().trim(),r=!1,l=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),e.offset().top<$(window).scrollTop()&&n.text(a);new IntersectionObserver(o=>{var e,t;r?(t=$(window).scrollTop(),e=l<t,l=t,t=o[0],e?0===t.intersectionRatio&&n.text(a):1===t.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(o)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),$(function(){var o=$(".collapse");o.on("hide.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$("#"+o).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){var o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$("#"+o).addClass("hide-border-bottom"))})});
|
||||||
|
|||||||
4
assets/js/dist/commons.min.js
vendored
4
assets/js/dist/commons.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{const e=$(o.target);let t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();t.blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,r=!1,a=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,r=r||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===a,lockOrientation:()=>a=!0,unLockOrientation:()=>a=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),r=$("#topbar-title"),a=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),r.addClass("unloaded"),e.addClass("unloaded"),a.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),a.removeClass("d-flex"),o.removeClass("unloaded"),r.removeClass("unloaded"),e.removeClass("unloaded")}},u=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function f(){return t.hasClass("loaded")}e.click(function(){p.on(),u.on(),i.focus()}),t.click(function(){p.off(),u.off()}),i.focus(function(){a.addClass("input-focus")}),i.focusout(function(){a.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var e="div.post>h1:first-of-type";const t=$(e),n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=t.text().trim(),r=!1,a=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(l);let o=new IntersectionObserver(o=>{var e,t;r?(t=$(window).scrollTop(),e=a<t,a=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});o.observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(o=>{o=$(o.target);(o.prop("tagName")==="button".toUpperCase()?o:o.parent()).blur(),flipMode()})});const ScrollHelper=function(){const o=$("body"),e="data-topbar-visible",t=$("#topbar-wrapper").outerHeight();let l=0,r=!1,a=!1;return{hideTopbar:()=>o.attr(e,!1),showTopbar:()=>o.attr(e,!0),addScrollUpTask:()=>{l+=1,r=r||!0},popScrollUpTask:()=>--l,hasScrollUpTask:()=>0<l,topbarLocked:()=>!0===r,unlockTopbar:()=>r=!1,getTopbarHeight:()=>t,orientationLocked:()=>!0===a,lockOrientation:()=>a=!0,unLockOrientation:()=>a=!1}}();$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),t=$("#search-cancel"),l=$("#main"),r=$("#topbar-title"),a=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset(){return o}}}(),p={on(){o.addClass("unloaded"),r.addClass("unloaded"),e.addClass("unloaded"),a.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),a.removeClass("d-flex"),o.removeClass("unloaded"),r.removeClass("unloaded"),e.removeClass("unloaded")}},u=function(){let o=!1;return{on(){o||(d.block(),n.removeClass("unloaded"),l.addClass("unloaded"),o=!0)},off(){o&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),l.removeClass("unloaded"),d.release(),i.val(""),o=!1)},isVisible(){return o}}}();function f(){return t.hasClass("loaded")}e.click(function(){p.on(),u.on(),i.focus()}),t.click(function(){p.off(),u.off()}),i.focus(function(){a.addClass("input-focus")}),i.focusout(function(){a.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var o=function(){const o="sidebar-display";let e=!1;const t=$("body");return{toggle(){!1===e?t.attr(o,""):t.removeAttr(o),e=!e}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#search-input"),t=ScrollHelper.getTopbarHeight();let o,l=0;function r(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var o=screen.orientation.type;"landscape-primary"!==o&&"landscape-secondary"!==o||r()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&r()}),$(window).scroll(()=>{o=o||!0}),setInterval(()=>{o&&(!function(){var o=$(this).scrollTop();if(!(Math.abs(l-o)<=t)){if(o>l)ScrollHelper.hideTopbar(),e.is(":focus")&&e.blur();else if(o+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}l=o}}(),o=!1)},250)}),$(function(){var o="div.post>h1:first-of-type",e=$(o);const n=$("#topbar-title");if(0!==e.length&&!e.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let l=e.text().trim(),r=!1,a=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(l)&&(l=l.replace(/[0-9]/g,"").trim()),e.offset().top<$(window).scrollTop()&&n.text(l);new IntersectionObserver(o=>{var e,t;r?(t=$(window).scrollTop(),e=a<t,a=t,t=o[0],e?0===t.intersectionRatio&&n.text(l):1===t.intersectionRatio&&n.text(s)):r=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(o)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}});
|
||||||
|
|||||||
4
assets/js/dist/home.min.js
vendored
4
assets/js/dist/home.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const t=$(e.target);let o=t.prop("tagName")==="button".toUpperCase()?t:t.parent();o.blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var t="div.post>h1:first-of-type";const o=$(t),n=$("#topbar-title");if(0!==o.length&&!o.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=o.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),o.offset().top<$(window).scrollTop()&&n.text(a);let e=new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});e.observe(document.querySelector(t)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$('meta[name="prefer-datetime-locale"]'),t=0<e.length?e.attr("content").toLowerCase():$("html").attr("lang").substr(0,2),o="data-ts",a="data-df";return{locale:()=>t,attrTimestamp:()=>o,attrDateFormat:()=>a,getTimestamp:e=>Number(e.attr(o)),getDateFormat:e=>e.attr(a)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){const e=dayjs.unix(LocaleHelper.getTimestamp($(this)));var t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{e=$(e.target);(e.prop("tagName")==="button".toUpperCase()?e:e.parent()).blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var e="div.post>h1:first-of-type",t=$(e);const n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=t.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(a);new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$("html").attr("lang").substr(0,2),t="data-ts",o="data-df";return{locale:()=>e,attrTimestamp:()=>t,attrDateFormat:()=>o,getTimestamp:e=>Number(e.attr(t)),getDateFormat:e=>e.attr(o)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){var e=dayjs.unix(LocaleHelper.getTimestamp($(this))),t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
||||||
|
|||||||
4
assets/js/dist/misc.min.js
vendored
4
assets/js/dist/misc.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const t=$(e.target);let o=t.prop("tagName")==="button".toUpperCase()?t:t.parent();o.blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var t="div.post>h1:first-of-type";const o=$(t),n=$("#topbar-title");if(0!==o.length&&!o.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=o.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),o.offset().top<$(window).scrollTop()&&n.text(a);let e=new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]});e.observe(document.querySelector(t)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$('meta[name="prefer-datetime-locale"]'),t=0<e.length?e.attr("content").toLowerCase():$("html").attr("lang").substr(0,2),o="data-ts",a="data-df";return{locale:()=>t,attrTimestamp:()=>o,attrDateFormat:()=>a,getTimestamp:e=>Number(e.attr(o)),getDateFormat:e=>e.attr(a)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){const e=dayjs.unix(LocaleHelper.getTimestamp($(this)));var t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{e=$(e.target);(e.prop("tagName")==="button".toUpperCase()?e:e.parent()).blur(),flipMode()})});const ScrollHelper=function(){const e=$("body"),t="data-topbar-visible",o=$("#topbar-wrapper").outerHeight();let a=0,l=!1,r=!1;return{hideTopbar:()=>e.attr(t,!1),showTopbar:()=>e.attr(t,!0),addScrollUpTask:()=>{a+=1,l=l||!0},popScrollUpTask:()=>--a,hasScrollUpTask:()=>0<a,topbarLocked:()=>!0===l,unlockTopbar:()=>l=!1,getTopbarHeight:()=>o,orientationLocked:()=>!0===r,lockOrientation:()=>r=!0,unLockOrientation:()=>r=!1}}(),LocaleHelper=($(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),s=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),d=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),t.addClass("unloaded"),r.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),t.removeClass("unloaded")}},u=function(){let e=!1;return{on(){e||(d.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(s.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),a.removeClass("unloaded"),d.release(),i.val(""),e=!1)},isVisible(){return e}}}();function f(){return o.hasClass("loaded")}t.click(function(){p.on(),u.on(),i.focus()}),o.click(function(){p.off(),u.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("input",()=>{""===i.val()?f()?c.removeClass("unloaded"):u.off():(u.on(),f()&&c.addClass("unloaded"))})}),$(function(){var e=function(){const e="sidebar-display";let t=!1;const o=$("body");return{toggle(){!1===t?o.attr(e,""):o.removeAttr(e),t=!t}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#search-input"),o=ScrollHelper.getTopbarHeight();let e,a=0;function l(){0!==$(window).scrollTop()&&(ScrollHelper.lockOrientation(),ScrollHelper.hideTopbar())}screen.orientation?screen.orientation.onchange=()=>{var e=screen.orientation.type;"landscape-primary"!==e&&"landscape-secondary"!==e||l()}:$(window).on("orientationchange",()=>{$(window).width()<$(window).height()&&l()}),$(window).scroll(()=>{e=e||!0}),setInterval(()=>{e&&(!function(){var e=$(this).scrollTop();if(!(Math.abs(a-e)<=o)){if(e>a)ScrollHelper.hideTopbar(),t.is(":focus")&&t.blur();else if(e+$(window).height()<$(document).height()){if(ScrollHelper.hasScrollUpTask())return;ScrollHelper.topbarLocked()?ScrollHelper.unlockTopbar():ScrollHelper.orientationLocked()?ScrollHelper.unLockOrientation():ScrollHelper.showTopbar()}a=e}}(),e=!1)},250)}),$(function(){var e="div.post>h1:first-of-type",t=$(e);const n=$("#topbar-title");if(0!==t.length&&!t.hasClass("dynamic-title")&&!n.is(":hidden")){const s=n.text().trim();let a=t.text().trim(),l=!1,r=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),t.offset().top<$(window).scrollTop()&&n.text(a);new IntersectionObserver(e=>{var t,o;l?(o=$(window).scrollTop(),t=r<o,r=o,o=e[0],t?0===o.intersectionRatio&&n.text(a):1===o.intersectionRatio&&n.text(s)):l=!0},{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(e)),n.click(function(){$("body,html").animate({scrollTop:0},800)})}}),function(){const e=$("html").attr("lang").substr(0,2),t="data-ts",o="data-df";return{locale:()=>e,attrTimestamp:()=>t,attrDateFormat:()=>o,getTimestamp:e=>Number(e.attr(t)),getDateFormat:e=>e.attr(o)}}());$(function(){dayjs.locale(LocaleHelper.locale()),dayjs.extend(window.dayjs_plugin_localizedFormat),$(`[${LocaleHelper.attrTimestamp()}]`).each(function(){var e=dayjs.unix(LocaleHelper.getTimestamp($(this))),t=e.format(LocaleHelper.getDateFormat($(this))),t=($(this).text(t),$(this).removeAttr(LocaleHelper.attrTimestamp()),$(this).removeAttr(LocaleHelper.attrDateFormat()),$(this).attr("data-toggle"));void 0!==t&&"tooltip"===t&&(t=e.format("llll"),$(this).attr("data-original-title",t))})});
|
||||||
|
|||||||
4
assets/js/dist/page.min.js
vendored
4
assets/js/dist/page.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/dist/post.min.js
vendored
4
assets/js/dist/post.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/dist/pvreport.min.js
vendored
4
assets/js/dist/pvreport.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v5.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.3.2 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
const getInitStatus=function(){let t=!1;return()=>{var e=t;return t=t||!0,e}}(),PvOpts=function(){function t(e){return $(e).attr("content")}function e(e){e=t(e);return void 0!==e&&!1!==e}return{getProxyMeta(){return t("meta[name=pv-proxy-endpoint]")},getLocalMeta(){return t("meta[name=pv-cache-path]")},hasProxyMeta(){return e("meta[name=pv-proxy-endpoint]")},hasLocalMeta(){return e("meta[name=pv-cache-path]")}}}(),PvStorage=function(){const a={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t={LOCAL:"same-origin",PROXY:"cors"};function r(e){return localStorage.getItem(e)}function o(e,t){localStorage.setItem(e,t)}function n(e,t){o(a.KEY_PV,e),o(a.KEY_PV_SRC,t),o(a.KEY_CREATION,(new Date).toJSON())}return{keysCount(){return Object.keys(a).length},hasCache(){return null!==localStorage.getItem(a.KEY_PV)},getCache(){return JSON.parse(localStorage.getItem(a.KEY_PV))},saveLocalCache(e){n(e,t.LOCAL)},saveProxyCache(e){n(e,t.PROXY)},isExpired(){let e=new Date(r(a.KEY_CREATION));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()},isFromLocal(){return r(a.KEY_PV_SRC)===t.LOCAL},isFromProxy(){return r(a.KEY_PV_SRC)===t.PROXY},newerThan(e){return PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"]},inspectKeys(){if(localStorage.length!==PvStorage.keysCount())localStorage.clear();else for(let e=0;e<localStorage.length;e++)switch(localStorage.key(e)){case a.KEY_PV:case a.KEY_PV_SRC:case a.KEY_CREATION:break;default:return void localStorage.clear()}}}}();function countUp(t,a,r){if(t<a){let e=new CountUp(r,t,a);e.error?console.error(e.error):e.start()}}function countPV(t,a){let r=0;if(void 0!==a)for(let e=0;e<a.length;++e)if(a[parseInt(e,10)][0]===t){r+=parseInt(a[parseInt(e,10)][1],10);break}return r}function tacklePV(e,t,a,r){let o=countPV(t,e);o=0===o?1:o,r?(t=parseInt(a.text().replace(/,/g,""),10),o>t&&countUp(t,o,a.attr("id"))):a.text((new Intl.NumberFormat).format(o))}function displayPageviews(e){if(void 0!==e){let t=getInitStatus();const a=e.rows;0<$("#post-list").length?$(".post-preview").each(function(){var e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)}):0<$(".post").length&&(e=window.location.pathname,tacklePV(a,e,$("#pv"),t))}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(t=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(e=>{t&&PvStorage.isFromProxy()&&PvStorage.newerThan(e)||(displayPageviews(e),PvStorage.saveLocalCache(JSON.stringify(e)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
const getInitStatus=function(){let t=!1;return()=>{var e=t;return t=t||!0,e}}(),PvOpts=function(){function t(e){return $(e).attr("content")}function e(e){e=t(e);return void 0!==e&&!1!==e}return{getProxyMeta(){return t("meta[name=pv-proxy-endpoint]")},getLocalMeta(){return t("meta[name=pv-cache-path]")},hasProxyMeta(){return e("meta[name=pv-proxy-endpoint]")},hasLocalMeta(){return e("meta[name=pv-cache-path]")}}}(),PvStorage=function(){const a={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t={LOCAL:"same-origin",PROXY:"cors"};function r(e){return localStorage.getItem(e)}function o(e,t){localStorage.setItem(e,t)}function n(e,t){o(a.KEY_PV,e),o(a.KEY_PV_SRC,t),o(a.KEY_CREATION,(new Date).toJSON())}return{keysCount(){return Object.keys(a).length},hasCache(){return null!==localStorage.getItem(a.KEY_PV)},getCache(){return JSON.parse(localStorage.getItem(a.KEY_PV))},saveLocalCache(e){n(e,t.LOCAL)},saveProxyCache(e){n(e,t.PROXY)},isExpired(){var e=new Date(r(a.KEY_CREATION));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()},isFromLocal(){return r(a.KEY_PV_SRC)===t.LOCAL},isFromProxy(){return r(a.KEY_PV_SRC)===t.PROXY},newerThan(e){return PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"]},inspectKeys(){if(localStorage.length!==PvStorage.keysCount())localStorage.clear();else for(let e=0;e<localStorage.length;e++)switch(localStorage.key(e)){case a.KEY_PV:case a.KEY_PV_SRC:case a.KEY_CREATION:break;default:return void localStorage.clear()}}}}();function countUp(e,t,a){e<t&&((a=new CountUp(a,e,t)).error?console.error(a.error):a.start())}function countPV(t,a){let r=0;if(void 0!==a)for(let e=0;e<a.length;++e)if(a[parseInt(e,10)][0]===t){r+=parseInt(a[parseInt(e,10)][1],10);break}return r}function tacklePV(e,t,a,r){t=0===(t=countPV(t,e))?1:t;r?(e=parseInt(a.text().replace(/,/g,""),10))<t&&countUp(e,t,a.attr("id")):a.text((new Intl.NumberFormat).format(t))}function displayPageviews(e){if(void 0!==e){let t=getInitStatus();const a=e.rows;0<$("#post-list").length?$(".post-preview").each(function(){var e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)}):0<$(".post").length&&(e=window.location.pathname,tacklePV(a,e,$("#pv"),t))}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(t=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(e=>{t&&PvStorage.isFromProxy()&&PvStorage.newerThan(e)||(displayPageviews(e),PvStorage.saveLocalCache(JSON.stringify(e)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user