mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-26 17:42:38 +00:00
Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeb2d57b60 | ||
|
|
2406ce1dc8 | ||
|
|
bec9246823 | ||
|
|
adaefc02e9 | ||
|
|
ee7266ff0d | ||
|
|
cad62feb91 | ||
|
|
b85cb39388 | ||
|
|
4360e2938c | ||
|
|
ecf31ff308 | ||
|
|
37344ef0df | ||
|
|
9e2a4fc8c9 | ||
|
|
fc71289dc8 | ||
|
|
c8fd0d728d | ||
|
|
ef2aa525d5 | ||
|
|
1fe0b2958b | ||
|
|
e466a643d5 | ||
|
|
f7ec9cd24a | ||
|
|
3342abc9e6 | ||
|
|
d47ec035d3 | ||
|
|
a403ffee42 | ||
|
|
d315bf57e7 | ||
|
|
75176522e3 | ||
|
|
ebb3dc940c | ||
|
|
c02c9c6a04 | ||
|
|
3a4316b29b | ||
|
|
f4b2dfe8b4 | ||
|
|
09e8eb4274 | ||
|
|
5ca0966c41 | ||
|
|
d919f833f1 | ||
|
|
df81012e28 | ||
|
|
09742d40dd | ||
|
|
259d0deabc | ||
|
|
cf6c8e9b3a | ||
|
|
c64e587335 | ||
|
|
415f11ecb8 | ||
|
|
5dc830d11e | ||
|
|
7579644e8d | ||
|
|
4cff83268b | ||
|
|
1487ae5284 | ||
|
|
697c584b48 | ||
|
|
089a19bc9e | ||
|
|
007d242e87 | ||
|
|
6447ffaf59 | ||
|
|
790cf30376 | ||
|
|
45adf4aac2 | ||
|
|
b1377ac694 | ||
|
|
cf8dae9454 | ||
|
|
9f5e579596 | ||
|
|
99e468cae5 | ||
|
|
4fde37e879 | ||
|
|
19debc4add | ||
|
|
afcf0bde22 | ||
|
|
36f55f091d | ||
|
|
e2003f2b03 | ||
|
|
563e8085e8 | ||
|
|
902546cf4d | ||
|
|
e06d237eae | ||
|
|
6220d09ffb | ||
|
|
3c91dc1f6f | ||
|
|
6a65f3a7f7 | ||
|
|
57feaa660e | ||
|
|
db9cfc270b | ||
|
|
3caacbee61 | ||
|
|
b518c9d3bc | ||
|
|
1c758cf4a2 | ||
|
|
df3a703988 | ||
|
|
12407bbfc0 | ||
|
|
55fce7574c | ||
|
|
833b6c9d5c | ||
|
|
a34b77969f | ||
|
|
707466b1df | ||
|
|
602e98448d | ||
|
|
0bf7a8f1d9 | ||
|
|
a7361717a6 | ||
|
|
e880448ba5 | ||
|
|
c28b6ce7d1 | ||
|
|
b7cc22983f | ||
|
|
a1551cd740 | ||
|
|
35c4d480ed | ||
|
|
b5c26fed08 | ||
|
|
2dc2175723 | ||
|
|
2f79b8d408 | ||
|
|
cbe6c3fb7b | ||
|
|
bb1188a01a | ||
|
|
406ed520cb | ||
|
|
1d7a134dd5 | ||
|
|
421db9dc92 | ||
|
|
a5b8e7862b | ||
|
|
30d3249782 | ||
|
|
fa15aebbca | ||
|
|
565ad9229c | ||
|
|
3d6304efd8 | ||
|
|
80fd684577 | ||
|
|
80980465d7 | ||
|
|
2858a082a3 | ||
|
|
9b0b7d7772 | ||
|
|
952b1f493b | ||
|
|
a887f1d57d |
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
@@ -1,3 +1,2 @@
|
|||||||
custom:
|
ko_fi: coteschung
|
||||||
- https://www.buymeacoffee.com/coteschung
|
custom: https://cotes.gitee.io/alipay-wechat-donation
|
||||||
- https://cotes.gitee.io/alipay-wechat-donation
|
|
||||||
|
|||||||
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
13
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -6,12 +6,15 @@ about: Create a report to help us improve
|
|||||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
||||||
- [ ] I have read the [tutorials](https://chirpy.cotes.info/categories/tutorial/) and know the correct effect of the functional design.
|
|
||||||
- [ ] There are no similar reports on existing issues (including closed ones).
|
- [ ] I have read the [tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
|
||||||
|
- [ ] There are no similar reports on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
|
||||||
- [ ] I found the bug on the latest code of the `master` branch.
|
- [ ] I found the bug on the latest code of the `master` branch.
|
||||||
|
|
||||||
## Describe the bug
|
## Describe the bug
|
||||||
|
|
||||||
<!-- A clear and concise description of what the bug is. -->
|
<!-- A clear and concise description of what the bug is. -->
|
||||||
|
|
||||||
### To Reproduce
|
### To Reproduce
|
||||||
@@ -25,12 +28,15 @@ Steps to reproduce the behavior:
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
### Expected behavior
|
### Expected behavior
|
||||||
|
|
||||||
<!-- A clear and concise description of what you expected to happen. -->
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
### Screenshots
|
### Screenshots
|
||||||
|
|
||||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||||
|
|
||||||
### Software
|
### Software
|
||||||
|
|
||||||
<!-- Please complete the following information -->
|
<!-- Please complete the following information -->
|
||||||
- Ruby version: <!-- by running: `ruby -v` -->
|
- Ruby version: <!-- by running: `ruby -v` -->
|
||||||
- Gem version: <!-- by running: `gem -v`-->
|
- Gem version: <!-- by running: `gem -v`-->
|
||||||
@@ -39,12 +45,14 @@ Steps to reproduce the behavior:
|
|||||||
- Theme version: <!-- by running: `gem list | grep jekyll-theme-chirpy` -->
|
- Theme version: <!-- by running: `gem list | grep jekyll-theme-chirpy` -->
|
||||||
|
|
||||||
### Desktop
|
### Desktop
|
||||||
|
|
||||||
<!-- If necessary, uncomment and fill in the following list:
|
<!-- If necessary, uncomment and fill in the following list:
|
||||||
- OS: [e.g. macOS 10.15.6]
|
- OS: [e.g. macOS 10.15.6]
|
||||||
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
|
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Smartphone
|
### Smartphone
|
||||||
|
|
||||||
<!-- If necessary, uncomment and fill in the following list:
|
<!-- If necessary, uncomment and fill in the following list:
|
||||||
- Device: [e.g. iPhone 6]
|
- Device: [e.g. iPhone 6]
|
||||||
- OS: [e.g. iOS 13.6.1]
|
- OS: [e.g. iOS 13.6.1]
|
||||||
@@ -52,4 +60,5 @@ Steps to reproduce the behavior:
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
### Additional context
|
### Additional context
|
||||||
|
|
||||||
<!-- Add any other context about the problem here. -->
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|||||||
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -7,24 +7,29 @@ labels: enhancement
|
|||||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
||||||
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
|
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
|
||||||
- [ ] There is no similar request on existing issues (including closed ones).
|
- [ ] There is no similar request on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
|
||||||
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
|
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
|
||||||
- [ ] I was in the `master` branch of the latest code.
|
- [ ] I was in the `master` branch of the latest code.
|
||||||
|
|
||||||
|
|
||||||
## Is your feature request related to a problem? Please describe
|
## Is your feature request related to a problem? Please describe
|
||||||
|
|
||||||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||||
|
|
||||||
|
|
||||||
## Describe the solution you'd like
|
## Describe the solution you'd like
|
||||||
|
|
||||||
<!-- A clear and concise description of what you want to happen. -->
|
<!-- A clear and concise description of what you want to happen. -->
|
||||||
|
|
||||||
|
|
||||||
## Describe alternatives you've considered
|
## Describe alternatives you've considered
|
||||||
|
|
||||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||||
|
|
||||||
|
|
||||||
## Additional context
|
## Additional context
|
||||||
|
|
||||||
<!-- Add any other context or screenshots about the feature request here. -->
|
<!-- Add any other context or screenshots about the feature request here. -->
|
||||||
|
|||||||
9
.github/ISSUE_TEMPLATE/question.md
vendored
9
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Question
|
name: Question
|
||||||
about: Ask what ever you want
|
about: Ask whatever you want
|
||||||
labels: question
|
labels: question
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -10,10 +10,11 @@ labels: question
|
|||||||
|
|
||||||
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
|
||||||
|
|
||||||
- [ ] I have read the [tutorials](https://chirpy.cotes.info/categories/tutorial/) and know the correct effect of the functional design.
|
- [ ] I have read the [newlest tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
|
||||||
- [ ] There is no similar question on existing issues (including closed ones).
|
- [ ] There is no similar question on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
|
||||||
- [ ] I searched the Internet for related problems, but still couldn't solve them.
|
- [ ] I have tried to find the answer on [Jekyll Forum](https://talk.jekyllrb.com/) and [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll).
|
||||||
- [ ] My question is based on the latest code of the `master` branch.
|
- [ ] My question is based on the latest code of the `master` branch.
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
<!-- Please describe your question in detail. -->
|
<!-- Please describe your question in detail. -->
|
||||||
|
|||||||
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -29,16 +29,14 @@ Please describe the tests that you ran to verify your changes. Provide instructi
|
|||||||
|
|
||||||
- Browser type & version:
|
- Browser type & version:
|
||||||
- Operating system:
|
- Operating system:
|
||||||
- Bundler version:
|
- Ruby version: <!-- by running: `ruby -v` -->
|
||||||
- Ruby version:
|
- Bundler version: <!-- by running: `bundle -v`-->
|
||||||
- Jekyll version:
|
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
|
||||||
|
|
||||||
### Checklist
|
### Checklist
|
||||||
|
|
||||||
<!-- Select checkboxes by change the "[ ]" to "[x]" -->
|
<!-- Select checkboxes by change the "[ ]" to "[x]" -->
|
||||||
- [ ] My code follows the [Google style guidelines](https://google.github.io/styleguide/)
|
- [ ] I have performed a self-review of my code
|
||||||
- [ ] I have performed a self-review of my own code
|
|
||||||
- [ ] I have commented on my code, particularly in hard-to-understand areas
|
- [ ] I have commented on my code, particularly in hard-to-understand areas
|
||||||
- [ ] I have made corresponding changes to the documentation
|
- [ ] I have made corresponding changes to the documentation
|
||||||
- [ ] My changes generate no new warnings
|
- [ ] My changes generate no new warnings
|
||||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
||||||
- [ ] Any dependent changes have been merged and published in downstream modules
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -16,9 +16,9 @@
|
|||||||
[](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)
|
||||||
|
|
||||||
[**Live Demo →**](https://chirpy.cotes.info)
|
[**Live Demo →**](https://cotes2020.github.io/chirpy-demo)
|
||||||
|
|
||||||
[](https://chirpy.cotes.info)
|
[](https://cotes2020.github.io/chirpy-demo)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ Now publish your Jekyll site by:
|
|||||||
|
|
||||||
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.
|
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ The merge is likely to conflict with your local modifications. Please be patient
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
For more details and a better reading experience, please check out the [tutorials on the demo site](https://chirpy.cotes.info/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Please note that the tutorials on the demo website or Wiki are based on the latest release, and the features of `master` branch are usually ahead of the documentation.
|
For more details and a better reading experience, please check out the [tutorials on the demo site](https://cotes2020.github.io/chirpy-demo/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Please note that the tutorials on the demo website or Wiki are based on the latest release, and the features of `master` branch are usually ahead of the documentation.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ Last but not least, thank [JetBrains][jb] for providing the open source license.
|
|||||||
|
|
||||||
If you like this theme or find it helpful, please consider sponsoring me, because it will encourage and help me better maintain the project, I will be very grateful!
|
If you like this theme or find it helpful, please consider sponsoring me, because it will encourage and help me better maintain the project, I will be very grateful!
|
||||||
|
|
||||||
[](https://www.buymeacoffee.com/coteschung)
|
[](https://ko-fi.com/coteschung)
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
|
|
||||||
|
|||||||
16
_config.yml
16
_config.yml
@@ -79,7 +79,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://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5'
|
img_cdn: 'https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@f4e0354b674f65a53b8917f0f786ed2956898cc1'
|
||||||
|
|
||||||
# the avatar on sidebar, support local or CORS resources
|
# the avatar on sidebar, support local or CORS resources
|
||||||
avatar: '/commons/avatar.jpg'
|
avatar: '/commons/avatar.jpg'
|
||||||
@@ -87,9 +87,15 @@ avatar: '/commons/avatar.jpg'
|
|||||||
# boolean type, the global switch for ToC in posts.
|
# boolean type, the global switch for ToC in posts.
|
||||||
toc: true
|
toc: true
|
||||||
|
|
||||||
disqus:
|
comments:
|
||||||
comments: false # boolean type, the global switch for posts comments.
|
active: # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable
|
||||||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
# The active options are as follows:
|
||||||
|
disqus:
|
||||||
|
shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||||
|
# utterances settings › https://utteranc.es/
|
||||||
|
utterances:
|
||||||
|
repo: # <gh-username>/<repo>
|
||||||
|
issue_term: # < url | pathname | title | ...>
|
||||||
|
|
||||||
paginate: 10
|
paginate: 10
|
||||||
|
|
||||||
@@ -111,7 +117,6 @@ collections:
|
|||||||
output: true
|
output: true
|
||||||
sort_by: order
|
sort_by: order
|
||||||
|
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
-
|
-
|
||||||
scope:
|
scope:
|
||||||
@@ -136,7 +141,6 @@ defaults:
|
|||||||
values:
|
values:
|
||||||
layout: page
|
layout: page
|
||||||
permalink: /:title/
|
permalink: /:title/
|
||||||
dynamic_title: true # Hide title in mobile screens.
|
|
||||||
|
|
||||||
sass:
|
sass:
|
||||||
style: compressed
|
style: compressed
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ not_found:
|
|||||||
# ----- Posts related labels -----
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
post:
|
post:
|
||||||
published: 'on'
|
written_by: By
|
||||||
|
posted: Posted
|
||||||
updated: Updated
|
updated: Updated
|
||||||
timeago:
|
timeago:
|
||||||
day: days ago
|
day: days ago
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ not_found:
|
|||||||
# ----- Posts related labels -----
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
post:
|
post:
|
||||||
published: "pada"
|
written_by: Oleh
|
||||||
|
posted: Diterbitkan
|
||||||
updated: Diperbarui
|
updated: Diperbarui
|
||||||
timeago:
|
timeago:
|
||||||
day: hari yang lalu
|
day: hari yang lalu
|
||||||
|
|||||||
91
_data/locales/ko-KR.yml
Normal file
91
_data/locales/ko-KR.yml
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# The layout text of site
|
||||||
|
|
||||||
|
# ----- Commons label -----
|
||||||
|
|
||||||
|
layout:
|
||||||
|
post: 포스트
|
||||||
|
category: 카테고리
|
||||||
|
tag: 태그
|
||||||
|
|
||||||
|
# The tabs of sidebar
|
||||||
|
tabs:
|
||||||
|
# format: <filename_without_extension>: <value>
|
||||||
|
home: 홈
|
||||||
|
categories: 카테고리
|
||||||
|
tags: 태그
|
||||||
|
archives: 아카이브
|
||||||
|
about: 정보
|
||||||
|
|
||||||
|
# the text displayed in the search bar & search results
|
||||||
|
search:
|
||||||
|
hint: 검색
|
||||||
|
cancel: 취소
|
||||||
|
no_results: 검색 결과가 없습니다.
|
||||||
|
|
||||||
|
panel:
|
||||||
|
lastmod: 최근 업데이트
|
||||||
|
trending_tags: 인기 태그
|
||||||
|
toc: 바로가기
|
||||||
|
|
||||||
|
# The liquid date format › http://strftime.net/
|
||||||
|
date_format:
|
||||||
|
tooltip: '%F, %R %z'
|
||||||
|
post:
|
||||||
|
long: '%Y년 %m월 %d일'
|
||||||
|
short: '%m월 %d일'
|
||||||
|
archive_month: '%b월'
|
||||||
|
|
||||||
|
copyright:
|
||||||
|
# Shown at the bottom of the post
|
||||||
|
license:
|
||||||
|
template: 이 기사는 저작권자의 :LICENSE_NAME 라이센스를 따릅니다.
|
||||||
|
name: CC BY 4.0
|
||||||
|
link: https://creativecommons.org/licenses/by/4.0/
|
||||||
|
|
||||||
|
# Displayed in the footer
|
||||||
|
brief: 일부 권리 보유
|
||||||
|
verbose: >-
|
||||||
|
명시되지 않는 한 이 사이트의 블로그 게시물은 작성자의
|
||||||
|
Creative Commons Attribution 4.0 International(CC BY 4.0) 라이선스에 따라 사용이 허가되었습니다.
|
||||||
|
|
||||||
|
meta: Powered by :PLATFORM with :THEME theme.
|
||||||
|
|
||||||
|
not_found:
|
||||||
|
statment: 해당 URL은 존재하지 않습니다.
|
||||||
|
hint_template: :HEAD_BAK을 눌러 다시 찾거나 :ARCHIVES_PAGE에서 검색해 주세요.
|
||||||
|
head_back: 홈으로 돌아가기
|
||||||
|
archives_page: 아카이브 페이지
|
||||||
|
|
||||||
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
|
post:
|
||||||
|
written_by: By
|
||||||
|
posted: 게시
|
||||||
|
updated: 업데이트
|
||||||
|
timeago:
|
||||||
|
day: 일 전
|
||||||
|
hour: 시간 전
|
||||||
|
minute: 분 전
|
||||||
|
just_now: 방금
|
||||||
|
words: 단어
|
||||||
|
pageview_measure: 조회
|
||||||
|
read_time:
|
||||||
|
unit: 분
|
||||||
|
prompt: 읽는 시간
|
||||||
|
relate_posts: 관련된 글
|
||||||
|
share: 공유하기
|
||||||
|
button:
|
||||||
|
next: 다음 글
|
||||||
|
previous: 이전 글
|
||||||
|
copy_code:
|
||||||
|
succeed: 복사되었습니다!
|
||||||
|
share_link:
|
||||||
|
title: 링크 복사하기
|
||||||
|
succeed: 링크가 복사되었습니다!
|
||||||
|
# pinned prompt of posts list on homepage
|
||||||
|
pin_prompt: 핀
|
||||||
|
|
||||||
|
# categories page
|
||||||
|
categories:
|
||||||
|
category_measure: 카테고리
|
||||||
|
post_measure: 포스트
|
||||||
@@ -58,7 +58,8 @@ not_found:
|
|||||||
# ----- Posts related labels -----
|
# ----- Posts related labels -----
|
||||||
|
|
||||||
post:
|
post:
|
||||||
published: 发表于
|
written_by: 作者
|
||||||
|
posted: 发表于
|
||||||
updated: 更新于
|
updated: 更新于
|
||||||
timeago:
|
timeago:
|
||||||
day: 天前
|
day: 天前
|
||||||
|
|||||||
5
_includes/comments.html
Normal file
5
_includes/comments.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<!-- The comments switcher -->
|
||||||
|
{% if page.comments and site.comments.active %}
|
||||||
|
{% capture path %}comments/{{ site.comments.active }}.html{% endcapture %}
|
||||||
|
{% include {{ path }} %}
|
||||||
|
{% endif %}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
The Disqus lazy loading.
|
The Disqus lazy loading.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<div id="disqus_thread" class="pt-2 pb-2">
|
<div id="disqus_thread" class="pt-2 pb-2">
|
||||||
<p class="text-center text-muted small">
|
<p class="text-center text-muted small">
|
||||||
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
||||||
@@ -9,6 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var disqus_config = function () {
|
var disqus_config = function () {
|
||||||
this.page.url = '{{ page.url | absolute_url }}';
|
this.page.url = '{{ page.url | absolute_url }}';
|
||||||
this.page.identifier = '{{ page.url }}';
|
this.page.identifier = '{{ page.url }}';
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
if(entries[0].isIntersecting) {
|
if(entries[0].isIntersecting) {
|
||||||
(function () {
|
(function () {
|
||||||
var d = document, s = d.createElement('script');
|
var d = document, s = d.createElement('script');
|
||||||
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
|
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
|
||||||
s.setAttribute('data-timestamp', +new Date());
|
s.setAttribute('data-timestamp', +new Date());
|
||||||
(d.head || d.body).appendChild(s);
|
(d.head || d.body).appendChild(s);
|
||||||
})();
|
})();
|
||||||
@@ -46,8 +46,8 @@
|
|||||||
|
|
||||||
const modeToggle = document.querySelector(".mode-toggle");
|
const modeToggle = document.querySelector(".mode-toggle");
|
||||||
|
|
||||||
if (modeToggle !== null) {
|
if (typeof modeToggle !== "undefined") {
|
||||||
modeToggle.addEventListener('click', reloadDisqus);
|
/* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
|
||||||
}
|
}
|
||||||
|
|
||||||
51
_includes/comments/utterances.html
Normal file
51
_includes/comments/utterances.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<!-- https://utteranc.es/ -->
|
||||||
|
<script src="https://utteranc.es/client.js"
|
||||||
|
repo="{{ site.comments.utterances.repo }}"
|
||||||
|
issue-term="{{ site.comments.utterances.issue_term }}"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
const origin = "https://utteranc.es";
|
||||||
|
const iframe = "iframe.utterances-frame";
|
||||||
|
const lightTheme = "github-light";
|
||||||
|
const darkTheme = "github-dark";
|
||||||
|
let initTheme = lightTheme;
|
||||||
|
|
||||||
|
if ($("html[mode=dark]").length > 0
|
||||||
|
|| ($("html[mode]").length == 0
|
||||||
|
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
||||||
|
initTheme = darkTheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
addEventListener("message", (event) => {
|
||||||
|
let theme;
|
||||||
|
|
||||||
|
/* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */
|
||||||
|
if (event.origin === origin) {
|
||||||
|
/* page initial */
|
||||||
|
theme = initTheme;
|
||||||
|
|
||||||
|
} else if (event.source === window && event.data &&
|
||||||
|
event.data.direction === ModeToggle.ID) {
|
||||||
|
/* global theme mode changed */
|
||||||
|
const mode = event.data.message;
|
||||||
|
theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = {
|
||||||
|
type: "set-theme",
|
||||||
|
theme: theme
|
||||||
|
};
|
||||||
|
|
||||||
|
const utterances = document.querySelector(iframe).contentWindow;
|
||||||
|
utterances.postMessage(message, origin);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<footer class="d-flex w-100 justify-content-center">
|
<footer class="d-flex w-100 justify-content-center">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center text-muted">
|
||||||
<div class="footer-left">
|
<div class="footer-left">
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
© {{ 'now' | date: "%Y" }}
|
© {{ 'now' | date: "%Y" }}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<!-- layout specified -->
|
<!-- layout specified -->
|
||||||
|
|
||||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
{% if page.layout == 'post' %}
|
||||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
||||||
<!-- pv-report needs countup.js -->
|
<!-- pv-report needs countup.js -->
|
||||||
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
||||||
|
|||||||
@@ -3,8 +3,34 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
function updateMermaid(event) {
|
||||||
|
if (event.source === window && event.data &&
|
||||||
|
event.data.direction === ModeToggle.ID) {
|
||||||
|
|
||||||
|
const mode = event.data.message;
|
||||||
|
|
||||||
|
if (typeof mermaid === "undefined") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let expectedTheme = (mode === ModeToggle.DARK_MODE? "dark" : "default");
|
||||||
|
let config = { theme: expectedTheme };
|
||||||
|
|
||||||
|
/* Re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
||||||
|
$(".mermaid").each(function() {
|
||||||
|
let svgCode = $(this).prev().children().html();
|
||||||
|
$(this).removeAttr("data-processed");
|
||||||
|
$(this).html(svgCode);
|
||||||
|
});
|
||||||
|
|
||||||
|
mermaid.initialize(config);
|
||||||
|
mermaid.init(undefined, ".mermaid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let initTheme = "default";
|
let initTheme = "default";
|
||||||
|
|
||||||
if ($("html[mode=dark]").length > 0
|
if ($("html[mode=dark]").length > 0
|
||||||
@@ -25,5 +51,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
mermaid.initialize(mermaidConf);
|
mermaid.initialize(mermaidConf);
|
||||||
|
|
||||||
|
window.addEventListener("message", updateMermaid);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
Switch the mode between dark and light.
|
Switch the mode between dark and light.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<i class="mode-toggle fas fa-adjust"></i>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
class ModeToggle {
|
class ModeToggle {
|
||||||
static get MODE_KEY() { return "mode"; }
|
static get MODE_KEY() { return "mode"; }
|
||||||
static get DARK_MODE() { return "dark"; }
|
static get DARK_MODE() { return "dark"; }
|
||||||
static get LIGHT_MODE() { return "light"; }
|
static get LIGHT_MODE() { return "light"; }
|
||||||
|
static get ID() { return "mode-toggle"; }
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (this.hasMode) {
|
if (this.hasMode) {
|
||||||
@@ -24,10 +22,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = this;
|
let self = this;
|
||||||
|
|
||||||
/* always follow the system prefers */
|
/* always follow the system prefers */
|
||||||
this.sysDarkPrefers.addListener(function() {
|
this.sysDarkPrefers.addEventListener("change", () => {
|
||||||
if (self.hasMode) {
|
if (self.hasMode) {
|
||||||
if (self.isDarkMode) {
|
if (self.isDarkMode) {
|
||||||
if (!self.isSysDarkPrefer) {
|
if (!self.isSysDarkPrefer) {
|
||||||
@@ -43,11 +41,33 @@
|
|||||||
self.clearMode();
|
self.clearMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
self.updateMermaid();
|
self.notify();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} /* constructor() */
|
} /* constructor() */
|
||||||
|
|
||||||
|
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
||||||
|
|
||||||
|
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
||||||
|
|
||||||
|
get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
|
||||||
|
|
||||||
|
get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
|
||||||
|
|
||||||
|
get hasMode() { return this.mode != null; }
|
||||||
|
|
||||||
|
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
||||||
|
|
||||||
|
/* get the current mode on screen */
|
||||||
|
get modeStatus() {
|
||||||
|
if (this.isDarkMode
|
||||||
|
|| (!this.hasMode && this.isSysDarkPrefer)) {
|
||||||
|
return ModeToggle.DARK_MODE;
|
||||||
|
} else {
|
||||||
|
return ModeToggle.LIGHT_MODE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setDark() {
|
setDark() {
|
||||||
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
|
||||||
@@ -64,82 +84,45 @@
|
|||||||
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
sessionStorage.removeItem(ModeToggle.MODE_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
|
/* Notify another plugins that the theme mode has changed */
|
||||||
|
notify() {
|
||||||
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
|
window.postMessage({
|
||||||
|
direction: ModeToggle.ID,
|
||||||
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
message: this.modeStatus
|
||||||
|
}, "*");
|
||||||
get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
|
||||||
|
|
||||||
get hasMode() { return this.mode != null; }
|
|
||||||
|
|
||||||
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
|
|
||||||
|
|
||||||
/* get the current mode on screen */
|
|
||||||
get modeStatus() {
|
|
||||||
if (this.isDarkMode
|
|
||||||
|| (!this.hasMode && this.isSysDarkPrefer) ) {
|
|
||||||
return ModeToggle.DARK_MODE;
|
|
||||||
} else {
|
|
||||||
return ModeToggle.LIGHT_MODE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMermaid() {
|
|
||||||
if (typeof mermaid !== "undefined") {
|
|
||||||
let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
|
|
||||||
let config = { theme: expectedTheme };
|
|
||||||
|
|
||||||
/* re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
|
||||||
$(".mermaid").each(function() {
|
|
||||||
let svgCode = $(this).prev().children().html();
|
|
||||||
$(this).removeAttr("data-processed");
|
|
||||||
$(this).html(svgCode);
|
|
||||||
});
|
|
||||||
|
|
||||||
mermaid.initialize(config);
|
|
||||||
mermaid.init(undefined, ".mermaid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flipMode() {
|
|
||||||
if (this.hasMode) {
|
|
||||||
if (this.isSysDarkPrefer) {
|
|
||||||
if (this.isLightMode) {
|
|
||||||
this.clearMode();
|
|
||||||
} else {
|
|
||||||
this.setLight();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (this.isDarkMode) {
|
|
||||||
this.clearMode();
|
|
||||||
} else {
|
|
||||||
this.setDark();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (this.isSysDarkPrefer) {
|
|
||||||
this.setLight();
|
|
||||||
} else {
|
|
||||||
this.setDark();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateMermaid();
|
|
||||||
|
|
||||||
} /* flipMode() */
|
|
||||||
|
|
||||||
} /* ModeToggle */
|
} /* ModeToggle */
|
||||||
|
|
||||||
let toggle = new ModeToggle();
|
const toggle = new ModeToggle();
|
||||||
|
|
||||||
$(".mode-toggle").click(function() {
|
function flipMode() {
|
||||||
|
if (toggle.hasMode) {
|
||||||
|
if (toggle.isSysDarkPrefer) {
|
||||||
|
if (toggle.isLightMode) {
|
||||||
|
toggle.clearMode();
|
||||||
|
} else {
|
||||||
|
toggle.setLight();
|
||||||
|
}
|
||||||
|
|
||||||
toggle.flipMode();
|
} else {
|
||||||
|
if (toggle.isDarkMode) {
|
||||||
|
toggle.clearMode();
|
||||||
|
} else {
|
||||||
|
toggle.setDark();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
} else {
|
||||||
|
if (toggle.isSysDarkPrefer) {
|
||||||
|
toggle.setLight();
|
||||||
|
} else {
|
||||||
|
toggle.setDark();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle.notify();
|
||||||
|
|
||||||
|
} /* flipMode() */
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
<!--
|
|
||||||
The Pannel on right side (Desktop views)
|
|
||||||
-->
|
|
||||||
|
|
||||||
{% include lang.html %}
|
|
||||||
|
|
||||||
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
|
||||||
|
|
||||||
<div class="access">
|
|
||||||
|
|
||||||
{% include update-list.html %}
|
|
||||||
|
|
||||||
{% if update_list.size > 0 %}
|
|
||||||
|
|
||||||
<div id="access-lastmod" class="post">
|
|
||||||
<span>{{- site.data.locales[lang].panel.lastmod -}}</span>
|
|
||||||
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
|
||||||
|
|
||||||
{% for item in update_list %}
|
|
||||||
{% assign index = item | split: "::" | last | plus: 0 %}
|
|
||||||
{% assign post = site.posts[index] %}
|
|
||||||
{% assign url = post.url | relative_url %}
|
|
||||||
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div> <!-- #access-lastmod -->
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
|
||||||
|
|
||||||
{% if trending_tags.size > 0 %}
|
|
||||||
<div id="access-tags">
|
|
||||||
<span>{{- site.data.locales[lang].panel.trending_tags -}}</span>
|
|
||||||
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
|
||||||
|
|
||||||
{% for tag_name in trending_tags %}
|
|
||||||
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div> <!-- .access -->
|
|
||||||
|
|
||||||
{% if include.toc %}
|
|
||||||
<!-- BS-toc.js will be loaded at medium priority -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
|
|
||||||
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
|
||||||
<span class="pl-3 pt-2 mb-2">
|
|
||||||
{{- site.data.locales[lang].panel.toc -}}
|
|
||||||
</span>
|
|
||||||
<nav id="toc" data-toggle="toc"></nav>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div> <!-- #panel-wrapper -->
|
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
<!-- 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[lang].post.words }}">
|
||||||
{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}
|
<em>{{- read_time -}}{{" "}}{{- site.data.locales[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 }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -38,63 +38,100 @@
|
|||||||
%}
|
%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<!-- images -->
|
<!-- images -->
|
||||||
|
|
||||||
{% if _content contains '<img src="' %}
|
{% assign IMG_TAG = '<img ' %}
|
||||||
|
|
||||||
<!-- add CDN prefix if it exists -->
|
|
||||||
|
|
||||||
{% if site.img_cdn != '' %}
|
|
||||||
{% assign img_path_replacement = '<img src="' | append: site.img_cdn | append: '/' %}
|
|
||||||
{% else %}
|
|
||||||
{% assign img_path_replacement = '<img src="' | append: site.baseurl | append: '/' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% assign _content = _content | replace: '<img src="/', img_path_replacement %}
|
|
||||||
|
|
||||||
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
|
||||||
|
|
||||||
{% assign _content = _content | replace: '<img src="', '<img data-proofer-ignore data-src="' %}
|
|
||||||
|
|
||||||
<!-- add image placehoder to prevent layout reflow -->
|
|
||||||
|
|
||||||
|
{% if _content contains IMG_TAG %}
|
||||||
{% assign _img_content = nil %}
|
{% assign _img_content = nil %}
|
||||||
|
{% assign _img_snippets = _content | split: IMG_TAG %}
|
||||||
|
|
||||||
{% assign _images = _content | split: '<img ' %}
|
{% for _img_snippet in _img_snippets %}
|
||||||
|
|
||||||
{% for _img in _images %}
|
|
||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
{% assign _img_content = _img %}
|
{% assign _img_content = _img_snippet %}
|
||||||
{% continue %}
|
{% continue %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% assign _width = nil %}
|
{% assign _width = nil %}
|
||||||
{% assign _height = nil %}
|
{% assign _height = nil %}
|
||||||
{% assign _attrs = _img | split: '>' | first | split: ' ' %}
|
{% assign _src = nil %}
|
||||||
|
|
||||||
|
{% assign _left = _img_snippet | split: '/>' | first %}
|
||||||
|
{% assign _right = _img_snippet | replace: _left, '' %}
|
||||||
|
|
||||||
|
{% assign _left = _left | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
|
||||||
|
{% assign _attrs = _left | split: ' ' %}
|
||||||
|
|
||||||
{% for _attr in _attrs %}
|
{% for _attr in _attrs %}
|
||||||
{% capture _key %}{{ _attr | split: '=' | first }}{% endcapture %}
|
{% assign _pair = _attr | split: '=' %}
|
||||||
{% capture _value %}{{ _attr | split: '=' | last | replace: '"', '' }}{% endcapture %}
|
{% if _pair.size < 2 %}
|
||||||
|
{% continue %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% capture _key %}{{ _pair | first }}{% endcapture %}
|
||||||
|
{% capture _value %}{{ _pair | last | replace: '"', '' }}{% endcapture %}
|
||||||
|
|
||||||
{% case _key %}
|
{% case _key %}
|
||||||
{% when 'width' %}
|
{% when 'width' %}
|
||||||
{% assign _width = _value %}
|
{% assign _width = _value %}
|
||||||
{% when 'height' %}
|
{% when 'height' %}
|
||||||
{% assign _height = _value %}
|
{% assign _height = _value %}
|
||||||
|
{% when 'src' %}
|
||||||
|
{% assign _src = _value %}
|
||||||
{% endcase %}
|
{% endcase %}
|
||||||
|
|
||||||
{% if _width and _height %}
|
{% if _width and _height and _src %}
|
||||||
{% capture _svg %}data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{_width}} {{_height}}'%3E%3C/svg%3E{% endcapture %}
|
|
||||||
{% assign _img_content = _img_content | append: '<img src="' | append: _svg | append: '" ' | append: _img %}
|
|
||||||
{% break %}
|
{% break %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% unless _width and _height %}
|
{% if _src %}
|
||||||
{% assign _img_content = _img_content | append: '<img ' | append: _img %}
|
{% unless _src contains '://' %}
|
||||||
{% endunless %}
|
|
||||||
|
<!-- Add CDN URL -->
|
||||||
|
{% if site.img_cdn %}
|
||||||
|
{% assign _src_prefix = site.img_cdn %}
|
||||||
|
{% else %}
|
||||||
|
{% assign _src_prefix = site.baseurl %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Add image path -->
|
||||||
|
{% if page.img_path %}
|
||||||
|
{% assign _path = page.img_path %}
|
||||||
|
{% assign last_char = _path | slice: -1 %}
|
||||||
|
|
||||||
|
{% unless last_char == '/' %}
|
||||||
|
{% assign _path = _path | append: '/' %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
{% assign _src_prefix = _src_prefix | append: _path %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign _final_src = _src_prefix | append: _src %}
|
||||||
|
{% assign _left = _left | replace: _src, _final_src %}
|
||||||
|
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
|
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||||
|
|
||||||
|
{% assign _left = _left | replace: 'src=', 'data-src=' %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Add SVG placehoder to prevent layout reflow -->
|
||||||
|
|
||||||
|
{% if _width and _height %}
|
||||||
|
{%- capture _svg -%}
|
||||||
|
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{% assign _left = _svg | append: ' ' | append: _left %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Bypass the HTML-proofer test -->
|
||||||
|
{% assign _left = _left | append: ' data-proofer-ignore' %}
|
||||||
|
|
||||||
|
{% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
@@ -118,16 +155,16 @@
|
|||||||
{% assign _left = _snippet | split: '><' | last%}
|
{% assign _left = _snippet | split: '><' | last%}
|
||||||
|
|
||||||
{% if _left contains 'file="' %}
|
{% if _left contains 'file="' %}
|
||||||
{% assign _text = _left | split: 'file="' | last | split: '"' | first %}
|
{% assign _label_text = _left | split: 'file="' | last | split: '"' | first %}
|
||||||
{% assign _label_icon = 'far fa-file-code' %}
|
{% assign _label_icon = 'far fa-file-code' %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
|
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
|
||||||
{% capture _text %}{% include language-alias.html language=_lang %}{% endcapture %}
|
{% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %}
|
||||||
{% assign _label_icon = 'fas fa-code small' %}
|
{% assign _label_icon = 'fas fa-code small' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% capture _label %}
|
{% capture _label %}
|
||||||
<span text-data="{{ _text }}"><i class="fa-fw {{ _label_icon }}"></i></span>
|
<span label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% assign _new_content = _new_content | append: _snippet
|
{% assign _new_content = _new_content | append: _snippet
|
||||||
@@ -147,6 +184,43 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Create heading anchors -->
|
||||||
|
|
||||||
|
{% assign heading_levels = '2,3,4,5' | split: ',' %}
|
||||||
|
{% assign _heading_content = _content %}
|
||||||
|
|
||||||
|
{% for level in heading_levels %}
|
||||||
|
{% capture mark_start %}<h{{ level }} id="{% endcapture %}
|
||||||
|
{% capture mark_end %}</h{{ level }}>{% endcapture %}
|
||||||
|
|
||||||
|
{% if _heading_content contains mark_start %}
|
||||||
|
{% assign _new_content = nil %}
|
||||||
|
{% assign heading_snippets = _heading_content | split: mark_start %}
|
||||||
|
|
||||||
|
{% for snippet in heading_snippets %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
{% assign _new_content = snippet %}
|
||||||
|
{% continue %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% assign id = snippet | split: '"' | first %}
|
||||||
|
{% capture anchor %}<a href="#{{ id }}" class="anchor"><i class="fas fa-hashtag"></i></a>{% endcapture %}
|
||||||
|
|
||||||
|
{% assign left = snippet | split: mark_end | first %}
|
||||||
|
{% assign right = snippet | replace: left, '' %}
|
||||||
|
|
||||||
|
{% assign _new_content = _new_content | append: mark_start
|
||||||
|
| append: left | append: anchor | append: mark_end | append: right
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign _heading_content = _new_content %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign _content = _heading_content %}
|
||||||
|
|
||||||
<!-- return -->
|
<!-- return -->
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
<div class="text-muted small">
|
<div class="text-muted small">
|
||||||
<p>
|
<p>
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
{{ content | markdownify | strip_html | truncate: 200 }}
|
{{ content | markdownify | strip_html | truncate: 200 | escape }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,15 +4,7 @@
|
|||||||
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
|
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
|
||||||
<div class="col-12 col-sm-11 post-content">
|
<div class="col-12 col-sm-11 post-content">
|
||||||
<div id="search-hints">
|
<div id="search-hints">
|
||||||
<h4 class="text-muted mb-4">{{ site.data.locales[lang].panel.trending_tags }}</h4>
|
|
||||||
|
|
||||||
{% include trending-tags.html %}
|
{% include trending-tags.html %}
|
||||||
|
|
||||||
{% for tag in trending_tags %}
|
|
||||||
{% capture url %}/tags/{{ tag | slugify | url_encode }}/{% endcapture %}
|
|
||||||
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,6 +53,16 @@
|
|||||||
|
|
||||||
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
|
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
|
||||||
|
|
||||||
|
{% unless site.theme_mode %}
|
||||||
|
<button class="mode-toggle btn" aria-label="Switch Mode">
|
||||||
|
<i class="fas fa-adjust"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{% if site.data.contact.size > 0 %}
|
||||||
|
<span class="icon-border"></span>
|
||||||
|
{% endif %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
{% for entry in site.data.contact %}
|
{% for entry in site.data.contact %}
|
||||||
{% capture url %}
|
{% capture url %}
|
||||||
{%- if entry.type == 'github' -%}
|
{%- if entry.type == 'github' -%}
|
||||||
@@ -71,7 +81,6 @@
|
|||||||
|
|
||||||
{% if url %}
|
{% if url %}
|
||||||
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
<a href="{{ url }}" aria-label="{{ entry.type }}"
|
||||||
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
|
|
||||||
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
|
||||||
<i class="{{ entry.icon }}"></i>
|
<i class="{{ entry.icon }}"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -79,16 +88,6 @@
|
|||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% unless site.theme_mode %}
|
|
||||||
{% if site.data.contact.size > 0 %}
|
|
||||||
<span class="icon-border order-2"></span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<span id="mode-toggle-wrapper" class="order-1">
|
|
||||||
{% include mode-toggle.html %}
|
|
||||||
</span>
|
|
||||||
{% endunless %}
|
|
||||||
|
|
||||||
</div> <!-- .sidebar-bottom -->
|
</div> <!-- .sidebar-bottom -->
|
||||||
|
|
||||||
</div><!-- #sidebar -->
|
</div><!-- #sidebar -->
|
||||||
|
|||||||
@@ -1,27 +1,26 @@
|
|||||||
<!--
|
<!--
|
||||||
Date format snippet
|
Date format snippet
|
||||||
See: /assets/js/_utils/timeage.js
|
See: ${JS_ROOT}/utils/timeago.js
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
||||||
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
||||||
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
||||||
|
|
||||||
{% if include.preposition %}
|
<em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
|
||||||
{{ include.preposition }}
|
date="{{ include.date }}"
|
||||||
{% endif %}
|
{% if include.tooltip %}
|
||||||
<span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
|
data-toggle="tooltip"
|
||||||
{% if include.tooltip %}
|
data-placement="bottom"
|
||||||
data-toggle="tooltip"
|
title="{{ include.date | date: tooltip_df }}"
|
||||||
data-placement="bottom"
|
{% endif %}>
|
||||||
title="{{ include.date | date: tooltip_df }}"
|
|
||||||
{% endif %}>
|
|
||||||
{%- assign this_year = site.time | date: "%Y" -%}
|
{%- assign this_year = site.time | date: "%Y" -%}
|
||||||
{%- assign post_year = include.date | date: "%Y" -%}
|
{%- assign post_year = include.date | date: "%Y" -%}
|
||||||
|
|
||||||
{%- if post_year == this_year -%}
|
{%- if post_year == this_year -%}
|
||||||
{{ include.date | date: post_short_df }}
|
{{ include.date | date: post_short_df }}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{ include.date | date: post_long_df }}
|
{{ include.date | date: post_long_df }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
</em>
|
||||||
</span>
|
|
||||||
|
|||||||
16
_includes/toc.html
Normal file
16
_includes/toc.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{% assign enable_toc = false %}
|
||||||
|
{% if site.toc and page.toc %}
|
||||||
|
{% if page.content contains '<h2' or page.content contains '<h3' %}
|
||||||
|
{% assign enable_toc = true %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if enable_toc %}
|
||||||
|
<!-- BS-toc.js will be loaded at medium priority -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js"></script>
|
||||||
|
|
||||||
|
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
|
||||||
|
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>
|
||||||
|
<nav id="toc" data-toggle="toc"></nav>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<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[lang].title | default: site.title -}}
|
||||||
{% elsif page.collection == 'tabs' %}
|
{% elsif page.collection == 'tabs' or page.dynamic_title %}
|
||||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
||||||
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -34,3 +34,17 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if trending_tags.size > 0 %}
|
||||||
|
<div id="access-tags">
|
||||||
|
<div class="panel-heading">{{- site.data.locales[lang].panel.trending_tags -}}</div>
|
||||||
|
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
||||||
|
|
||||||
|
{% for tag_name in trending_tags %}
|
||||||
|
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
|
||||||
|
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|||||||
@@ -22,3 +22,19 @@
|
|||||||
{% for entry in all_list limit:MAX_SIZE %}
|
{% for entry in all_list limit:MAX_SIZE %}
|
||||||
{% assign update_list = update_list | push: entry %}
|
{% assign update_list = update_list | push: entry %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if update_list.size > 0 %}
|
||||||
|
|
||||||
|
<div id="access-lastmod" class="post">
|
||||||
|
<div class="panel-heading">{{- site.data.locales[lang].panel.lastmod -}}</div>
|
||||||
|
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
||||||
|
{% for item in update_list %}
|
||||||
|
{% assign index = item | split: "::" | last | plus: 0 %}
|
||||||
|
{% assign post = site.posts[index] %}
|
||||||
|
{% assign url = post.url | relative_url %}
|
||||||
|
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div> <!-- #access-lastmod -->
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|||||||
13
_javascript/commons/mode-toggle.js
Normal file
13
_javascript/commons/mode-toggle.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Listener for theme mode toggle
|
||||||
|
*/
|
||||||
|
$(function() {
|
||||||
|
$(".mode-toggle").click((e) => {
|
||||||
|
const $target = $(e.target);
|
||||||
|
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
|
||||||
|
$target : $target.parent());
|
||||||
|
|
||||||
|
$btn.blur(); // remove the clicking outline
|
||||||
|
flipMode();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,50 +3,50 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
const $topbarWrapper = $("#topbar-wrapper");
|
||||||
|
const $panel = $("#panel-wrapper");
|
||||||
|
const $searchInput = $("#search-input");
|
||||||
|
|
||||||
const topbarWrapper = $("#topbar-wrapper");
|
const CLASS_TOPBAR_UP = "topbar-up";
|
||||||
const toc = $("#toc-wrapper");
|
const CLASS_TOPBAR_DOWN = "topbar-down";
|
||||||
const access = $(".access");
|
const ATTR_TOC_SCROLLING_UP = "toc-scrolling-up"; // topbar locked
|
||||||
const searchInput = $("#search-input");
|
|
||||||
|
|
||||||
let didScroll;
|
let didScroll;
|
||||||
let lastScrollTop = 0;
|
let lastScrollTop = 0;
|
||||||
|
|
||||||
const delta = 5;
|
const delta = $topbarWrapper.outerHeight();
|
||||||
const topbarHeight = topbarWrapper.outerHeight();
|
const topbarHeight = $topbarWrapper.outerHeight();
|
||||||
|
|
||||||
function hasScrolled() {
|
function hasScrolled() {
|
||||||
var st = $(this).scrollTop();
|
let st = $(this).scrollTop();
|
||||||
|
|
||||||
/* Make sure they scroll more than delta */
|
/* Make sure they scroll more than delta */
|
||||||
if (Math.abs(lastScrollTop - st) <= delta) {
|
if (Math.abs(lastScrollTop - st) <= delta) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (st > lastScrollTop && st > topbarHeight) {
|
if (st > lastScrollTop ) { // Scroll Down
|
||||||
/* Scroll Down */
|
if (st > topbarHeight) {
|
||||||
topbarWrapper.removeClass("topbar-down").addClass("topbar-up");
|
$topbarWrapper.removeClass(CLASS_TOPBAR_DOWN).addClass(CLASS_TOPBAR_UP);
|
||||||
|
$panel.removeClass(CLASS_TOPBAR_DOWN);
|
||||||
|
|
||||||
if (toc.length > 0) {
|
if ($searchInput.is(":focus")) {
|
||||||
toc.removeClass("topbar-down");
|
$searchInput.blur(); /* remove focus */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {// Scroll up
|
||||||
|
// did not reach the bottom of the document, i.e., still have space to scroll up
|
||||||
|
if (st + $(window).height() < $(document).height()) {
|
||||||
|
let tocScrollingUp = $topbarWrapper.attr(ATTR_TOC_SCROLLING_UP);
|
||||||
|
if (typeof tocScrollingUp !== "undefined") {
|
||||||
|
if (tocScrollingUp === "false") {
|
||||||
|
$topbarWrapper.removeAttr(ATTR_TOC_SCROLLING_UP);
|
||||||
|
}
|
||||||
|
|
||||||
if (access.length > 0) {
|
} else {
|
||||||
access.removeClass("topbar-down");
|
$topbarWrapper.removeClass(CLASS_TOPBAR_UP).addClass(CLASS_TOPBAR_DOWN);
|
||||||
}
|
$panel.addClass(CLASS_TOPBAR_DOWN);
|
||||||
|
}
|
||||||
if (searchInput.is(":focus")) {
|
|
||||||
searchInput.blur(); /* remove focus */
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (st + $(window).height() < $(document).height()) {
|
|
||||||
/* Scroll Up */
|
|
||||||
topbarWrapper.removeClass("topbar-up").addClass("topbar-down");
|
|
||||||
if (toc.length > 0) {
|
|
||||||
toc.addClass("topbar-down");
|
|
||||||
}
|
|
||||||
if (access.length > 0) {
|
|
||||||
access.addClass("topbar-down");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(window).scroll(function(event) {
|
$(window).scroll(function(event) {
|
||||||
if ($("#topbar-title").is(":hidden")) { /* Not in small screens */
|
if ($("#topbar-title").is(":hidden")) {
|
||||||
didScroll = true;
|
didScroll = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.3.4 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -8,49 +8,61 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
const $topbarWrapper = $("#topbar-wrapper");
|
||||||
|
const topbarHeight = $topbarWrapper.outerHeight();
|
||||||
|
const $topbarTitle = $("#topbar-title");
|
||||||
|
|
||||||
|
const ATTR_TOC_SCROLLING = "toc-scrolling-up";
|
||||||
|
const SCROLL_MARK = "scroll-focus";
|
||||||
|
const REM = 16; // in pixels
|
||||||
|
let tocScrollUpCount = 0;
|
||||||
|
|
||||||
$("a[href*='#']")
|
$("a[href*='#']")
|
||||||
.not("[href='#']")
|
.not("[href='#']")
|
||||||
.not("[href='#0']")
|
.not("[href='#0']")
|
||||||
.click(function(event) {
|
.click(function(event) {
|
||||||
|
|
||||||
if (this.pathname.replace(/^\//, "") === location.pathname.replace(/^\//, "")) {
|
if (this.pathname.replace(/^\//, "") === location.pathname.replace(/^\//, "")) {
|
||||||
if (location.hostname === this.hostname) {
|
if (location.hostname === this.hostname) {
|
||||||
|
|
||||||
const REM = 16; /* 16px */
|
|
||||||
|
|
||||||
const hash = decodeURI(this.hash);
|
const hash = decodeURI(this.hash);
|
||||||
let isFnRef = RegExp(/^#fnref:/).test(hash);
|
let toFootnoteRef = RegExp(/^#fnref:/).test(hash);
|
||||||
let isFn = isFnRef? 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);
|
||||||
|
|
||||||
if (target.length) {
|
let parent = $(this).parent().prop("tagName");
|
||||||
|
let isAnchor = RegExp(/^H\d/).test(parent);
|
||||||
|
let isMobileViews = !$topbarTitle.is(":hidden");
|
||||||
|
|
||||||
|
if (typeof $target !== "undefined") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if (history.pushState) { /* add hash to URL */
|
if (history.pushState) { /* add hash to URL */
|
||||||
history.pushState(null, null, hash);
|
history.pushState(null, null, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
let curOffset = $(this).offset().top;
|
let curOffset = isAnchor? $(this).offset().top : $(window).scrollTop();
|
||||||
let destOffset = target.offset().top;
|
let destOffset = $target.offset().top -= REM / 2;
|
||||||
const scrollUp = (destOffset < curOffset);
|
|
||||||
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
|
||||||
|
|
||||||
if (scrollUp && isFnRef) {
|
if (destOffset < curOffset) { // scroll up
|
||||||
/* Avoid the top-bar covering `fnref` when scrolling up
|
if (!isAnchor && !toFootnote) { // trigger by ToC item
|
||||||
because `fnref` has no `%anchor`(see: module.scss) style. */
|
if (!isMobileViews) { // on desktop/tablet screens
|
||||||
destOffset -= (topbarHeight + REM / 2);
|
$topbarWrapper.removeClass("topbar-down").addClass("topbar-up");
|
||||||
|
// Send message to `${JS_ROOT}/commons/topbar-switch.js`
|
||||||
|
$topbarWrapper.attr(ATTR_TOC_SCROLLING, true);
|
||||||
|
tocScrollUpCount += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((isAnchor || toFootnoteRef) && isMobileViews) {
|
||||||
|
destOffset -= topbarHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("html,body").animate({
|
$("html").animate({
|
||||||
scrollTop: destOffset
|
scrollTop: destOffset
|
||||||
}, 800, () => {
|
}, 500, () => {
|
||||||
|
|
||||||
const $target = $(target);
|
|
||||||
$target.focus();
|
$target.focus();
|
||||||
|
|
||||||
const SCROLL_MARK = "scroll-focus";
|
|
||||||
|
|
||||||
/* clean up old scroll mark */
|
/* clean up old scroll mark */
|
||||||
if ($(`[${SCROLL_MARK}=true]`).length) {
|
if ($(`[${SCROLL_MARK}=true]`).length) {
|
||||||
$(`[${SCROLL_MARK}=true]`).attr(SCROLL_MARK, false);
|
$(`[${SCROLL_MARK}=true]`).attr(SCROLL_MARK, false);
|
||||||
@@ -62,7 +74,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set scroll mark to footnotes */
|
/* set scroll mark to footnotes */
|
||||||
if (isFn || isFnRef) {
|
if (toFootnote || toFootnoteRef) {
|
||||||
$target.attr(SCROLL_MARK, true);
|
$target.attr(SCROLL_MARK, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +84,14 @@ $(function() {
|
|||||||
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
||||||
$target.focus(); /* Set focus again */
|
$target.focus(); /* Set focus again */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof $topbarWrapper.attr(ATTR_TOC_SCROLLING) !== "undefined") {
|
||||||
|
tocScrollUpCount -= 1;
|
||||||
|
|
||||||
|
if (tocScrollUpCount <= 0) {
|
||||||
|
$topbarWrapper.attr(ATTR_TOC_SCROLLING, "false");
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
const timeagoElem = $(".timeago");
|
const timeagoElem = $(".timeago");
|
||||||
|
let tasks = timeagoElem.length;
|
||||||
let toRefresh = timeagoElem.length;
|
|
||||||
|
|
||||||
let intervalId = void 0;
|
let intervalId = void 0;
|
||||||
|
|
||||||
const dPrompt = $("meta[name=day-prompt]").attr("content");
|
const dPrompt = $("meta[name=day-prompt]").attr("content");
|
||||||
@@ -15,20 +12,19 @@ $(function() {
|
|||||||
const minPrompt = $("meta[name=minute-prompt]").attr("content");
|
const minPrompt = $("meta[name=minute-prompt]").attr("content");
|
||||||
const justnowPrompt = $("meta[name=justnow-prompt]").attr("content");
|
const justnowPrompt = $("meta[name=justnow-prompt]").attr("content");
|
||||||
|
|
||||||
function timeago(isoDate, dateStr) {
|
function timeago(date, initDate) {
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let past = new Date(isoDate);
|
let past = new Date(date);
|
||||||
|
|
||||||
if (past.getFullYear() !== now.getFullYear()
|
if (past.getFullYear() !== now.getFullYear()
|
||||||
|| past.getMonth() !== now.getMonth()) {
|
|| past.getMonth() !== now.getMonth()) {
|
||||||
return dateStr;
|
return initDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
let seconds = Math.floor((now - past) / 1000);
|
let seconds = Math.floor((now - past) / 1000);
|
||||||
|
|
||||||
let day = Math.floor(seconds / 86400);
|
let day = Math.floor(seconds / 86400);
|
||||||
if (day >= 1) {
|
if (day >= 1) {
|
||||||
toRefresh -= 1;
|
|
||||||
return ` ${day} ${dPrompt}`;
|
return ` ${day} ${dPrompt}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,22 +43,30 @@ $(function() {
|
|||||||
|
|
||||||
function updateTimeago() {
|
function updateTimeago() {
|
||||||
$(".timeago").each(function() {
|
$(".timeago").each(function() {
|
||||||
if ($(this).children("i").length > 0) {
|
if ($(this)[0].hasAttribute("date") === false) {
|
||||||
let dateStr = $(this).clone().children().remove().end().text();
|
tasks -= 1;
|
||||||
let node = $(this).children("i");
|
return;
|
||||||
let iosDate = node.text(); /* ISO Date: "YYYY-MM-DDTHH:MM:SSZ" */
|
|
||||||
$(this).text(timeago(iosDate, dateStr));
|
|
||||||
$(this).append(node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let date = $(this).attr("date");
|
||||||
|
let initDate = $(this).text();
|
||||||
|
let relativeDate = timeago(date, initDate);
|
||||||
|
|
||||||
|
if (relativeDate === initDate) {
|
||||||
|
$(this).removeAttr("date");
|
||||||
|
} else {
|
||||||
|
$(this).text(relativeDate);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (toRefresh === 0 && typeof intervalId !== "undefined") {
|
if (tasks === 0 && typeof intervalId !== "undefined") {
|
||||||
clearInterval(intervalId); /* stop interval */
|
clearInterval(intervalId); /* stop interval */
|
||||||
}
|
}
|
||||||
return toRefresh;
|
return tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toRefresh === 0) {
|
if (tasks === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,14 @@ layout: compress
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
<html lang="{{ site.lang }}" {{ prefer_mode }}>
|
<html lang="{{ site.lang }}"{{ prefer_mode }}>
|
||||||
|
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
|
|
||||||
|
{% unless site.theme_mode %}
|
||||||
|
{% include mode-toggle.html %}
|
||||||
|
{% endunless %}
|
||||||
|
|
||||||
<body data-spy="scroll" data-target="#toc">
|
<body data-spy="scroll" data-target="#toc">
|
||||||
|
|
||||||
{% include sidebar.html %}
|
{% include sidebar.html %}
|
||||||
@@ -26,7 +30,7 @@ layout: compress
|
|||||||
<div id="main-wrapper">
|
<div id="main-wrapper">
|
||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
{% include refactor-content.html content=content %}
|
{{ content }}
|
||||||
|
|
||||||
{% include footer.html %}
|
{% include footer.html %}
|
||||||
|
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ layout: page
|
|||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<p>
|
<p>
|
||||||
{% include no-linenos.html content=post.content %}
|
{% include no-linenos.html content=post.content %}
|
||||||
{{ content | markdownify | strip_html | truncate: 200 }}
|
{{ content | markdownify | strip_html | truncate: 200 | escape }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-meta text-muted d-flex justify-content-between">
|
<div class="post-meta text-muted d-flex">
|
||||||
|
|
||||||
<div>
|
<div class="mr-auto">
|
||||||
<!-- posted date -->
|
<!-- posted date -->
|
||||||
<i class="far fa-calendar fa-fw"></i>
|
<i class="far fa-calendar fa-fw"></i>
|
||||||
{% include timeago.html date=post.date tooltip=true %}
|
{% include timeago.html date=post.date tooltip=true %}
|
||||||
@@ -68,12 +68,15 @@ layout: page
|
|||||||
<i class="far fa-clock fa-fw"></i>
|
<i class="far fa-clock fa-fw"></i>
|
||||||
{% include read-time.html content=post.content %}
|
{% include read-time.html content=post.content %}
|
||||||
|
|
||||||
<!-- page views -->
|
<!-- categories -->
|
||||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
{% if post.categories.size > 0 %}
|
||||||
<i class="far fa-eye fa-fw"></i>
|
<i class="far fa-folder-open fa-fw"></i>
|
||||||
<span id="pv_{{-post.title-}}" class="pageviews">
|
<span>
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
{% for category in post.categories %}
|
||||||
</span>
|
{{ category }}
|
||||||
|
{%- unless forloop.last -%},{%- endunless -%}
|
||||||
|
{% endfor %}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,64 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: default
|
||||||
# The page layout
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% include lang.html %}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-11 col-xl-8">
|
|
||||||
<div id="page" class="post pb-5 pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 mb-md-4">
|
<!-- core -->
|
||||||
{% if page.dynamic_title %}
|
<div id="core-wrapper" class="col-12 col-lg-11 col-xl-8">
|
||||||
|
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
||||||
|
|
||||||
|
{% capture _content %}
|
||||||
|
{% if layout.refactor or page.layout == 'page' %}
|
||||||
|
{% include refactor-content.html content=content %}
|
||||||
|
{% else %}
|
||||||
|
{{ content }}
|
||||||
|
{% endif %}
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
|
{% if page.layout == 'page' or page.collection == 'tabs'%}
|
||||||
|
{% assign title = site.data.locales[lang].tabs[tab_key] | default: page.title %}
|
||||||
<h1 class="dynamic-title">
|
<h1 class="dynamic-title">
|
||||||
{% if page.collection == 'tabs' %}
|
{{ title }}
|
||||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
|
||||||
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
|
||||||
{% else %}
|
|
||||||
{{- page.title -}}
|
|
||||||
{% endif %}
|
|
||||||
</h1>
|
</h1>
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ content }}
|
{{ _content }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ content }}
|
{{ _content }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div> <!-- #page -->
|
|
||||||
</div><!-- .col-12 -->
|
|
||||||
|
|
||||||
{% include panel.html %}
|
</div>
|
||||||
|
</div> <!-- #core-wrapper -->
|
||||||
|
|
||||||
|
<!-- pannel -->
|
||||||
|
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
||||||
|
|
||||||
|
<div class="access">
|
||||||
|
{% include update-list.html %}
|
||||||
|
{% include trending-tags.html %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for _include in layout.pannel_includes %}
|
||||||
|
{% assign _include_path = _include | append: '.html' %}
|
||||||
|
{% include {{ _include_path }} %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if site.disqus.comments and page.comments %}
|
<!-- tail -->
|
||||||
|
{% if layout.tail_includes %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-lg-11 col-xl-8">
|
<div class="col-12 col-lg-11 col-xl-8">
|
||||||
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
<div id="tail-wrapper" class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
||||||
|
{% for _include in layout.tail_includes %}
|
||||||
{% include disqus.html %}
|
{% assign _include_path = _include | append: '.html' %}
|
||||||
|
{% include {{ _include_path }} %}
|
||||||
</div> <!-- .pl-1 pr-1 -->
|
{% endfor %}
|
||||||
</div> <!-- .col-12 -->
|
</div>
|
||||||
|
</div>
|
||||||
</div> <!-- .row -->
|
</div> <!-- .row -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,143 +1,144 @@
|
|||||||
---
|
---
|
||||||
layout: default
|
layout: page
|
||||||
# The posts' layout
|
refactor: true
|
||||||
|
pannel_includes:
|
||||||
|
- toc
|
||||||
|
tail_includes:
|
||||||
|
- related-posts
|
||||||
|
- post-nav
|
||||||
|
- comments
|
||||||
---
|
---
|
||||||
|
|
||||||
{% include lang.html %}
|
{% include lang.html %}
|
||||||
|
|
||||||
<div class="row">
|
{% if page.image.src %}
|
||||||
|
{% capture bg %}
|
||||||
|
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
|
||||||
|
{% endcapture %}
|
||||||
|
<img src="{{ page.image.src }}" class="preview-img {{ bg | strip }}"
|
||||||
|
alt="{{ page.image.alt | default: "Preview Image" }}"
|
||||||
|
|
||||||
<div id="post-wrapper" class="col-12 col-lg-11 col-xl-8">
|
{% if page.image.width %}
|
||||||
|
width="{{ page.image.width }}"
|
||||||
|
{% elsif page.image.w %}
|
||||||
|
width="{{ page.image.w }}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
{% if page.image.height %}
|
||||||
|
height="{{ page.image.height }}"
|
||||||
|
{% elsif page.image.h %}
|
||||||
|
height="{{ page.image.h }}"
|
||||||
|
{% endif %}>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<h1 data-toc-skip>{{ page.title }}</h1>
|
<h1 data-toc-skip>{{ page.title }}</h1>
|
||||||
|
|
||||||
<div class="post-meta text-muted d-flex flex-column">
|
<div class="post-meta text-muted">
|
||||||
<!-- Published date and author -->
|
|
||||||
<div>
|
|
||||||
<span class="semi-bold">
|
|
||||||
{{ page.author | default: site.social.name }}
|
|
||||||
</span>
|
|
||||||
{% capture _preposition %}{{ site.data.locales[lang].post.published }}{% endcapture %}
|
|
||||||
{% include timeago.html date=page.date tooltip=true preposition=_preposition %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<!-- author -->
|
||||||
<!-- lastmod -->
|
<div>
|
||||||
{% if page.last_modified_at %}
|
{% capture author_name %}{{ page.author.name | default: site.social.name }}{% endcapture %}
|
||||||
<span>
|
{% assign author_link = nil %}
|
||||||
{{ site.data.locales[lang].post.updated }}
|
|
||||||
{% include timeago.html date=page.last_modified_at class="lastmod" tooltip=true %}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- read time -->
|
{% if page.author.link %}
|
||||||
{% include read-time.html content=content prompt=true %}
|
{% assign author_link = page.author.link %}
|
||||||
|
{% elsif author_name == site.social.name %}
|
||||||
<!-- page views -->
|
{% assign author_link = site.social.links[0] %}
|
||||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
|
||||||
<span id="pv" class="pageviews">
|
|
||||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
|
||||||
</span>
|
|
||||||
{{ site.data.locales[lang].post.pageview_measure }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div> <!-- .post-meta -->
|
|
||||||
|
|
||||||
<div class="post-content">
|
|
||||||
|
|
||||||
{% if page.image.src %}
|
|
||||||
<img src="{{ page.image.src }}"
|
|
||||||
class="preview-img"
|
|
||||||
alt="{{ page.image.alt | default: "Preview Image" }}"
|
|
||||||
{% if page.image.width %}width="{{ page.image.width }}"{% endif %}
|
|
||||||
{% if page.image.height %}height="{{ page.image.height }}"{% endif %}>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{{ content }}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="post-tail-wrapper text-muted">
|
|
||||||
|
|
||||||
<!-- categories -->
|
|
||||||
{% if page.categories.size > 0 %}
|
|
||||||
|
|
||||||
<div class="post-meta mb-3">
|
|
||||||
<i class="far fa-folder-open fa-fw mr-1"></i>
|
|
||||||
{% for category in page.categories %}
|
|
||||||
<a href='{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/'>{{ category }}</a>
|
|
||||||
{%- unless forloop.last -%}, {%- endunless -%}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- tags -->
|
|
||||||
{% if page.tags.size > 0 %}
|
|
||||||
<div class="post-tags">
|
|
||||||
<i class="fa fa-tags fa-fw mr-1"></i>
|
|
||||||
{% for tag in page.tags %}
|
|
||||||
<a href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
|
|
||||||
class="post-tag no-text-decoration" >
|
|
||||||
{{- tag -}}
|
|
||||||
</a>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="post-tail-bottom
|
|
||||||
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
|
||||||
<div class="license-wrapper">
|
|
||||||
{% if site.data.locales[lang].copyright.license.template %}
|
|
||||||
{% capture _replacement %}
|
|
||||||
<a href="{{ site.data.locales[lang].copyright.license.link }}">
|
|
||||||
{{ site.data.locales[lang].copyright.license.name }}
|
|
||||||
</a>
|
|
||||||
{% endcapture %}
|
|
||||||
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include post-sharing.html %}
|
|
||||||
|
|
||||||
</div><!-- .post-tail-bottom -->
|
|
||||||
|
|
||||||
</div><!-- div.post-tail -->
|
|
||||||
|
|
||||||
</div> <!-- .post -->
|
|
||||||
|
|
||||||
|
|
||||||
</div> <!-- #post-wrapper -->
|
|
||||||
|
|
||||||
{% assign enable_toc = false %}
|
|
||||||
|
|
||||||
{% if site.toc and page.toc %}
|
|
||||||
{% if content contains '<h2' or content contains '<h3' %}
|
|
||||||
{% assign enable_toc = true %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{{ site.data.locales[lang].post.written_by }}
|
||||||
|
<em>
|
||||||
|
{% if author_link %}
|
||||||
|
<a href="{{ author_link }}">{{ author_name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ author_name }}
|
||||||
|
{% endif %}
|
||||||
|
</em>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex">
|
||||||
|
<div>
|
||||||
|
<!-- published date -->
|
||||||
|
<span>
|
||||||
|
{{ site.data.locales[lang].post.posted }}
|
||||||
|
{% include timeago.html date=page.date tooltip=true %}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- lastmod date -->
|
||||||
|
{% if page.last_modified_at %}
|
||||||
|
<span>
|
||||||
|
{{ site.data.locales[lang].post.updated }}
|
||||||
|
{% include timeago.html date=page.last_modified_at tooltip=true %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- read time -->
|
||||||
|
{% include read-time.html content=content prompt=true %}
|
||||||
|
|
||||||
|
<!-- page views -->
|
||||||
|
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
||||||
|
<span>
|
||||||
|
<em id="pv" class="pageviews">
|
||||||
|
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
||||||
|
</em>
|
||||||
|
{{ site.data.locales[lang].post.pageview_measure }}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> <!-- .d-flex -->
|
||||||
|
|
||||||
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
|
<div class="post-content">
|
||||||
|
{{ content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="post-tail-wrapper text-muted">
|
||||||
|
|
||||||
|
<!-- categories -->
|
||||||
|
{% if page.categories.size > 0 %}
|
||||||
|
<div class="post-meta mb-3">
|
||||||
|
<i class="far fa-folder-open fa-fw mr-1"></i>
|
||||||
|
{% for category in page.categories %}
|
||||||
|
<a href='{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/'>{{ category }}</a>
|
||||||
|
{%- unless forloop.last -%}, {%- endunless -%}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include panel.html toc=enable_toc %}
|
<!-- tags -->
|
||||||
|
{% if page.tags.size > 0 %}
|
||||||
|
<div class="post-tags">
|
||||||
|
<i class="fa fa-tags fa-fw mr-1"></i>
|
||||||
|
{% for tag in page.tags %}
|
||||||
|
<a href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
|
||||||
|
class="post-tag no-text-decoration" >
|
||||||
|
{{- tag -}}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</div> <!-- .row -->
|
<div class="post-tail-bottom
|
||||||
|
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
||||||
|
<div class="license-wrapper">
|
||||||
|
|
||||||
<div class="row">
|
{% if site.data.locales[lang].copyright.license.template %}
|
||||||
<div class="col-12 col-lg-11 col-xl-8">
|
|
||||||
<div id="post-extend-wrapper" class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
|
||||||
|
|
||||||
{% include related-posts.html %}
|
{% capture _replacement %}
|
||||||
|
<a href="{{ site.data.locales[lang].copyright.license.link }}">
|
||||||
|
{{ site.data.locales[lang].copyright.license.name }}
|
||||||
|
</a>
|
||||||
|
{% endcapture %}
|
||||||
|
|
||||||
{% include post-nav.html %}
|
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
||||||
|
|
||||||
{% if site.disqus.comments and page.comments %}
|
{% endif %}
|
||||||
{% include disqus.html %}
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div> <!-- #post-extend-wrapper -->
|
{% include post-sharing.html %}
|
||||||
|
|
||||||
</div> <!-- .col-* -->
|
</div><!-- .post-tail-bottom -->
|
||||||
|
|
||||||
</div> <!-- .row -->
|
</div><!-- div.post-tail-wrapper -->
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Text and Typography
|
title: Text and Typography
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-08 11:33:00 +0800
|
date: 2019-08-08 11:33:00 +0800
|
||||||
categories: [Blogging, Demo]
|
categories: [Blogging, Demo]
|
||||||
tags: [typography]
|
tags: [typography]
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
---
|
---
|
||||||
title: Writing a New Post
|
title: Writing a New Post
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-08 14:10:00 +0800
|
date: 2019-08-08 14:10:00 +0800
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [writing]
|
tags: [writing]
|
||||||
render_with_liquid: false
|
render_with_liquid: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
This post will guide you how to write a post on _Chirpy_ theme. Even if you have previous experience with Jekyll, this article is worth reading, because many features require specific variables to be set.
|
||||||
|
|
||||||
## Naming and Path
|
## Naming and Path
|
||||||
|
|
||||||
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_posts/` of the root directory. Please note that the `EXTENSION` must be one of `md` and `markdown`.
|
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_posts` of the root directory. Please note that the `EXTENSION` must be one of `md` and `markdown`. If you want to save time of creating files, please consider using the plugin [`Jekyll-Compose`](https://github.com/jekyll/jekyll-compose) to accomplish this.
|
||||||
|
|
||||||
## Front Matter
|
## Front Matter
|
||||||
|
|
||||||
@@ -24,9 +28,9 @@ tags: [TAG] # TAG names should always be lowercase
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**: The posts' ***layout*** has been set to `post` by default, so there is no need to add the variable ***layout*** in the Front Matter block.
|
> **Note**: The posts' _layout_ has been set to `post` by default, so there is no need to add the variable _layout_ in the Front Matter block.
|
||||||
|
|
||||||
### Timezone of date
|
### Timezone of Date
|
||||||
|
|
||||||
In order to accurately record the release date of a post, you should not only set up the `timezone` of `_config.yml` but also provide the post's timezone in variable `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
|
In order to accurately record the release date of a post, you should not only set up the `timezone` of `_config.yml` but also provide the post's timezone in variable `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
|
||||||
|
|
||||||
@@ -38,6 +42,17 @@ The `categories` of each post are designed to contain up to two elements, and th
|
|||||||
categories: [Animal, Insect]
|
categories: [Animal, Insect]
|
||||||
tags: [bee]
|
tags: [bee]
|
||||||
```
|
```
|
||||||
|
### Author Information
|
||||||
|
|
||||||
|
The author information of the post usually does not need to be filled in the _Front Matter_ , they will be obtained from variables `social.name` and the first entry of `social.links` of the configuration file by default. But you can also override it as follows:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
author:
|
||||||
|
name: Full Name
|
||||||
|
link: https://example.com
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
@@ -99,6 +114,8 @@ image:
|
|||||||
|
|
||||||
Except for `alt`, all other options are necessary, especially the `width` and `height`, which are related to user experience and web page loading performance. Later section ["Image size"](#image-size) will also mention this.
|
Except for `alt`, all other options are necessary, especially the `width` and `height`, which are related to user experience and web page loading performance. Later section ["Image size"](#image-size) will also mention this.
|
||||||
|
|
||||||
|
Starting from _Chirpy v5.0.0_, the attributes `height` and `width` support abbreviations: `height` → `h`, `width` → `w`.
|
||||||
|
|
||||||
|
|
||||||
### Image caption
|
### Image caption
|
||||||
|
|
||||||
@@ -119,6 +136,13 @@ In order to prevent the page content layout from shifting when the image is load
|
|||||||
```
|
```
|
||||||
{: .nolineno}
|
{: .nolineno}
|
||||||
|
|
||||||
|
Starting from _Chirpy v5.0.0_, `height` and `width` support abbreviations (`height` → `h`, `width` → `w`). The following example has the same effect as the above:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
{: w="700" h="400" }
|
||||||
|
```
|
||||||
|
{: .nolineno}
|
||||||
|
|
||||||
### Image position
|
### Image position
|
||||||
|
|
||||||
By default, the image is centered, but you can specify the position by using one of the classes `normal`, `left`, and `right`. For example:
|
By default, the image is centered, but you can specify the position by using one of the classes `normal`, `left`, and `right`. For example:
|
||||||
@@ -182,6 +206,31 @@ The parsing result will automatically add the CDN prefix `https://cdn.com` befor
|
|||||||
```
|
```
|
||||||
{: .nolineno}
|
{: .nolineno}
|
||||||
|
|
||||||
|
### Image path
|
||||||
|
|
||||||
|
When a post contains many images, it will be a time-consuming task to repeatedly define the path of the images. To solve this, we can define this path in the YAML block of the post:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
---
|
||||||
|
img_path: /img/path/
|
||||||
|
---
|
||||||
|
```
|
||||||
|
{: .nolineno }
|
||||||
|
|
||||||
|
And then, the image source of Markdown can write the file name directly:
|
||||||
|
|
||||||
|
```md
|
||||||
|

|
||||||
|
```
|
||||||
|
{: .nolineno }
|
||||||
|
|
||||||
|
The output will be:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<img src="/img/path/flower.png" alt="The flower">
|
||||||
|
```
|
||||||
|
{: .nolineno }
|
||||||
|
|
||||||
## Pinned Posts
|
## Pinned Posts
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Getting Started
|
title: Getting Started
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-09 20:55:00 +0800
|
date: 2019-08-09 20:55:00 +0800
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [getting started]
|
tags: [getting started]
|
||||||
@@ -123,7 +125,7 @@ Now publish your Jekyll site by:
|
|||||||
|
|
||||||
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.
|
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
||||||
|
|
||||||
{: width="850" height="153" }
|
{: width="1580" height="250" }
|
||||||
|
|
||||||
3. Visit your website at the address indicated by GitHub.
|
3. Visit your website at the address indicated by GitHub.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Customize the Favicon
|
title: Customize the Favicon
|
||||||
author: Cotes Chung
|
author:
|
||||||
|
name: Cotes Chung
|
||||||
|
link: https://github.com/cotes2020
|
||||||
date: 2019-08-11 00:34:00 +0800
|
date: 2019-08-11 00:34:00 +0800
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [favicon]
|
tags: [favicon]
|
||||||
@@ -21,7 +23,7 @@ Download the generated package, unzip and delete the following two from the extr
|
|||||||
- `browserconfig.xml`
|
- `browserconfig.xml`
|
||||||
- `site.webmanifest`
|
- `site.webmanifest`
|
||||||
|
|
||||||
Now, copy the remaining image files (`PNG` and `ICO`) to cover the original files in the folder `assets/img/favicons/` of your Jekyll site. If your Jekyll site doesn't have this directory yet, just create one.
|
And then copy the remaining image files (`PNG` and `ICO`) to cover the original files in the directory `assets/img/favicons/` of your Jekyll site. If your Jekyll site doesn't have this directory yet, just create one.
|
||||||
|
|
||||||
The following table will help you understand the changes to the favicon files:
|
The following table will help you understand the changes to the favicon files:
|
||||||
|
|
||||||
@@ -29,8 +31,6 @@ The following table will help you understand the changes to the favicon files:
|
|||||||
|---------------------|:---------------------------------:|:-----------:|
|
|---------------------|:---------------------------------:|:-----------:|
|
||||||
| `*.PNG` | ✓ | ✗ |
|
| `*.PNG` | ✓ | ✗ |
|
||||||
| `*.ICO` | ✓ | ✗ |
|
| `*.ICO` | ✓ | ✗ |
|
||||||
| `browserconfig.xml` | ✗ | ✓ |
|
|
||||||
| `site.webmanifest` | ✗ | ✓ |
|
|
||||||
|
|
||||||
> Note: ✓ means keep, ✗ means delete.
|
> Note: ✓ means keep, ✗ means delete.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Enable Google Page Views
|
title: Enable Google Page Views
|
||||||
author: Dinesh Prasanth Moluguwan Krishnamoorthy
|
author:
|
||||||
|
name: Dinesh Prasanth Moluguwan Krishnamoorthy
|
||||||
|
link: https://github.com/SilleBille
|
||||||
date: 2021-01-03 18:32:00 -0500
|
date: 2021-01-03 18:32:00 -0500
|
||||||
categories: [Blogging, Tutorial]
|
categories: [Blogging, Tutorial]
|
||||||
tags: [google analytics, pageviews]
|
tags: [google analytics, pageviews]
|
||||||
|
|||||||
@@ -43,59 +43,20 @@ body {
|
|||||||
font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif;
|
font-family: 'Source Sans Pro', 'Microsoft Yahei', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Scrollbar --- */
|
|
||||||
|
|
||||||
$scrollbar-size: 7px;
|
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: $scrollbar-size;
|
|
||||||
height: $scrollbar-size;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
@at-root body#{&} {
|
|
||||||
-webkit-box-shadow: inset 0 0 6px var(--scrollbar-track-bg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
background-color: var(--scrollbar-thumb-bg);
|
|
||||||
border-radius: calc(#{$scrollbar-size} / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.highlight {
|
|
||||||
border-color: transparent;
|
|
||||||
transition: border-color 0.5s ease;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--scrollbar-thumb-bg);
|
|
||||||
transition: border-color 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-webkit-scrollbar-thumb {
|
|
||||||
/* add border to act as background-color */
|
|
||||||
border-right-style: inset;
|
|
||||||
border-right-width: calc(100vw + 100vh);
|
|
||||||
border-color: inherit;
|
|
||||||
background-color: var(--highlight-bg-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Typography --- */
|
/* --- Typography --- */
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@extend %heading;
|
@extend %heading;
|
||||||
|
|
||||||
font-size: 1.8rem;
|
font-size: 1.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
@extend %heading;
|
@extend %heading;
|
||||||
@extend %section;
|
@extend %section;
|
||||||
@extend %anchor;
|
@extend %anchor-relative;
|
||||||
|
|
||||||
font-size: 1.4rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -103,7 +64,7 @@ h3 {
|
|||||||
@extend %section;
|
@extend %section;
|
||||||
@extend %anchor;
|
@extend %anchor;
|
||||||
|
|
||||||
font-size: 1.25rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
@@ -146,7 +107,19 @@ blockquote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kbd {
|
kbd {
|
||||||
|
font-family: inherit;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
line-height: 1.3rem;
|
||||||
|
min-width: 1.75rem;
|
||||||
|
text-align: center;
|
||||||
margin: 0 0.3rem;
|
margin: 0 0.3rem;
|
||||||
|
padding-top: 0.1rem;
|
||||||
|
color: var(--kbd-text-color);
|
||||||
|
background-color: var(--kbd-bg-color);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
border: solid 1px var(--kbd-wrap-color);
|
||||||
|
box-shadow: inset 0 -2px 0 var(--kbd-wrap-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
@@ -155,8 +128,6 @@ footer {
|
|||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
height: $footer-height;
|
height: $footer-height;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: #7a7b7d;
|
|
||||||
background-color: var(--footer-bg-color);
|
|
||||||
|
|
||||||
> div.d-flex {
|
> div.d-flex {
|
||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
@@ -171,7 +142,7 @@ footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: var(--footer-link);
|
@extend %text-color;
|
||||||
|
|
||||||
&:link {
|
&:link {
|
||||||
@include no-text-decoration;
|
@include no-text-decoration;
|
||||||
@@ -189,6 +160,40 @@ footer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i { // fontawesome icons
|
||||||
|
&.far,
|
||||||
|
&.fas {
|
||||||
|
@extend %no-cursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fade-in {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
img[data-src] {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
|
||||||
|
&[data-loaded=true] {
|
||||||
|
animation: fade-in linear 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
float: left;
|
||||||
|
margin: 0.75rem 1rem 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.right {
|
||||||
|
float: right;
|
||||||
|
margin: 0.75rem 0 1rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.shadow {
|
||||||
|
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* --- Panels --- */
|
/* --- Panels --- */
|
||||||
|
|
||||||
.access {
|
.access {
|
||||||
@@ -203,10 +208,6 @@ footer {
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.topbar-down {
|
|
||||||
top: 6rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
border-left: 1px solid var(--main-border-color);
|
border-left: 1px solid var(--main-border-color);
|
||||||
@@ -216,19 +217,16 @@ footer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
|
||||||
@include panel-label;
|
|
||||||
}
|
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-tags {
|
#panel-wrapper {
|
||||||
> div.post-content > div {
|
// the headings
|
||||||
max-width: 80%;
|
.panel-heading {
|
||||||
|
@include label(inherit);
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tag {
|
.post-tag {
|
||||||
@@ -248,6 +246,10 @@ footer {
|
|||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.topbar-down > div {
|
||||||
|
top: 6rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#access-lastmod {
|
#access-lastmod {
|
||||||
@@ -293,7 +295,7 @@ footer {
|
|||||||
&[scroll-focus=true] > p {
|
&[scroll-focus=true] > p {
|
||||||
background-color: var(--footnote-target-bg);
|
background-color: var(--footnote-target-bg);
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
-webkit-transition: background-color 1.5s ease-in-out; // Safari prior 6.1
|
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
||||||
transition: background-color 1.5s ease-in-out;
|
transition: background-color 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,7 +307,7 @@ footer {
|
|||||||
@include pl-pr(2px);
|
@include pl-pr(2px);
|
||||||
|
|
||||||
border-bottom-style: none !important;
|
border-bottom-style: none !important;
|
||||||
-webkit-transition: background-color 1.5s ease-in-out; // Safari prior 6.1
|
-webkit-transition: background-color 1.5s ease-in-out; /* Safari prior 6.1 */
|
||||||
transition: background-color 1.5s ease-in-out;
|
transition: background-color 1.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,26 +329,10 @@ footer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post {
|
|
||||||
h1 {
|
|
||||||
margin-top: 3rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
em { /* MarkDown italic */
|
|
||||||
padding-right: 0.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
code {
|
|
||||||
@extend %link-hover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Begin of Markdown table style --- */
|
/* --- Begin of Markdown table style --- */
|
||||||
|
|
||||||
.table-wrapper { // it will be created by Liquid
|
// it will be created by Liquid
|
||||||
|
.table-wrapper {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
|
|
||||||
@@ -385,6 +371,35 @@ footer {
|
|||||||
|
|
||||||
/* --- post --- */
|
/* --- post --- */
|
||||||
|
|
||||||
|
.post {
|
||||||
|
h1 {
|
||||||
|
margin-top: 3rem;
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
&.img-link {
|
||||||
|
@extend %no-cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
// created by `_includes/img-extra.html`
|
||||||
|
&.popup {
|
||||||
|
cursor: zoom-in;
|
||||||
|
|
||||||
|
> img[data-src]:not(.normal):not(.left):not(.right) {
|
||||||
|
@include align-center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
code {
|
||||||
|
@extend %link-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // a
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.pageviews .fa-spinner {
|
.pageviews .fa-spinner {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
}
|
}
|
||||||
@@ -394,9 +409,6 @@ footer {
|
|||||||
word-spacing: 1px;
|
word-spacing: 1px;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@extend %link-color;
|
|
||||||
@extend %link-underline;
|
|
||||||
|
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
}
|
}
|
||||||
@@ -405,6 +417,10 @@ footer {
|
|||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %normal-font-style;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
@@ -414,54 +430,8 @@ footer {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|
||||||
@mixin caption {
|
|
||||||
+ em {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 80%;
|
|
||||||
padding: 0;
|
|
||||||
color: #6d6c6c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fade-in {
|
|
||||||
from { opacity: 0; }
|
|
||||||
to { opacity: 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
img[data-src] {
|
|
||||||
margin: 0.5rem 0;
|
|
||||||
|
|
||||||
&[data-loaded=true] {
|
|
||||||
animation: fade-in linear 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.left {
|
|
||||||
float: left;
|
|
||||||
margin: 0.75rem 1rem 1rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
|
||||||
float: right;
|
|
||||||
margin: 0.75rem 0 1rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.shadow {
|
|
||||||
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include caption;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
blockquote & {
|
|
||||||
color: var(--link-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(.img-link) {
|
&:not(.img-link) {
|
||||||
@extend %link-color;
|
|
||||||
@extend %link-underline;
|
@extend %link-underline;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -469,19 +439,16 @@ footer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.popup { // created by `_includes/img-extra.html`
|
&.img-link + em {
|
||||||
cursor: zoom-in;
|
display: block;
|
||||||
|
text-align: center;
|
||||||
> img[data-src]:not(.normal):not(.left):not(.right) {
|
font-style: normal;
|
||||||
@include align-center;
|
font-size: 80%;
|
||||||
}
|
padding: 0;
|
||||||
|
color: #6d6c6c;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.img-link {
|
}
|
||||||
@include caption;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // a
|
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
// attribute 'hide-bullet' was added by liquid
|
// attribute 'hide-bullet' was added by liquid
|
||||||
@@ -574,10 +541,6 @@ footer {
|
|||||||
|
|
||||||
/* --- Effects classes --- */
|
/* --- Effects classes --- */
|
||||||
|
|
||||||
.semi-bold {
|
|
||||||
font-weight: 600 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loaded {
|
.loaded {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
|
|
||||||
@@ -825,7 +788,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
} // ul
|
} // ul
|
||||||
|
|
||||||
.sidebar-bottom {
|
.sidebar-bottom {
|
||||||
font-size: 1.2rem;
|
|
||||||
margin-bottom: 2.1rem;
|
margin-bottom: 2.1rem;
|
||||||
|
|
||||||
@include ml-mr(auto);
|
@include ml-mr(auto);
|
||||||
@@ -842,22 +804,31 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
i {
|
i {
|
||||||
line-height: 1.75rem; // default line-height in body
|
font-size: 1.2rem;
|
||||||
vertical-align: middle;
|
line-height: 1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mode-toggle-wrapper {
|
.mode-toggle {
|
||||||
@extend %icon;
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
margin-bottom: 1px;
|
||||||
|
background-color: transparent;
|
||||||
|
|
||||||
i {
|
@extend %icon;
|
||||||
@extend %sidebar-links;
|
@extend %sidebar-links;
|
||||||
@extend %cursor-pointer;
|
|
||||||
|
> i {
|
||||||
@extend %clickable-transition;
|
@extend %clickable-transition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover > i {
|
||||||
|
color: var(--sidebar-active-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-border {
|
.icon-border {
|
||||||
|
@extend %no-cursor;
|
||||||
|
|
||||||
background-color: var(--sidebar-muted-color);
|
background-color: var(--sidebar-muted-color);
|
||||||
content: "";
|
content: "";
|
||||||
width: 3px;
|
width: 3px;
|
||||||
@@ -865,10 +836,6 @@ $sidebar-display: "sidebar-display";
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mode-toggle-wrapper:hover > i {
|
|
||||||
color: var(--sidebar-active-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // .sidebar-bottom
|
} // .sidebar-bottom
|
||||||
|
|
||||||
} // #sidebar
|
} // #sidebar
|
||||||
@@ -991,7 +958,11 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
#search-hints {
|
#search-hints {
|
||||||
display: none;
|
padding: 0 1rem;
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.post-tag {
|
.post-tag {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -1000,13 +971,15 @@ $sidebar-display: "sidebar-display";
|
|||||||
background: var(--search-tag-bg);
|
background: var(--search-tag-bg);
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
margin: 0 1rem 1rem 0;
|
margin: 0 1.25rem 1rem 0;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "#";
|
content: "#";
|
||||||
color: var(--text-muted-color);
|
color: var(--text-muted-color);
|
||||||
padding-right: 0.2rem;
|
padding-right: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@extend %link-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1063,7 +1036,9 @@ $sidebar-display: "sidebar-display";
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page {
|
#core-wrapper {
|
||||||
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$bottom-min-height}) !important;
|
||||||
|
|
||||||
.categories,
|
.categories,
|
||||||
#tags,
|
#tags,
|
||||||
#archives {
|
#archives {
|
||||||
@@ -1100,22 +1075,26 @@ $sidebar-display: "sidebar-display";
|
|||||||
@include pl-pr(0);
|
@include pl-pr(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#main > div.row:first-child > div {
|
#main {
|
||||||
&:nth-child(1),
|
.row:first-child {
|
||||||
&:nth-child(2) {
|
> div {
|
||||||
margin-top: $topbar-height; /* same as the height of topbar */
|
&:nth-child(1),
|
||||||
|
&:nth-child(2) {
|
||||||
|
margin-top: $topbar-height; /* same as the height of topbar */
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
/* 3rem for topbar, 6rem for footer */
|
||||||
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$bottom-min-height});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:first-child {
|
div.row:first-of-type:last-of-type { // alone
|
||||||
/* 3rem for topbar, 6rem for footer */
|
margin-bottom: 4rem;
|
||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$post-extend-min-height});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-wrapper {
|
|
||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$post-extend-min-height}) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#topbar-wrapper.row,
|
#topbar-wrapper.row,
|
||||||
#main > .row,
|
#main > .row,
|
||||||
#search-result-wrapper > .row {
|
#search-result-wrapper > .row {
|
||||||
@@ -1170,12 +1149,12 @@ $sidebar-display: "sidebar-display";
|
|||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height});
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height});
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-wrapper {
|
#core-wrapper {
|
||||||
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$post-extend-min-height}) !important;
|
min-height: calc(100vh - #{$topbar-height} - #{$footer-height} - #{$bottom-min-height}) !important;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
margin-top: 2.2rem;
|
margin-top: 2.2rem;
|
||||||
font-size: 1.55rem;
|
font-size: 1.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1313,18 +1292,13 @@ $sidebar-display: "sidebar-display";
|
|||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-hints {
|
|
||||||
display: block;
|
|
||||||
padding: 0 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tags {
|
#tags {
|
||||||
-webkit-box-pack: center !important;
|
-webkit-box-pack: center !important;
|
||||||
-ms-flex-pack: center !important;
|
-ms-flex-pack: center !important;
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#page h1.dynamic-title {
|
h1.dynamic-title {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
~ .post-content {
|
~ .post-content {
|
||||||
@@ -1518,6 +1492,10 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search-hints {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.post-content {
|
.post-content {
|
||||||
font-size: 1.03rem;
|
font-size: 1.03rem;
|
||||||
}
|
}
|
||||||
@@ -1677,6 +1655,7 @@ $sidebar-display: "sidebar-display";
|
|||||||
}
|
}
|
||||||
|
|
||||||
> span,
|
> span,
|
||||||
|
> button.mode-toggle,
|
||||||
> a {
|
> a {
|
||||||
@include ml-mr(0.15rem);
|
@include ml-mr(0.15rem);
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,46 @@
|
|||||||
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%section {
|
||||||
|
#core-wrapper & {
|
||||||
|
margin-top: 2.5rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%anchor {
|
||||||
|
.anchor {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (hover: hover) {
|
||||||
|
.anchor {
|
||||||
|
border-bottom: none !important;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.25s ease-in, visibility 0s ease-in 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.anchor {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.25s ease-in, visibility 0s ease-in 0s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%anchor-relative {
|
||||||
|
@extend %anchor;
|
||||||
|
|
||||||
|
.anchor {
|
||||||
|
position: relative;
|
||||||
|
bottom: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
%tag-hover {
|
%tag-hover {
|
||||||
background: var(--tag-hover);
|
background: var(--tag-hover);
|
||||||
transition: background 0.35s ease-in-out;
|
transition: background 0.35s ease-in-out;
|
||||||
@@ -39,26 +79,22 @@
|
|||||||
transition: color 0.35s ease-in-out;
|
transition: color 0.35s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%no-cursor {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
%no-bottom-border {
|
%no-bottom-border {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
%section {
|
|
||||||
#post-wrapper & {
|
|
||||||
line-height: 1.2;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%anchor {
|
|
||||||
padding-top: 3.5rem;
|
|
||||||
margin-top: -2.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
%cursor-pointer {
|
%cursor-pointer {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%normal-font-style {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------- scss mixin --------- */
|
/* ---------- scss mixin --------- */
|
||||||
|
|
||||||
@mixin no-text-decoration {
|
@mixin no-text-decoration {
|
||||||
@@ -84,28 +120,12 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin semi-bold {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin label($font-size: 1rem, $font-weight: 600, $color: var(--label-color)) {
|
@mixin label($font-size: 1rem, $font-weight: 600, $color: var(--label-color)) {
|
||||||
color: $color;
|
color: $color;
|
||||||
font-size: $font-size;
|
font-size: $font-size;
|
||||||
font-weight: $font-weight;
|
font-weight: $font-weight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin panel-label {
|
|
||||||
@include label(inherit);
|
|
||||||
|
|
||||||
display: block;
|
|
||||||
line-height: 1.2;
|
|
||||||
padding-top: 0.5rem;
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin align-center {
|
@mixin align-center {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
|||||||
@@ -38,13 +38,8 @@ $code-radius: 6px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
%code-snippet-padding {
|
%code-snippet-padding {
|
||||||
padding: 1.2rem;
|
padding-left: 1rem;
|
||||||
}
|
padding-right: 1.5rem;
|
||||||
|
|
||||||
div > pre {
|
|
||||||
@extend %code-snippet-bg;
|
|
||||||
@extend %code-snippet-radius;
|
|
||||||
@extend %code-snippet-padding;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlighter-rouge {
|
.highlighter-rouge {
|
||||||
@@ -65,6 +60,8 @@ div > pre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -74,20 +71,12 @@ div > pre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
|
|
||||||
td pre {
|
td pre {
|
||||||
overflow: visible; /* Fixed iOS safari overflow-x */
|
overflow: visible; /* Fixed iOS safari overflow-x */
|
||||||
word-break: normal; /* Fixed iOS safari linenos code break */
|
word-break: normal; /* Fixed iOS safari linenos code break */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lineno {
|
.lineno {
|
||||||
padding-right: 0.5rem;
|
padding-right: 0.5rem;
|
||||||
min-width: 2.2rem;
|
min-width: 2.2rem;
|
||||||
@@ -121,22 +110,26 @@ code {
|
|||||||
background-color: var(--inline-code-bg);
|
background-color: var(--inline-code-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@at-root a > &.highlighter-rouge {
|
a > &.highlighter-rouge {
|
||||||
padding-bottom: 0; // show link's underlinke
|
padding-bottom: 0; // show link's underlinke
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@at-root a:hover > &.highlighter-rouge {
|
a:hover > &.highlighter-rouge {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote &.highlighter-rouge {
|
blockquote &.highlighter-rouge {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.highlight > & {
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
padding: 1.2rem 1.5rem 1.2rem 1rem;
|
@extend %code-snippet-padding;
|
||||||
|
|
||||||
// Prevent some browser extends from
|
// Prevent some browser extends from
|
||||||
// changing the URL string of code block.
|
// changing the URL string of code block.
|
||||||
@@ -160,62 +153,80 @@ div {
|
|||||||
}
|
}
|
||||||
|
|
||||||
td.rouge-code {
|
td.rouge-code {
|
||||||
@extend %code-snippet-padding;
|
padding-left: 1.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-header {
|
.code-header {
|
||||||
background: var(--code-header-bg);
|
@extend %no-cursor;
|
||||||
|
|
||||||
|
$code-header-height: 2.25rem;
|
||||||
|
|
||||||
border-top-left-radius: $code-radius;
|
border-top-left-radius: $code-radius;
|
||||||
border-top-right-radius: $code-radius;
|
border-top-right-radius: $code-radius;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
line-height: 1.85rem;
|
height: $code-header-height;
|
||||||
|
|
||||||
// icons
|
&::before {
|
||||||
i {
|
$dot-size: 0.75rem;
|
||||||
font-size: 1rem;
|
$dot-margin: 0.5rem;
|
||||||
color: var(--lang-badge-muted-color);
|
|
||||||
|
|
||||||
&.small {
|
content: "";
|
||||||
font-size: 70%;
|
display: inline-block;
|
||||||
}
|
margin-left: 1rem;
|
||||||
|
width: $dot-size;
|
||||||
|
height: $dot-size;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: var(--code-header-muted-color);
|
||||||
|
box-shadow:
|
||||||
|
($dot-size + $dot-margin) 0 0 var(--code-header-muted-color),
|
||||||
|
($dot-size + $dot-margin) * 2 0 0 var(--code-header-muted-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the label block
|
// the label block
|
||||||
span {
|
span {
|
||||||
padding-left: 0.35rem;
|
// label icon
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: attr(text-data);
|
|
||||||
font-size: 0.85rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--lang-badge-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
i {
|
i {
|
||||||
margin: 0 0.5rem;
|
font-size: 1rem;
|
||||||
|
margin-right: 0.4rem;
|
||||||
|
color: var(--code-header-icon-color);
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@at-root [file] #{&} > i {
|
@at-root [file] #{&} > i {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 1px; // center the file icon
|
top: 1px; // center the file icon
|
||||||
margin-left: 0.25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// label text
|
||||||
|
&::after {
|
||||||
|
content: attr(label-text);
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--code-header-text-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clipboard
|
// clipboard
|
||||||
button {
|
button {
|
||||||
border: 1px solid var(--code-header-bg);
|
@extend %cursor-pointer;
|
||||||
|
|
||||||
|
border: 1px solid transparent;
|
||||||
border-radius: $code-radius;
|
border-radius: $code-radius;
|
||||||
|
height: $code-header-height;
|
||||||
|
width: $code-header-height;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 1.95rem;
|
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
|
|
||||||
@extend %cursor-pointer;
|
i {
|
||||||
|
color: var(--code-header-icon-color);
|
||||||
|
}
|
||||||
|
|
||||||
&[timeout] {
|
&[timeout] {
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ $main-content-max-width: 1150px !default;
|
|||||||
|
|
||||||
$panel-max-width: 300px !default;
|
$panel-max-width: 300px !default;
|
||||||
|
|
||||||
$post-extend-min-height: 35rem !default;
|
$bottom-min-height: 35rem !default;
|
||||||
|
|
||||||
/* syntax highlight */
|
/* syntax highlight */
|
||||||
|
|
||||||
|
|||||||
@@ -74,9 +74,9 @@
|
|||||||
--highlighter-rouge-color: #de6b18;
|
--highlighter-rouge-color: #de6b18;
|
||||||
--highlight-lineno-color: #6c6c6d;
|
--highlight-lineno-color: #6c6c6d;
|
||||||
--inline-code-bg: #272822;
|
--inline-code-bg: #272822;
|
||||||
--code-header-bg: #353535;
|
--code-header-text-color: #6a6a6a;
|
||||||
--lang-badge-color: #858586;
|
--code-header-muted-color: rgb(60 60 60);
|
||||||
--lang-badge-muted-color: #6c6c6d;
|
--code-header-icon-color: rgb(86 86 86);
|
||||||
--clipboard-checked-color: #2bcc2b;
|
--clipboard-checked-color: #2bcc2b;
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
@@ -84,5 +84,4 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
pre { color: #bfbfbf; } /* override Bootstrap */
|
pre { color: #bfbfbf; } /* override Bootstrap */
|
||||||
kbd { background-color: black; }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
--mask-bg: rgb(68, 69, 70);
|
--mask-bg: rgb(68, 69, 70);
|
||||||
--main-wrapper-bg: rgb(27, 27, 30);
|
--main-wrapper-bg: rgb(27, 27, 30);
|
||||||
--main-border-color: rgb(44, 45, 45);
|
--main-border-color: rgb(44, 45, 45);
|
||||||
--scrollbar-track-bg: rgba(0, 0, 0, 0.3);
|
|
||||||
--scrollbar-thumb-bg: rgb(173 171 171 / 50%);
|
|
||||||
|
|
||||||
/* Common color */
|
/* Common color */
|
||||||
--text-color: rgb(175, 176, 177);
|
--text-color: rgb(175, 176, 177);
|
||||||
@@ -67,6 +65,10 @@
|
|||||||
--card-bg: rgb(39, 40, 43);
|
--card-bg: rgb(39, 40, 43);
|
||||||
--card-border-color: rgb(53, 53, 60);
|
--card-border-color: rgb(53, 53, 60);
|
||||||
--card-box-shadow: var(--main-wrapper-bg);
|
--card-box-shadow: var(--main-wrapper-bg);
|
||||||
|
--preview-img-bg: radial-gradient(circle, rgb(22 22 24) 0%, rgb(32 32 32) 100%);
|
||||||
|
--kbd-wrap-color: #6a6a6a;
|
||||||
|
--kbd-text-color: #d3d3d3;
|
||||||
|
--kbd-bg-color: #242424;
|
||||||
|
|
||||||
/* tags */
|
/* tags */
|
||||||
--tag-border: rgb(59, 79, 88);
|
--tag-border: rgb(59, 79, 88);
|
||||||
@@ -84,12 +86,8 @@
|
|||||||
--timeline-color: rgb(63, 65, 68);
|
--timeline-color: rgb(63, 65, 68);
|
||||||
--timeline-year-dot-color: var(--timeline-color);
|
--timeline-year-dot-color: var(--timeline-color);
|
||||||
|
|
||||||
/* Footer */
|
.post img[data-src] {
|
||||||
--footer-bg-color: var(--main-wrapper-bg);
|
filter: brightness(95%);
|
||||||
--footer-link: rgb(171, 171, 171);
|
|
||||||
|
|
||||||
.post-content img {
|
|
||||||
filter: brightness(90%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
@@ -139,7 +137,12 @@
|
|||||||
rgb(39, 39, 45),
|
rgb(39, 39, 45),
|
||||||
rgb(26, 26, 30)
|
rgb(26, 26, 30)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
color-scheme: dark;
|
||||||
|
|
||||||
|
#disqus_thread {
|
||||||
|
color-scheme: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // dark-scheme
|
} // dark-scheme
|
||||||
|
|||||||
@@ -71,9 +71,9 @@
|
|||||||
--highlighter-rouge-color: #2f2f2f;
|
--highlighter-rouge-color: #2f2f2f;
|
||||||
--highlight-lineno-color: #c2c6cc;
|
--highlight-lineno-color: #c2c6cc;
|
||||||
--inline-code-bg: #f3f3f3;
|
--inline-code-bg: #f3f3f3;
|
||||||
--code-header-bg: #eaeaea;
|
--code-header-text-color: #a3a3b1;
|
||||||
--lang-badge-color: rgb(128 128 128 / 87%);
|
--code-header-muted-color: #ebebeb;
|
||||||
--lang-badge-muted-color: rgb(128 128 128 / 36%);
|
--code-header-icon-color: #d1d1d1;
|
||||||
--clipboard-checked-color: #43c743;
|
--clipboard-checked-color: #43c743;
|
||||||
|
|
||||||
} // light-syntax
|
} // light-syntax
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
--mask-bg: #c1c3c5;
|
--mask-bg: #c1c3c5;
|
||||||
--main-wrapper-bg: white;
|
--main-wrapper-bg: white;
|
||||||
--main-border-color: #f3f3f3;
|
--main-border-color: #f3f3f3;
|
||||||
--scrollbar-track-bg: rgba(0, 0, 0, 0.3);
|
|
||||||
--scrollbar-thumb-bg: rgba(0, 0, 0, 0.3);
|
|
||||||
|
|
||||||
/* Common color */
|
/* Common color */
|
||||||
--text-color: #34343c;
|
--text-color: #34343c;
|
||||||
@@ -66,6 +64,10 @@
|
|||||||
--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%);
|
||||||
|
--kbd-wrap-color: #bdbdbd;
|
||||||
|
--kbd-text-color: var(--text-color);
|
||||||
|
--kbd-bg-color: white;
|
||||||
|
|
||||||
/* Categories */
|
/* Categories */
|
||||||
--categories-hover-bg: var(--btn-border-color);
|
--categories-hover-bg: var(--btn-border-color);
|
||||||
@@ -76,7 +78,4 @@
|
|||||||
--timeline-node-bg: #c2c6cc;
|
--timeline-node-bg: #c2c6cc;
|
||||||
--timeline-year-dot-color: #ffffff;
|
--timeline-year-dot-color: #ffffff;
|
||||||
|
|
||||||
/* Footer */
|
|
||||||
--footer-bg-color: #ffffff;
|
|
||||||
--footer-link: #424242;
|
|
||||||
} // light-scheme
|
} // light-scheme
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* The styles for Jekyll theme Chirpy
|
* The styles for Jekyll theme Chirpy
|
||||||
*
|
*
|
||||||
* Chirpy v4.3.4 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -74,10 +74,14 @@
|
|||||||
.post-meta {
|
.post-meta {
|
||||||
i {
|
i {
|
||||||
font-size: 0.73rem;
|
font-size: 0.73rem;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-left: 1.2rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
span:not(:last-child) {
|
em {
|
||||||
margin-right: 1.2rem;
|
@extend %normal-font-style;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,27 +16,37 @@
|
|||||||
border-color: var(--btn-border-color);
|
border-color: var(--btn-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin dot($pl: 0.2rem, $pr: 0.4rem) {
|
@mixin dot($pl: 0.25rem, $pr: 0.25rem) {
|
||||||
content: "\2022";
|
content: "\2022";
|
||||||
color: rgba(158, 158, 158, 0.8);
|
|
||||||
padding-left: $pl;
|
padding-left: $pl;
|
||||||
padding-right: $pr;
|
padding-right: $pr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-wrapper .post-meta {
|
%text-color {
|
||||||
> div:nth-child(2) {
|
color: var(--text-color);
|
||||||
> span:not(:first-child)::before {
|
}
|
||||||
@include dot;
|
|
||||||
|
h1 + .post-meta {
|
||||||
|
span + span::before {
|
||||||
|
@include dot;
|
||||||
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %text-color;
|
||||||
|
|
||||||
|
a {
|
||||||
|
@extend %text-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-content {
|
img.preview-img {
|
||||||
.preview-img {
|
margin-top: 3.75rem;
|
||||||
@include align-center;
|
margin-bottom: 0;
|
||||||
|
border-radius: 6px;
|
||||||
|
|
||||||
margin-top: 0;
|
&.bg[data-loaded=true] {
|
||||||
margin-bottom: 2.5rem !important;
|
background: var(--preview-img-bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +54,10 @@
|
|||||||
margin-top: 6rem;
|
margin-top: 6rem;
|
||||||
border-bottom: 1px double var(--main-border-color);
|
border-bottom: 1px double var(--main-border-color);
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
|
|
||||||
|
.post-meta a {
|
||||||
|
@extend %link-underline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tags {
|
.post-tags {
|
||||||
@@ -109,7 +123,7 @@
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .post-navigation
|
} /* .post-navigation */
|
||||||
|
|
||||||
@keyframes fade-up {
|
@keyframes fade-up {
|
||||||
from {
|
from {
|
||||||
@@ -131,14 +145,6 @@
|
|||||||
top: 4rem;
|
top: 4rem;
|
||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
animation: fade-up 0.8s;
|
animation: fade-up 0.8s;
|
||||||
|
|
||||||
&.topbar-down {
|
|
||||||
top: 6rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> span {
|
|
||||||
@include panel-label;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#toc li a {
|
#toc li a {
|
||||||
@@ -165,6 +171,10 @@ nav[data-toggle=toc] {
|
|||||||
@include label(1.1rem, 600);
|
@include label(1.1rem, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %normal-font-style;
|
||||||
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
border-color: var(--card-border-color);
|
border-color: var(--card-border-color);
|
||||||
background-color: var(--card-bg);
|
background-color: var(--card-bg);
|
||||||
@@ -174,7 +184,7 @@ nav[data-toggle=toc] {
|
|||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
color: var(--text-color);
|
@extend %text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -220,14 +230,17 @@ nav[data-toggle=toc] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#post-extend-wrapper {
|
#tail-wrapper {
|
||||||
min-height: 2rem;
|
min-height: 2rem;
|
||||||
|
|
||||||
#disqus_thread {
|
> div:last-of-type {
|
||||||
min-height: 7.5rem;
|
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#disqus_thread {
|
||||||
|
min-height: 8.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-tail-bottom a {
|
.post-tail-bottom a {
|
||||||
@@ -288,13 +301,13 @@ nav[data-toggle=toc] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .share-icons
|
} /* .share-icons */
|
||||||
|
|
||||||
.fas.fa-link {
|
.fas.fa-link {
|
||||||
@include btn-sharing-color(rgb(171, 171, 171));
|
@include btn-sharing-color(rgb(171, 171, 171));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // .share-wrapper
|
} /* .share-wrapper */
|
||||||
|
|
||||||
.share-label {
|
.share-label {
|
||||||
@include label(inherit, 400, inherit);
|
@include label(inherit, 400, inherit);
|
||||||
@@ -308,7 +321,7 @@ nav[data-toggle=toc] {
|
|||||||
line-height: 1.2rem;
|
line-height: 1.2rem;
|
||||||
|
|
||||||
> a {
|
> a {
|
||||||
font-weight: 600;
|
color: var(--text-color);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@extend %link-hover;
|
@extend %link-hover;
|
||||||
@@ -318,9 +331,14 @@ nav[data-toggle=toc] {
|
|||||||
span:last-child {
|
span:last-child {
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
}
|
}
|
||||||
} // .license-wrapper
|
|
||||||
|
} /* .license-wrapper */
|
||||||
|
|
||||||
@media all and (max-width: 576px) {
|
@media all and (max-width: 576px) {
|
||||||
|
.preview-img[data-src] {
|
||||||
|
margin-top: 2.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.post-tail-bottom {
|
.post-tail-bottom {
|
||||||
-ms-flex-wrap: wrap-reverse !important;
|
-ms-flex-wrap: wrap-reverse !important;
|
||||||
flex-wrap: wrap-reverse !important;
|
flex-wrap: wrap-reverse !important;
|
||||||
@@ -338,29 +356,17 @@ nav[data-toggle=toc] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 768px) {
|
|
||||||
#post-wrapper {
|
|
||||||
.post-meta {
|
|
||||||
> div:not(:first-child)::before {
|
|
||||||
@include dot(0.5rem, 0.2rem);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.flex-column {
|
|
||||||
-webkit-box-orient: horizontal !important;
|
|
||||||
-webkit-box-direction: normal !important;
|
|
||||||
-ms-flex-direction: row !important;
|
|
||||||
flex-direction: row !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // .post
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide SideBar and TOC */
|
/* Hide SideBar and TOC */
|
||||||
@media all and (max-width: 830px) {
|
@media all and (max-width: 849px) {
|
||||||
.post-navigation {
|
.post-navigation {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
margin-left: -0.5rem;
|
margin-left: -0.5rem;
|
||||||
margin-right: -0.5rem;
|
margin-right: -0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.preview-img[data-src] {
|
||||||
|
max-width: 100vw;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
assets/js/dist/categories.min.js
vendored
4
assets/js/dist/categories.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.3.4 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){const o=$("#sidebar-trigger"),e=$("#search-trigger"),s=$("#search-cancel"),t=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),f=function(){let o=0;return{block(){o=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(o)},getOffset:()=>o}}(),u={on(){o.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),n.addClass("d-flex"),s.addClass("loaded")},off(){s.removeClass("loaded"),n.removeClass("d-flex"),o.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},p=function(){let o=!1;return{on(){o||(f.block(),r.removeClass("unloaded"),a.addClass("unloaded"),o=!0)},off(){o&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),t.removeClass("visible"),a.removeClass("unloaded"),f.release(),i.val(""),o=!1)},isVisible:()=>o}}();function h(){return s.hasClass("loaded")}e.click(function(){u.on(),p.on(),i.focus()}),s.click(function(){u.off(),p.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(o){8===o.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),t.hasClass("visible")||t.addClass("visible"),h()&&c.addClass("unloaded"))}),t.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):p.off(),i.focus(),t.removeClass("visible")})}),$(function(){const o=function(){let o=!1;const e=$("body");return{toggle(){!1===o?e.attr("sidebar-display",""):e.removeAttr("sidebar-display"),o=!o}}}();$("#sidebar-trigger").click(o.toggle),$("#mask").click(o.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const o=$("#topbar-wrapper"),e=$("#toc-wrapper"),s=$(".access"),t=$("#search-input");let a,l=0;const n=5,r=o.outerHeight();$(window).scroll(function(o){$("#topbar-title").is(":hidden")&&(a=!0)}),setInterval(function(){a&&(!function(){var a=$(this).scrollTop();Math.abs(l-a)<=n||(a>l&&a>r?(o.removeClass("topbar-down").addClass("topbar-up"),e.length>0&&e.removeClass("topbar-down"),s.length>0&&s.removeClass("topbar-down"),t.is(":focus")&&t.blur()):a+$(window).height()<$(document).height()&&(o.removeClass("topbar-up").addClass("topbar-down"),e.length>0&&e.addClass("topbar-down"),s.length>0&&s.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const o=$("#topbar-title"),e=$("div.post>h1"),s=o.text().trim();let t=e.length>0?e.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||e.is(":hidden")||o.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?o.text()!==t&&o.text(t):o.text()!==s&&o.text(s)}),o.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const o=$(".collapse");o.on("hide.bs.collapse",function(){const o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${o} i.fas`).addClass("rotate"),$(`#${o}`).removeClass("hide-border-bottom"))}),o.on("show.bs.collapse",function(){const o="h_"+$(this).attr("id").substring("l_".length);o&&($(`#${o} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${o} i.fas`).removeClass("rotate"),$(`#${o}`).addClass("hide-border-bottom"))})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const o=$(e.target);let t=o.prop("tagName")==="button".toUpperCase()?o:o.parent();t.blur(),flipMode()})}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),r=$("#search-wrapper"),n=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),f={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),r.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),r.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},p=function(){let e=!1;return{on(){e||(u.block(),n.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),n.addClass("unloaded"),s.removeClass("visible"),a.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible(){return e}}}();function h(){return t.hasClass("loaded")}o.click(function(){f.on(),p.on(),i.focus()}),t.click(function(){f.off(),p.off()}),i.focus(function(){r.addClass("input-focus")}),i.focusout(function(){r.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):p.off():""!==i.val()&&(p.on(),s.hasClass("visible")||s.addClass("visible"),h()&&c.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):p.off(),i.focus(),s.removeClass("visible")})}),$(function(){var e=function(){const e="sidebar-display";let o=!1;const t=$("body");return{toggle(){!1===o?t.attr(e,""):t.removeAttr(e),o=!o}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),s=$("#panel-wrapper"),a=$("#search-input"),l="topbar-up",r="topbar-down",n="toc-scrolling-up";let o,d=0;const i=t.outerHeight(),c=t.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(o=!0)}),setInterval(function(){o&&(function(){var e,o=$(this).scrollTop();Math.abs(d-o)<=i||(o>d?o>c&&(t.removeClass(r).addClass(l),s.removeClass(r),a.is(":focus")&&a.blur()):o+$(window).height()<$(document).height()&&(void 0!==(e=t.attr(n))?"false"===e&&t.removeAttr(n):(t.removeClass(l).addClass(r),s.addClass(r))),d=o)}(),o=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=(0<o.length?o:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t))}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){const e=$(".collapse");e.on("hide.bs.collapse",function(){var e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder-open`).attr("class","far fa-folder fa-fw"),$(`#${e} i.fas`).addClass("rotate"),$("#"+e).removeClass("hide-border-bottom"))}),e.on("show.bs.collapse",function(){var e="h_"+$(this).attr("id").substring("l_".length);e&&($(`#${e} .far.fa-folder`).attr("class","far fa-folder-open fa-fw"),$(`#${e} i.fas`).removeClass("rotate"),$("#"+e).addClass("hide-border-bottom"))})});
|
||||||
4
assets/js/dist/commons.min.js
vendored
4
assets/js/dist/commons.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.3.4 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),s=$("#search-cancel"),t=$("#search-cleaner"),a=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),d=$("#search-result-wrapper"),r=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),p={on(){e.addClass("unloaded"),l.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),s.addClass("loaded")},off(){s.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),l.removeClass("unloaded"),o.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),d.removeClass("unloaded"),a.addClass("unloaded"),e=!0)},off(){e&&(r.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),d.addClass("unloaded"),t.removeClass("visible"),a.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible:()=>e}}();function h(){return s.hasClass("loaded")}o.click(function(){p.on(),f.on(),i.focus()}),s.click(function(){p.off(),f.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):f.off():""!==i.val()&&(f.on(),t.hasClass("visible")||t.addClass("visible"),h()&&c.addClass("unloaded"))}),t.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),r.empty()):f.off(),i.focus(),t.removeClass("visible")})}),$(function(){const e=function(){let e=!1;const o=$("body");return{toggle(){!1===e?o.attr("sidebar-display",""):o.removeAttr("sidebar-display"),e=!e}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#topbar-wrapper"),o=$("#toc-wrapper"),s=$(".access"),t=$("#search-input");let a,l=0;const n=5,d=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(a=!0)}),setInterval(function(){a&&(!function(){var a=$(this).scrollTop();Math.abs(l-a)<=n||(a>l&&a>d?(e.removeClass("topbar-down").addClass("topbar-up"),o.length>0&&o.removeClass("topbar-down"),s.length>0&&s.removeClass("topbar-down"),t.is(":focus")&&t.blur()):a+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),o.length>0&&o.addClass("topbar-down"),s.length>0&&s.addClass("topbar-down")),l=a)}(),a=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),s=e.text().trim();let t=o.length>0?o.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==t&&e.text(t):e.text()!==s&&e.text(s)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(e=>{const o=$(e.target);let t=o.prop("tagName")==="button".toUpperCase()?o:o.parent();t.blur(),flipMode()})}),$(function(){const e=$("#sidebar-trigger"),o=$("#search-trigger"),t=$("#search-cancel"),s=$("#search-cleaner"),l=$("#main"),a=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),d=$("#search-results"),i=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset(){return e}}}(),p={on(){e.addClass("unloaded"),a.addClass("unloaded"),o.addClass("unloaded"),n.addClass("d-flex"),t.addClass("loaded")},off(){t.removeClass("loaded"),n.removeClass("d-flex"),e.removeClass("unloaded"),a.removeClass("unloaded"),o.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),l.addClass("unloaded"),e=!0)},off(){e&&(d.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),s.removeClass("visible"),l.removeClass("unloaded"),u.release(),i.val(""),e=!1)},isVisible(){return e}}}();function h(){return t.hasClass("loaded")}o.click(function(){p.on(),f.on(),i.focus()}),t.click(function(){p.off(),f.off()}),i.focus(function(){n.addClass("input-focus")}),i.focusout(function(){n.removeClass("input-focus")}),i.on("keyup",function(e){8===e.keyCode&&""===i.val()?h()?c.removeClass("unloaded"):f.off():""!==i.val()&&(f.on(),s.hasClass("visible")||s.addClass("visible"),h()&&c.addClass("unloaded"))}),s.on("click",function(){i.val(""),h()?(c.removeClass("unloaded"),d.empty()):f.off(),i.focus(),s.removeClass("visible")})}),$(function(){var e=function(){const e="sidebar-display";let o=!1;const t=$("body");return{toggle(){!1===o?t.attr(e,""):t.removeAttr(e),o=!o}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const t=$("#topbar-wrapper"),s=$("#panel-wrapper"),l=$("#search-input"),a="topbar-up",n="topbar-down",r="toc-scrolling-up";let o,d=0;const i=t.outerHeight(),c=t.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(o=!0)}),setInterval(function(){o&&(function(){var e,o=$(this).scrollTop();Math.abs(d-o)<=i||(o>d?o>c&&(t.removeClass(n).addClass(a),s.removeClass(n),l.is(":focus")&&l.blur()):o+$(window).height()<$(document).height()&&(void 0!==(e=t.attr(r))?"false"===e&&t.removeAttr(r):(t.removeClass(a).addClass(n),s.addClass(n))),d=o)}(),o=!1)},250)}),$(function(){const e=$("#topbar-title"),o=$("div.post>h1"),t=e.text().trim();let s=(0<o.length?o:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(s)&&(s=s.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||o.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?e.text()!==s&&e.text(s):e.text()!==t&&e.text(t))}),e.click(function(){$("body,html").animate({scrollTop:0},800)})});
|
||||||
4
assets/js/dist/home.min.js
vendored
4
assets/js/dist/home.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.3.4 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
$(function(){$(window).scroll(()=>{$(this).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){const e=$("#sidebar-trigger"),t=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),l=$("#main"),n=$("#topbar-title"),s=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),d=$("#search-input"),c=$("#search-hints"),u=function(){let e=0;return{block(){e=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(e)},getOffset:()=>e}}(),p={on(){e.addClass("unloaded"),n.addClass("unloaded"),t.addClass("unloaded"),s.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),s.removeClass("d-flex"),e.removeClass("unloaded"),n.removeClass("unloaded"),t.removeClass("unloaded")}},f=function(){let e=!1;return{on(){e||(u.block(),r.removeClass("unloaded"),l.addClass("unloaded"),e=!0)},off(){e&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),l.removeClass("unloaded"),u.release(),d.val(""),e=!1)},isVisible:()=>e}}();function h(){return o.hasClass("loaded")}t.click(function(){p.on(),f.on(),d.focus()}),o.click(function(){p.off(),f.off()}),d.focus(function(){s.addClass("input-focus")}),d.focusout(function(){s.removeClass("input-focus")}),d.on("keyup",function(e){8===e.keyCode&&""===d.val()?h()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),h()?(c.removeClass("unloaded"),i.empty()):f.off(),d.focus(),a.removeClass("visible")})}),$(function(){const e=function(){let e=!1;const t=$("body");return{toggle(){!1===e?t.attr("sidebar-display",""):t.removeAttr("sidebar-display"),e=!e}}}();$("#sidebar-trigger").click(e.toggle),$("#mask").click(e.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const e=$("#topbar-wrapper"),t=$("#toc-wrapper"),o=$(".access"),a=$("#search-input");let l,n=0;const s=5,r=e.outerHeight();$(window).scroll(function(e){$("#topbar-title").is(":hidden")&&(l=!0)}),setInterval(function(){l&&(!function(){var l=$(this).scrollTop();Math.abs(n-l)<=s||(l>n&&l>r?(e.removeClass("topbar-down").addClass("topbar-up"),t.length>0&&t.removeClass("topbar-down"),o.length>0&&o.removeClass("topbar-down"),a.is(":focus")&&a.blur()):l+$(window).height()<$(document).height()&&(e.removeClass("topbar-up").addClass("topbar-down"),t.length>0&&t.addClass("topbar-down"),o.length>0&&o.addClass("topbar-down")),n=l)}(),l=!1)},250)}),$(function(){const e=$("#topbar-title"),t=$("div.post>h1"),o=e.text().trim();let a=t.length>0?t.text().trim():$("h1").text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){if($("#post-list").length||t.is(":hidden")||e.is(":hidden")||$("#sidebar.sidebar-expand").length)return!1;$(this).scrollTop()>=95?e.text()!==a&&e.text(a):e.text()!==o&&e.text(o)}),e.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){let e=$(".timeago").length,t=void 0;const o=$("meta[name=day-prompt]").attr("content"),a=$("meta[name=hour-prompt]").attr("content"),l=$("meta[name=minute-prompt]").attr("content"),n=$("meta[name=justnow-prompt]").attr("content");function s(){return $(".timeago").each(function(){if($(this).children("i").length>0){let t=$(this).clone().children().remove().end().text(),s=$(this).children("i"),r=s.text();$(this).text(function(t,s){let r=new Date,i=new Date(t);if(i.getFullYear()!==r.getFullYear()||i.getMonth()!==r.getMonth())return s;let d=Math.floor((r-i)/1e3),c=Math.floor(d/86400);if(c>=1)return e-=1,` ${c} ${o}`;let u=Math.floor(d/3600);if(u>=1)return` ${u} ${a}`;let $=Math.floor(d/60);return $>=1?` ${$} ${l}`:n}(r,t)),$(this).append(s)}}),0===e&&void 0!==t&&clearInterval(t),e}0!==e&&s()>0&&(t=setInterval(s,6e4))});
|
$(function(){$(window).scroll(()=>{50<$(this).scrollTop()&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()}),$("#back-to-top").click(()=>($("body,html").animate({scrollTop:0},800),!1))}),$(function(){$(".mode-toggle").click(t=>{const e=$(t.target);let o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();o.blur(),flipMode()})}),$(function(){const t=$("#sidebar-trigger"),e=$("#search-trigger"),o=$("#search-cancel"),a=$("#search-cleaner"),s=$("#main"),l=$("#topbar-title"),n=$("#search-wrapper"),r=$("#search-result-wrapper"),i=$("#search-results"),d=$("#search-input"),c=$("#search-hints"),u=function(){let t=0;return{block(){t=window.scrollY,$("html,body").scrollTop(0)},release(){$("html,body").scrollTop(t)},getOffset(){return t}}}(),p={on(){t.addClass("unloaded"),l.addClass("unloaded"),e.addClass("unloaded"),n.addClass("d-flex"),o.addClass("loaded")},off(){o.removeClass("loaded"),n.removeClass("d-flex"),t.removeClass("unloaded"),l.removeClass("unloaded"),e.removeClass("unloaded")}},f=function(){let t=!1;return{on(){t||(u.block(),r.removeClass("unloaded"),s.addClass("unloaded"),t=!0)},off(){t&&(i.empty(),c.hasClass("unloaded")&&c.removeClass("unloaded"),r.addClass("unloaded"),a.removeClass("visible"),s.removeClass("unloaded"),u.release(),d.val(""),t=!1)},isVisible(){return t}}}();function h(){return o.hasClass("loaded")}e.click(function(){p.on(),f.on(),d.focus()}),o.click(function(){p.off(),f.off()}),d.focus(function(){n.addClass("input-focus")}),d.focusout(function(){n.removeClass("input-focus")}),d.on("keyup",function(t){8===t.keyCode&&""===d.val()?h()?c.removeClass("unloaded"):f.off():""!==d.val()&&(f.on(),a.hasClass("visible")||a.addClass("visible"),h()&&c.addClass("unloaded"))}),a.on("click",function(){d.val(""),h()?(c.removeClass("unloaded"),i.empty()):f.off(),d.focus(),a.removeClass("visible")})}),$(function(){var t=function(){const t="sidebar-display";let e=!1;const o=$("body");return{toggle(){!1===e?o.attr(t,""):o.removeAttr(t),e=!e}}}();$("#sidebar-trigger").click(t.toggle),$("#mask").click(t.toggle)}),$(function(){$('[data-toggle="tooltip"]').tooltip()}),$(function(){const o=$("#topbar-wrapper"),a=$("#panel-wrapper"),s=$("#search-input"),l="topbar-up",n="topbar-down",r="toc-scrolling-up";let e,i=0;const d=o.outerHeight(),c=o.outerHeight();$(window).scroll(function(t){$("#topbar-title").is(":hidden")&&(e=!0)}),setInterval(function(){e&&(function(){var t,e=$(this).scrollTop();Math.abs(i-e)<=d||(e>i?e>c&&(o.removeClass(n).addClass(l),a.removeClass(n),s.is(":focus")&&s.blur()):e+$(window).height()<$(document).height()&&(void 0!==(t=o.attr(r))?"false"===t&&o.removeAttr(r):(o.removeClass(l).addClass(n),a.addClass(n))),i=e)}(),e=!1)},250)}),$(function(){const t=$("#topbar-title"),e=$("div.post>h1"),o=t.text().trim();let a=(0<e.length?e:$("h1")).text().trim();($("#page-category").length||$("#page-tag").length)&&/\s/.test(a)&&(a=a.replace(/[0-9]/g,"").trim()),$(window).scroll(function(){return!($("#post-list").length||e.is(":hidden")||t.is(":hidden")||$("#sidebar.sidebar-expand").length)&&void(95<=$(this).scrollTop()?t.text()!==a&&t.text(a):t.text()!==o&&t.text(o))}),t.click(function(){$("body,html").animate({scrollTop:0},800)})}),$(function(){let o=$(".timeago").length,t=void 0;const s=$("meta[name=day-prompt]").attr("content"),l=$("meta[name=hour-prompt]").attr("content"),n=$("meta[name=minute-prompt]").attr("content"),r=$("meta[name=justnow-prompt]").attr("content");function e(){return $(".timeago").each(function(){var t,e;!1!==$(this)[0].hasAttribute("date")?(e=function(t,e){let o=new Date,a=new Date(t);return a.getFullYear()!==o.getFullYear()||a.getMonth()!==o.getMonth()?e:(t=Math.floor((o-a)/1e3),1<=(e=Math.floor(t/86400))?` ${e} `+s:1<=(e=Math.floor(t/3600))?` ${e} `+l:1<=(t=Math.floor(t/60))?` ${t} `+n:r)}($(this).attr("date"),t=$(this).text()))===t?$(this).removeAttr("date"):$(this).text(e):--o}),0===o&&void 0!==t&&clearInterval(t),o}0!==o&&0<e()&&(t=setInterval(e,6e4))});
|
||||||
4
assets/js/dist/page.min.js
vendored
4
assets/js/dist/page.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/dist/post.min.js
vendored
4
assets/js/dist/post.min.js
vendored
File diff suppressed because one or more lines are too long
4
assets/js/dist/pvreport.min.js
vendored
4
assets/js/dist/pvreport.min.js
vendored
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Chirpy v4.3.4 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
* Chirpy v5.0.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||||
* © 2019 Cotes Chung
|
* © 2019 Cotes Chung
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
const getInitStatus=function(){let e=!1;return()=>{let t=e;return e||(e=!0),t}}(),PvOpts=function(){function e(e){return $(e).attr("content")}function t(t){let a=e(t);return void 0!==a&&!1!==a}return{getProxyMeta:()=>e("meta[name=pv-proxy-endpoint]"),getLocalMeta:()=>e("meta[name=pv-cache-path]"),hasProxyMeta:()=>t("meta[name=pv-proxy-endpoint]"),hasLocalMeta:()=>t("meta[name=pv-cache-path]")}}(),PvStorage=function(){const e={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t="same-origin",a="cors";function o(e){return localStorage.getItem(e)}function r(e,t){localStorage.setItem(e,t)}function n(t,a){r(e.KEY_PV,t),r(e.KEY_PV_SRC,a),r(e.KEY_CREATION,(new Date).toJSON())}return{keysCount:()=>Object.keys(e).length,hasCache:()=>null!==localStorage.getItem(e.KEY_PV),getCache:()=>JSON.parse(localStorage.getItem(e.KEY_PV)),saveLocalCache(e){n(e,t)},saveProxyCache(e){n(e,a)},isExpired(){let t=new Date(o(e.KEY_CREATION));return t.setHours(t.getHours()+1),Date.now()>=t.getTime()},isFromLocal:()=>o(e.KEY_PV_SRC)===t,isFromProxy:()=>o(e.KEY_PV_SRC)===a,newerThan:e=>PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"],inspectKeys(){if(localStorage.length===PvStorage.keysCount())for(let t=0;t<localStorage.length;t++){switch(localStorage.key(t)){case e.KEY_PV:case e.KEY_PV_SRC:case e.KEY_CREATION:break;default:return void localStorage.clear()}}else localStorage.clear()}}}();function countUp(e,t,a){if(e<t){let o=new CountUp(a,e,t);o.error?console.error(o.error):o.start()}}function countPV(e,t){let a=0;if(void 0!==t)for(let o=0;o<t.length;++o){if(t[parseInt(o,10)][0]===e){a+=parseInt(t[parseInt(o,10)][1],10);break}}return a}function tacklePV(e,t,a,o){let r=countPV(t,e);if(r=0===r?1:r,o){const e=parseInt(a.text().replace(/,/g,""),10);r>e&&countUp(e,r,a.attr("id"))}else a.text((new Intl.NumberFormat).format(r))}function displayPageviews(e){if(void 0===e)return;let t=getInitStatus();const a=e.rows;if($("#post-list").length>0)$(".post-preview").each(function(){const e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)});else if($(".post").length>0){const e=window.location.pathname;tacklePV(a,e,$("#pv"),t)}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(e=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(t=>{e&&PvStorage.isFromProxy()&&PvStorage.newerThan(t)||(displayPageviews(t),PvStorage.saveLocalCache(JSON.stringify(t)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
const getInitStatus=function(){let t=!1;return()=>{var e=t;return t=t||!0,e}}(),PvOpts=function(){function t(e){return $(e).attr("content")}function e(e){e=t(e);return void 0!==e&&!1!==e}return{getProxyMeta(){return t("meta[name=pv-proxy-endpoint]")},getLocalMeta(){return t("meta[name=pv-cache-path]")},hasProxyMeta(){return e("meta[name=pv-proxy-endpoint]")},hasLocalMeta(){return e("meta[name=pv-cache-path]")}}}(),PvStorage=function(){const a={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},t={LOCAL:"same-origin",PROXY:"cors"};function r(e){return localStorage.getItem(e)}function o(e,t){localStorage.setItem(e,t)}function n(e,t){o(a.KEY_PV,e),o(a.KEY_PV_SRC,t),o(a.KEY_CREATION,(new Date).toJSON())}return{keysCount(){return Object.keys(a).length},hasCache(){return null!==localStorage.getItem(a.KEY_PV)},getCache(){return JSON.parse(localStorage.getItem(a.KEY_PV))},saveLocalCache(e){n(e,t.LOCAL)},saveProxyCache(e){n(e,t.PROXY)},isExpired(){let e=new Date(r(a.KEY_CREATION));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()},isFromLocal(){return r(a.KEY_PV_SRC)===t.LOCAL},isFromProxy(){return r(a.KEY_PV_SRC)===t.PROXY},newerThan(e){return PvStorage.getCache().totalsForAllResults["ga:pageviews"]>e.totalsForAllResults["ga:pageviews"]},inspectKeys(){if(localStorage.length===PvStorage.keysCount())for(let e=0;e<localStorage.length;e++)switch(localStorage.key(e)){case a.KEY_PV:case a.KEY_PV_SRC:case a.KEY_CREATION:break;default:return void localStorage.clear()}else localStorage.clear()}}}();function countUp(t,a,r){if(t<a){let e=new CountUp(r,t,a);e.error?console.error(e.error):e.start()}}function countPV(t,a){let r=0;if(void 0!==a)for(let e=0;e<a.length;++e)if(a[parseInt(e,10)][0]===t){r+=parseInt(a[parseInt(e,10)][1],10);break}return r}function tacklePV(e,t,a,r){let o=countPV(t,e);o=0===o?1:o,r?(r=parseInt(a.text().replace(/,/g,""),10),o>r&&countUp(r,o,a.attr("id"))):a.text((new Intl.NumberFormat).format(o))}function displayPageviews(e){if(void 0!==e){let t=getInitStatus();const a=e.rows;0<$("#post-list").length?$(".post-preview").each(function(){var e=$(this).find("a").attr("href");tacklePV(a,e,$(this).find(".pageviews"),t)}):0<$(".post").length&&(e=window.location.pathname,tacklePV(a,e,$("#pv"),t))}}function fetchProxyPageviews(){PvOpts.hasProxyMeta()&&$.ajax({type:"GET",url:PvOpts.getProxyMeta(),dataType:"jsonp",jsonpCallback:"displayPageviews",success:e=>{PvStorage.saveProxyCache(JSON.stringify(e))},error:(e,t,a)=>{console.log("Failed to load pageviews from proxy server: "+a)}})}function fetchLocalPageviews(t=!1){return fetch(PvOpts.getLocalMeta()).then(e=>e.json()).then(e=>{t&&PvStorage.isFromProxy()&&PvStorage.newerThan(e)||(displayPageviews(e),PvStorage.saveLocalCache(JSON.stringify(e)))})}$(function(){$(".pageviews").length<=0||(PvStorage.inspectKeys(),PvStorage.hasCache()?(displayPageviews(PvStorage.getCache()),PvStorage.isExpired()?PvOpts.hasLocalMeta()?fetchLocalPageviews(!0).then(fetchProxyPageviews):fetchProxyPageviews():PvStorage.isFromLocal()&&fetchProxyPageviews()):PvOpts.hasLocalMeta()?fetchLocalPageviews().then(fetchProxyPageviews):fetchProxyPageviews())});
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
[](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)
|
||||||
|
|
||||||
[**线上体验 →**](https://chirpy.cotes.info)
|
[**线上体验 →**](https://cotes2020.github.io/chirpy-demo)
|
||||||
|
|
||||||
[](https://chirpy.cotes.info)
|
[](https://cotes2020.github.io/chirpy-demo)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||
2. 回到 GitHub 上的仓库,选择标签 _Settings_ → 点击左侧导航栏的 _Pages_ → _GitHub Pages_ 选择分支 `gh-pages` 的 `/(root)` 作为「[发布源][pages-src]」:
|
2. 回到 GitHub 上的仓库,选择标签 _Settings_ → 点击左侧导航栏的 _Pages_ → _GitHub Pages_ 选择分支 `gh-pages` 的 `/(root)` 作为「[发布源][pages-src]」:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. 按照 GitHub 指示的地址去访问您的网站。
|
3. 按照 GitHub 指示的地址去访问您的网站。
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
若想要更多细节以及更佳的阅读体验,请参阅「[线上教程](https://chirpy.cotes.info/categories/tutorial/)」。 与此同时,「[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki)」也有一份教程的拷贝。请注意,Demo 网站和 Wiki 上的文档都是基于最新的发行版本,而 `master` 分支的功能往往领先于现有文档。
|
若想要更多细节以及更佳的阅读体验,请参阅「[线上教程](https://cotes2020.github.io/chirpy-demo/categories/tutorial/)」。 与此同时,「[Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki)」也有一份教程的拷贝。请注意,Demo 网站和 Wiki 上的文档都是基于最新的发行版本,而 `master` 分支的功能往往领先于现有文档。
|
||||||
|
|
||||||
## 参与贡献
|
## 参与贡献
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ $ docker run -it --rm \
|
|||||||
|
|
||||||
如果您喜欢此款主题或者它对您有帮助,请考虑打赏作者,您的支持将会极大地鼓励作者,并帮助作者更好地维护项目!
|
如果您喜欢此款主题或者它对您有帮助,请考虑打赏作者,您的支持将会极大地鼓励作者,并帮助作者更好地维护项目!
|
||||||
|
|
||||||
[](https://www.buymeacoffee.com/coteschung)
|
[](https://ko-fi.com/coteschung)
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
[][cn-donation]
|
[][cn-donation]
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "jekyll-theme-chirpy"
|
spec.name = "jekyll-theme-chirpy"
|
||||||
spec.version = "4.3.4"
|
spec.version = "5.0.0"
|
||||||
spec.authors = ["Cotes Chung"]
|
spec.authors = ["Cotes Chung"]
|
||||||
spec.email = ["cotes.chung@gmail.com"]
|
spec.email = ["cotes.chung@gmail.com"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jekyll-theme-chirpy",
|
"name": "jekyll-theme-chirpy",
|
||||||
"version": "4.3.4",
|
"version": "5.0.0",
|
||||||
"description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.",
|
"description": "A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
@@ -25,6 +25,6 @@
|
|||||||
"gulp-insert": "^0.5.0",
|
"gulp-insert": "^0.5.0",
|
||||||
"gulp-rename": "^2.0.0",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-uglify": "^3.0.2",
|
"gulp-uglify": "^3.0.2",
|
||||||
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony"
|
"uglify-js": "^3.14.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ flush() {
|
|||||||
|
|
||||||
shopt -s dotglob nullglob
|
shopt -s dotglob nullglob
|
||||||
mv "$_backup_dir"/* .
|
mv "$_backup_dir"/* .
|
||||||
|
[[ -f ".nojekyll" ]] || echo "" >".nojekyll"
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
@@ -134,25 +135,25 @@ main() {
|
|||||||
while (($#)); do
|
while (($#)); do
|
||||||
opt="$1"
|
opt="$1"
|
||||||
case $opt in
|
case $opt in
|
||||||
-c | --config)
|
-c | --config)
|
||||||
_config="$2"
|
_config="$2"
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--dry-run)
|
--dry-run)
|
||||||
# build & test, but not deploy
|
# build & test, but not deploy
|
||||||
_opt_dry_run=true
|
_opt_dry_run=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-h | --help)
|
-h | --help)
|
||||||
help
|
help
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# unknown option
|
# unknown option
|
||||||
help
|
help
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user