jekyll-theme-chirpy 4.3.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +32 -32
- data/_config.yml +12 -8
- data/_data/locales/en.yml +2 -1
- data/_data/locales/id-ID.yml +2 -1
- data/_data/locales/ko-KR.yml +91 -0
- data/_data/locales/zh-CN.yml +2 -1
- data/_includes/{disqus.html → comments/disqus.html} +4 -4
- data/_includes/comments/utterances.html +51 -0
- data/_includes/comments.html +5 -0
- data/_includes/footer.html +1 -1
- data/_includes/js-selector.html +1 -1
- data/_includes/language-alias.html +1 -3
- data/_includes/mermaid.html +28 -0
- data/_includes/mode-toggle.html +48 -65
- data/_includes/read-time.html +3 -3
- data/_includes/refactor-content.html +109 -35
- data/_includes/related-posts.html +1 -1
- data/_includes/search-loader.html +1 -1
- data/_includes/search-results.html +0 -8
- data/_includes/sidebar.html +10 -11
- data/_includes/timeago.html +11 -12
- data/_includes/toc.html +16 -0
- data/_includes/topbar.html +1 -1
- data/_includes/trending-tags.html +14 -0
- data/_includes/update-list.html +16 -0
- data/_layouts/default.html +6 -2
- data/_layouts/home.html +12 -9
- data/_layouts/page.html +45 -22
- data/_layouts/post.html +128 -127
- data/_sass/addon/commons.scss +198 -187
- data/_sass/addon/module.scss +48 -28
- data/_sass/addon/syntax.scss +56 -43
- data/_sass/addon/variables.scss +1 -1
- data/_sass/colors/dark-syntax.scss +3 -4
- data/_sass/colors/dark-typography.scss +23 -15
- data/_sass/colors/light-syntax.scss +3 -3
- data/_sass/colors/light-typography.scss +4 -5
- data/_sass/jekyll-theme-chirpy.scss +1 -1
- data/_sass/layout/archives.scss +5 -1
- data/_sass/layout/category-tag.scss +3 -2
- data/_sass/layout/home.scss +15 -4
- data/_sass/layout/post.scss +70 -46
- data/_sass/layout/tags.scss +1 -0
- data/assets/js/data/search.json +1 -1
- data/assets/js/dist/categories.min.js +2 -2
- data/assets/js/dist/commons.min.js +2 -2
- data/assets/js/dist/home.min.js +2 -2
- data/assets/js/dist/page.min.js +2 -2
- data/assets/js/dist/post.min.js +2 -2
- data/assets/js/dist/pvreport.min.js +2 -2
- metadata +12 -9
- data/_includes/panel.html +0 -59
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fded96e3d7dfaafecb7d2af83d0018f303650108f335e81bad7d092d6dd6a29c
|
|
4
|
+
data.tar.gz: 1fd6bef006b5c74a6cd130a1ccb31bedb35ffcb4e4ce94e51d9954ac828e00eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64ab039f7c14fefecc792ed1ca2838c13f72620cebf1a4d03e9b1eb4dc5c44dfe565a4e69af8aa0b0b386463ca44acd22eabdf53f7ca1504b02ffbc0e44143aa
|
|
7
|
+
data.tar.gz: ffbcc3c8332a960882acbd84d7cee887de4a097a598cce2e479f0936212b95547fea96ccdf3f17f8d650bc1808ccdab46fffb61711c9b3fd00397a7a0cdf82c1
|
data/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<div align="right">
|
|
2
2
|
|
|
3
|
-
EN /
|
|
4
|
-
[中文(简体)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
|
3
|
+
EN / [中文](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
|
5
4
|
|
|
6
5
|
</div>
|
|
7
6
|
|
|
@@ -9,17 +8,17 @@
|
|
|
9
8
|
|
|
10
9
|
# Chirpy Jekyll Theme
|
|
11
10
|
|
|
11
|
+
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
|
|
12
|
+
|
|
12
13
|
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
|
13
14
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
|
14
|
-
[](https://www.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade)
|
|
15
16
|
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
|
16
17
|
[](https://996.icu)
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
[**Live Demo →**](https://cotes2020.github.io/chirpy-demo)
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[](https://chirpy.cotes.info)
|
|
21
|
+
[](https://cotes2020.github.io/chirpy-demo)
|
|
23
22
|
|
|
24
23
|
</div>
|
|
25
24
|
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
|
|
45
44
|
## Prerequisites
|
|
46
45
|
|
|
47
|
-
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll
|
|
46
|
+
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`.
|
|
48
47
|
|
|
49
48
|
## Installation
|
|
50
49
|
|
|
@@ -52,9 +51,8 @@ Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installat
|
|
|
52
51
|
|
|
53
52
|
There are two ways to create a new repository for this theme:
|
|
54
53
|
|
|
55
|
-
- **
|
|
56
|
-
|
|
57
|
-
- **[Forking on GitHub](#option-2-forking-on-github)** - Convenient for custom development, but difficult to upgrade. Unless you are familiar with Jekyll and are determined to tweak or contribute to this project, this approach is not recommended.
|
|
54
|
+
- [**Using the Chirpy Starter**](#option-1-using-the-chirpy-starter) - Easy to upgrade, isolates irrelevant project files so you can focus on writing.
|
|
55
|
+
- [**Forking on GitHub**](#option-2-forking-on-github) - Convenient for custom development, but difficult to upgrade. Unless you are familiar with Jekyll and are determined to tweak or contribute to this project, this approach is not recommended.
|
|
58
56
|
|
|
59
57
|
#### Option 1. Using the Chirpy Starter
|
|
60
58
|
|
|
@@ -62,7 +60,7 @@ Create a new repository from the [**Chirpy Starter**][use-starter] and name it `
|
|
|
62
60
|
|
|
63
61
|
#### Option 2. Forking on GitHub
|
|
64
62
|
|
|
65
|
-
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and rename it to `<GH_USERNAME>.github.io`. Please note that the default branch code is in development. If you want the site to be stable, please switch to the [latest tag]
|
|
63
|
+
[Fork **Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork) on GitHub and rename it to `<GH_USERNAME>.github.io`. Please note that the default branch code is in development. If you want the site to be stable, please switch to the [latest tag][latest-tag] and start writing.
|
|
66
64
|
|
|
67
65
|
And then execute:
|
|
68
66
|
|
|
@@ -75,11 +73,12 @@ $ bash tools/init.sh
|
|
|
75
73
|
The above command will:
|
|
76
74
|
|
|
77
75
|
1. Removes some files or directories from your repository:
|
|
76
|
+
|
|
78
77
|
- `.travis.yml`
|
|
79
78
|
- files under `_posts`
|
|
80
79
|
- folder `docs`
|
|
81
80
|
|
|
82
|
-
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise,
|
|
81
|
+
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise, set up the GitHub Action workflow by removing the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
|
83
82
|
|
|
84
83
|
3. Removes item `Gemfile.lock` from `.gitignore`.
|
|
85
84
|
|
|
@@ -87,7 +86,7 @@ The above command will:
|
|
|
87
86
|
|
|
88
87
|
### Installing Dependencies
|
|
89
88
|
|
|
90
|
-
Before running for the first time, go the root directory of your site, and install dependencies as follows:
|
|
89
|
+
Before running for the first time, go to the root directory of your site, and install dependencies as follows:
|
|
91
90
|
|
|
92
91
|
```console
|
|
93
92
|
$ bundle
|
|
@@ -106,7 +105,7 @@ Update the variables of `_config.yml` as needed. Some of them are typical option
|
|
|
106
105
|
|
|
107
106
|
### Customing Stylesheet
|
|
108
107
|
|
|
109
|
-
If you need to customize stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
|
108
|
+
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
|
110
109
|
|
|
111
110
|
Starting from [`v4.1.0`][chirpy-4.1.0], if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
|
112
111
|
|
|
@@ -131,7 +130,7 @@ After a while, the local service will be published at _<http://127.0.0.1:4000>_.
|
|
|
131
130
|
|
|
132
131
|
### Deployment
|
|
133
132
|
|
|
134
|
-
Before the deployment begins,
|
|
133
|
+
Before the deployment begins, check out the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base URL on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starts with a slash, e.g, `/project-name`.
|
|
135
134
|
|
|
136
135
|
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
|
137
136
|
|
|
@@ -145,7 +144,7 @@ Quickly check the files needed for GitHub Actions build:
|
|
|
145
144
|
|
|
146
145
|
- Ensure your Jekyll site has file `tools/deploy.sh`. Otherwise, copy it from here to your Jekyll site.
|
|
147
146
|
|
|
148
|
-
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the
|
|
147
|
+
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lock file:
|
|
149
148
|
|
|
150
149
|
```console
|
|
151
150
|
$ bundle lock --add-platform x86_64-linux
|
|
@@ -159,7 +158,7 @@ Now publish your Jekyll site by:
|
|
|
159
158
|
|
|
160
159
|
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.
|
|
161
160
|
|
|
162
|
-

|
|
163
162
|
|
|
164
163
|
3. Visit your website at the address indicated by GitHub.
|
|
165
164
|
|
|
@@ -189,26 +188,27 @@ Unless you specified the output path, the generated site files will be placed in
|
|
|
189
188
|
|
|
190
189
|
It depends on how you use the theme:
|
|
191
190
|
|
|
192
|
-
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the theme gem, for example:
|
|
192
|
+
|
|
193
|
+
```diff
|
|
194
|
+
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
|
|
195
|
+
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
|
|
196
|
+
```
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
And then execute the following command:
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
```console
|
|
201
|
+
$ bundle update jekyll-theme-chirpy
|
|
202
|
+
```
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
As the version upgrades, the critical files (for details, see the [Startup Template][starter]) and configuration options will change. Please refer to the [Upgrade Guide](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide) to keep your repo's files in sync with the latest version of the theme.
|
|
205
205
|
|
|
206
206
|
- If you forked from the source project (there will be `gemspec` in the `Gemfile` of your site), then merge the [latest upstream tags][latest-tag] into your Jekyll site to complete the upgrade.
|
|
207
207
|
The merge is likely to conflict with your local modifications. Please be patient and careful to resolve these conflicts.
|
|
208
208
|
|
|
209
209
|
## Documentation
|
|
210
210
|
|
|
211
|
-
For more details and a better reading experience, please check out the [tutorials on the demo site](https://
|
|
211
|
+
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.
|
|
212
212
|
|
|
213
213
|
## Contributing
|
|
214
214
|
|
|
@@ -216,9 +216,9 @@ The old saying, "Two heads are better than one." Consequently, welcome to report
|
|
|
216
216
|
|
|
217
217
|
## Credits
|
|
218
218
|
|
|
219
|
-
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools (their copyright information can be found in the relevant files). The avatar and favicon design
|
|
219
|
+
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools (their copyright information can be found in the relevant files). The avatar and favicon design come from [Clipart Max](https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/).
|
|
220
220
|
|
|
221
|
-
:tada: Thanks to all the volunteers who contributed to this project, their GitHub IDs are on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget those guys who submitted the issues or unmerged PR because they reported bugs, shared ideas
|
|
221
|
+
:tada: Thanks to all the volunteers who contributed to this project, their GitHub IDs are on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget those guys who submitted the issues or unmerged PR because they reported bugs, shared ideas or inspired me to write more readable documentation.
|
|
222
222
|
|
|
223
223
|
Last but not least, thank [JetBrains][jb] for providing the open source license.
|
|
224
224
|
|
|
@@ -226,7 +226,7 @@ Last but not least, thank [JetBrains][jb] for providing the open source license.
|
|
|
226
226
|
|
|
227
227
|
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!
|
|
228
228
|
|
|
229
|
-
[](https://ko-fi.com/coteschung)
|
|
230
230
|
[][cn-donation]
|
|
231
231
|
[][cn-donation]
|
|
232
232
|
|
data/_config.yml
CHANGED
|
@@ -79,17 +79,23 @@ theme_mode: # [light|dark]
|
|
|
79
79
|
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
|
80
80
|
#
|
|
81
81
|
# e.g. 'https://cdn.com'
|
|
82
|
-
img_cdn:
|
|
82
|
+
img_cdn:
|
|
83
83
|
|
|
84
84
|
# the avatar on sidebar, support local or CORS resources
|
|
85
|
-
avatar:
|
|
85
|
+
avatar:
|
|
86
86
|
|
|
87
87
|
# boolean type, the global switch for ToC in posts.
|
|
88
88
|
toc: true
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
comments:
|
|
91
|
+
active: # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable
|
|
92
|
+
# The active options are as follows:
|
|
93
|
+
disqus:
|
|
94
|
+
shortname: # fill with the Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
|
95
|
+
# utterances settings › https://utteranc.es/
|
|
96
|
+
utterances:
|
|
97
|
+
repo: # <gh-username>/<repo>
|
|
98
|
+
issue_term: # < url | pathname | title | ...>
|
|
93
99
|
|
|
94
100
|
paginate: 10
|
|
95
101
|
|
|
@@ -111,7 +117,6 @@ collections:
|
|
|
111
117
|
output: true
|
|
112
118
|
sort_by: order
|
|
113
119
|
|
|
114
|
-
|
|
115
120
|
defaults:
|
|
116
121
|
-
|
|
117
122
|
scope:
|
|
@@ -136,7 +141,6 @@ defaults:
|
|
|
136
141
|
values:
|
|
137
142
|
layout: page
|
|
138
143
|
permalink: /:title/
|
|
139
|
-
dynamic_title: true # Hide title in mobile screens.
|
|
140
144
|
|
|
141
145
|
sass:
|
|
142
146
|
style: compressed
|
|
@@ -159,7 +163,7 @@ exclude:
|
|
|
159
163
|
- LICENSE
|
|
160
164
|
- gulpfile.js
|
|
161
165
|
- node_modules
|
|
162
|
-
-
|
|
166
|
+
- package*.json
|
|
163
167
|
|
|
164
168
|
jekyll-archives:
|
|
165
169
|
enabled: [categories, tags]
|
data/_data/locales/en.yml
CHANGED
data/_data/locales/id-ID.yml
CHANGED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# The layout text of site
|
|
2
|
+
|
|
3
|
+
# ----- Commons label -----
|
|
4
|
+
|
|
5
|
+
layout:
|
|
6
|
+
post: 포스트
|
|
7
|
+
category: 카테고리
|
|
8
|
+
tag: 태그
|
|
9
|
+
|
|
10
|
+
# The tabs of sidebar
|
|
11
|
+
tabs:
|
|
12
|
+
# format: <filename_without_extension>: <value>
|
|
13
|
+
home: 홈
|
|
14
|
+
categories: 카테고리
|
|
15
|
+
tags: 태그
|
|
16
|
+
archives: 아카이브
|
|
17
|
+
about: 정보
|
|
18
|
+
|
|
19
|
+
# the text displayed in the search bar & search results
|
|
20
|
+
search:
|
|
21
|
+
hint: 검색
|
|
22
|
+
cancel: 취소
|
|
23
|
+
no_results: 검색 결과가 없습니다.
|
|
24
|
+
|
|
25
|
+
panel:
|
|
26
|
+
lastmod: 최근 업데이트
|
|
27
|
+
trending_tags: 인기 태그
|
|
28
|
+
toc: 바로가기
|
|
29
|
+
|
|
30
|
+
# The liquid date format › http://strftime.net/
|
|
31
|
+
date_format:
|
|
32
|
+
tooltip: '%F, %R %z'
|
|
33
|
+
post:
|
|
34
|
+
long: '%Y년 %m월 %d일'
|
|
35
|
+
short: '%m월 %d일'
|
|
36
|
+
archive_month: '%b월'
|
|
37
|
+
|
|
38
|
+
copyright:
|
|
39
|
+
# Shown at the bottom of the post
|
|
40
|
+
license:
|
|
41
|
+
template: 이 기사는 저작권자의 :LICENSE_NAME 라이센스를 따릅니다.
|
|
42
|
+
name: CC BY 4.0
|
|
43
|
+
link: https://creativecommons.org/licenses/by/4.0/
|
|
44
|
+
|
|
45
|
+
# Displayed in the footer
|
|
46
|
+
brief: 일부 권리 보유
|
|
47
|
+
verbose: >-
|
|
48
|
+
명시되지 않는 한 이 사이트의 블로그 게시물은 작성자의
|
|
49
|
+
Creative Commons Attribution 4.0 International(CC BY 4.0) 라이선스에 따라 사용이 허가되었습니다.
|
|
50
|
+
|
|
51
|
+
meta: Powered by :PLATFORM with :THEME theme.
|
|
52
|
+
|
|
53
|
+
not_found:
|
|
54
|
+
statment: 해당 URL은 존재하지 않습니다.
|
|
55
|
+
hint_template: :HEAD_BAK을 눌러 다시 찾거나 :ARCHIVES_PAGE에서 검색해 주세요.
|
|
56
|
+
head_back: 홈으로 돌아가기
|
|
57
|
+
archives_page: 아카이브 페이지
|
|
58
|
+
|
|
59
|
+
# ----- Posts related labels -----
|
|
60
|
+
|
|
61
|
+
post:
|
|
62
|
+
written_by: By
|
|
63
|
+
posted: 게시
|
|
64
|
+
updated: 업데이트
|
|
65
|
+
timeago:
|
|
66
|
+
day: 일 전
|
|
67
|
+
hour: 시간 전
|
|
68
|
+
minute: 분 전
|
|
69
|
+
just_now: 방금
|
|
70
|
+
words: 단어
|
|
71
|
+
pageview_measure: 조회
|
|
72
|
+
read_time:
|
|
73
|
+
unit: 분
|
|
74
|
+
prompt: 읽는 시간
|
|
75
|
+
relate_posts: 관련된 글
|
|
76
|
+
share: 공유하기
|
|
77
|
+
button:
|
|
78
|
+
next: 다음 글
|
|
79
|
+
previous: 이전 글
|
|
80
|
+
copy_code:
|
|
81
|
+
succeed: 복사되었습니다!
|
|
82
|
+
share_link:
|
|
83
|
+
title: 링크 복사하기
|
|
84
|
+
succeed: 링크가 복사되었습니다!
|
|
85
|
+
# pinned prompt of posts list on homepage
|
|
86
|
+
pin_prompt: 핀
|
|
87
|
+
|
|
88
|
+
# categories page
|
|
89
|
+
categories:
|
|
90
|
+
category_measure: 카테고리
|
|
91
|
+
post_measure: 포스트
|
data/_data/locales/zh-CN.yml
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
The Disqus lazy loading.
|
|
3
3
|
-->
|
|
4
|
-
|
|
5
4
|
<div id="disqus_thread" class="pt-2 pb-2">
|
|
6
5
|
<p class="text-center text-muted small">
|
|
7
6
|
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
|
@@ -9,6 +8,7 @@
|
|
|
9
8
|
</div>
|
|
10
9
|
|
|
11
10
|
<script type="text/javascript">
|
|
11
|
+
|
|
12
12
|
var disqus_config = function () {
|
|
13
13
|
this.page.url = '{{ page.url | absolute_url }}';
|
|
14
14
|
this.page.identifier = '{{ page.url }}';
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
if(entries[0].isIntersecting) {
|
|
21
21
|
(function () {
|
|
22
22
|
var d = document, s = d.createElement('script');
|
|
23
|
-
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
|
|
23
|
+
s.src = 'https://{{ site.comments.disqus.shortname }}.disqus.com/embed.js';
|
|
24
24
|
s.setAttribute('data-timestamp', +new Date());
|
|
25
25
|
(d.head || d.body).appendChild(s);
|
|
26
26
|
})();
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
|
|
47
47
|
const modeToggle = document.querySelector(".mode-toggle");
|
|
48
48
|
|
|
49
|
-
if (modeToggle !==
|
|
50
|
-
modeToggle.addEventListener('click', reloadDisqus);
|
|
49
|
+
if (typeof modeToggle !== "undefined") {
|
|
50
|
+
/* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
|
|
51
51
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<!-- https://utteranc.es/ -->
|
|
2
|
+
<script src="https://utteranc.es/client.js"
|
|
3
|
+
repo="{{ site.comments.utterances.repo }}"
|
|
4
|
+
issue-term="{{ site.comments.utterances.issue_term }}"
|
|
5
|
+
crossorigin="anonymous"
|
|
6
|
+
async>
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
$(function() {
|
|
11
|
+
const origin = "https://utteranc.es";
|
|
12
|
+
const iframe = "iframe.utterances-frame";
|
|
13
|
+
const lightTheme = "github-light";
|
|
14
|
+
const darkTheme = "github-dark";
|
|
15
|
+
let initTheme = lightTheme;
|
|
16
|
+
|
|
17
|
+
if ($("html[mode=dark]").length > 0
|
|
18
|
+
|| ($("html[mode]").length == 0
|
|
19
|
+
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
|
20
|
+
initTheme = darkTheme;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
addEventListener("message", (event) => {
|
|
24
|
+
let theme;
|
|
25
|
+
|
|
26
|
+
/* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */
|
|
27
|
+
if (event.origin === origin) {
|
|
28
|
+
/* page initial */
|
|
29
|
+
theme = initTheme;
|
|
30
|
+
|
|
31
|
+
} else if (event.source === window && event.data &&
|
|
32
|
+
event.data.direction === ModeToggle.ID) {
|
|
33
|
+
/* global theme mode changed */
|
|
34
|
+
const mode = event.data.message;
|
|
35
|
+
theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
|
|
36
|
+
|
|
37
|
+
} else {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const message = {
|
|
42
|
+
type: "set-theme",
|
|
43
|
+
theme: theme
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const utterances = document.querySelector(iframe).contentWindow;
|
|
47
|
+
utterances.postMessage(message, origin);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
});
|
|
51
|
+
</script>
|
data/_includes/footer.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
-->
|
|
4
4
|
|
|
5
5
|
<footer class="d-flex w-100 justify-content-center">
|
|
6
|
-
<div class="d-flex justify-content-between align-items-center">
|
|
6
|
+
<div class="d-flex justify-content-between align-items-center text-muted">
|
|
7
7
|
<div class="footer-left">
|
|
8
8
|
<p class="mb-0">
|
|
9
9
|
© {{ 'now' | date: "%Y" }}
|
data/_includes/js-selector.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<!-- layout specified -->
|
|
6
6
|
|
|
7
|
-
{% if page.layout == '
|
|
7
|
+
{% if page.layout == 'post' %}
|
|
8
8
|
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
|
9
9
|
<!-- pv-report needs countup.js -->
|
|
10
10
|
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
|
@@ -41,8 +41,6 @@
|
|
|
41
41
|
{{ 'Perl' }}
|
|
42
42
|
{% when 'php','php3','php4','php5' %}
|
|
43
43
|
{{ 'PHP' }}
|
|
44
|
-
{% when 'plaintext', 'text' %}
|
|
45
|
-
{{ 'Text' }}
|
|
46
44
|
{% when 'py' %}
|
|
47
45
|
{{ 'Python' }}
|
|
48
46
|
{% when 'rb' %}
|
|
@@ -65,7 +63,7 @@
|
|
|
65
63
|
{{ 'Vue.js' }}
|
|
66
64
|
{% when 'yml' %}
|
|
67
65
|
{{ 'YAML' }}
|
|
68
|
-
{% when 'css', 'html', 'scss', 'ssh', 'toml', 'xml', 'yaml' %}
|
|
66
|
+
{% when 'css', 'html', 'scss', 'ssh', 'toml', 'xml', 'yaml', 'json' %}
|
|
69
67
|
{{ _lang | upcase }}
|
|
70
68
|
{% else %}
|
|
71
69
|
{{ _lang | capitalize }}
|
data/_includes/mermaid.html
CHANGED
|
@@ -3,8 +3,34 @@
|
|
|
3
3
|
-->
|
|
4
4
|
|
|
5
5
|
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
|
6
|
+
|
|
6
7
|
<script>
|
|
7
8
|
$(function() {
|
|
9
|
+
function updateMermaid(event) {
|
|
10
|
+
if (event.source === window && event.data &&
|
|
11
|
+
event.data.direction === ModeToggle.ID) {
|
|
12
|
+
|
|
13
|
+
const mode = event.data.message;
|
|
14
|
+
|
|
15
|
+
if (typeof mermaid === "undefined") {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let expectedTheme = (mode === ModeToggle.DARK_MODE? "dark" : "default");
|
|
20
|
+
let config = { theme: expectedTheme };
|
|
21
|
+
|
|
22
|
+
/* Re-render the SVG › <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
|
|
23
|
+
$(".mermaid").each(function() {
|
|
24
|
+
let svgCode = $(this).prev().children().html();
|
|
25
|
+
$(this).removeAttr("data-processed");
|
|
26
|
+
$(this).html(svgCode);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
mermaid.initialize(config);
|
|
30
|
+
mermaid.init(undefined, ".mermaid");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
8
34
|
let initTheme = "default";
|
|
9
35
|
|
|
10
36
|
if ($("html[mode=dark]").length > 0
|
|
@@ -25,5 +51,7 @@
|
|
|
25
51
|
});
|
|
26
52
|
|
|
27
53
|
mermaid.initialize(mermaidConf);
|
|
54
|
+
|
|
55
|
+
window.addEventListener("message", updateMermaid);
|
|
28
56
|
});
|
|
29
57
|
</script>
|