mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 21:53:26 +00:00
Compare commits
529 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8877393fba | ||
|
|
945e8d1953 | ||
|
|
a400dc9501 | ||
|
|
6a4169fc03 | ||
|
|
95b4b453e6 | ||
|
|
de14c00570 | ||
|
|
f4d4065b1c | ||
|
|
52f854a2da | ||
|
|
38f20e8119 | ||
|
|
1728d697e6 | ||
|
|
d9863d6a02 | ||
|
|
b460d03c3b | ||
|
|
a053c454e4 | ||
|
|
77c2009658 | ||
|
|
9844b964a8 | ||
|
|
063b2a6651 | ||
|
|
e5df04dd59 | ||
|
|
9e9278ce30 | ||
|
|
30dfc6fb7e | ||
|
|
1ce350e33e | ||
|
|
50c88f7205 | ||
|
|
387fc67102 | ||
|
|
414715fc47 | ||
|
|
1bb54096f4 | ||
|
|
abb548fcee | ||
|
|
ed93fbdfde | ||
|
|
4ad0a76789 | ||
|
|
89b76dc2a0 | ||
|
|
395b24736a | ||
|
|
fa0155de6f | ||
|
|
0bffb276fe | ||
|
|
2417db656c | ||
|
|
e5bf234835 | ||
|
|
2dfdb66e0a | ||
|
|
da9881a47f | ||
|
|
c68a937e01 | ||
|
|
4001ef7cba | ||
|
|
1b16b152df | ||
|
|
e607e5fe86 | ||
|
|
d761d340a8 | ||
|
|
f411ba33d8 | ||
|
|
f722757f6f | ||
|
|
beabb36d7f | ||
|
|
42ff0f2282 | ||
|
|
34631a0c30 | ||
|
|
53b0329e5a | ||
|
|
2877896b9e | ||
|
|
7ef88c8b8f | ||
|
|
2acf14ecf0 | ||
|
|
603705f20e | ||
|
|
0267ad8d40 | ||
|
|
c0b8c089c2 | ||
|
|
a603aac8e8 | ||
|
|
91ed3d4649 | ||
|
|
20454e5a57 | ||
|
|
aadda0347c | ||
|
|
5e9a7b319e | ||
|
|
2537283beb | ||
|
|
7dc7a7efc8 | ||
|
|
39b09b97c0 | ||
|
|
8d164c2e6e | ||
|
|
1a94b1889f | ||
|
|
6d07d4738b | ||
|
|
6e0afcf9e8 | ||
|
|
952927762a | ||
|
|
3c3598e8b1 | ||
|
|
9d9bca5e3b | ||
|
|
03248f5bff | ||
|
|
e2c288a925 | ||
|
|
b80d95dcdd | ||
|
|
72ba1f7849 | ||
|
|
46d80cbf9a | ||
|
|
0213331a16 | ||
|
|
780af9ac5f | ||
|
|
b513c0764d | ||
|
|
57e8c6e594 | ||
|
|
49dc866bd8 | ||
|
|
b7a483680e | ||
|
|
7ecb377c9b | ||
|
|
a83e4c1b30 | ||
|
|
0b29c0321f | ||
|
|
2e76300d04 | ||
|
|
20f2ff4b23 | ||
|
|
899609a291 | ||
|
|
f56852a700 | ||
|
|
c969eaa040 | ||
|
|
ab8cef9174 | ||
|
|
b3ff6c79a6 | ||
|
|
7f8c19d480 | ||
|
|
d52fa88337 | ||
|
|
bea170cff0 | ||
|
|
961ebb545b | ||
|
|
797450174d | ||
|
|
f0a2113a9f | ||
|
|
c98a41317f | ||
|
|
5f1e6e9350 | ||
|
|
65dbea9d3b | ||
|
|
fd97067ec3 | ||
|
|
d5413a954f | ||
|
|
9359d6ef11 | ||
|
|
6d1d440c00 | ||
|
|
08ec6cd3b5 | ||
|
|
3ecb59deb1 | ||
|
|
885ed44646 | ||
|
|
d31e677ca0 | ||
|
|
bf3b539d6d | ||
|
|
ab927e9954 | ||
|
|
d5e08b05ab | ||
|
|
eb247b8886 | ||
|
|
4fa7c6af6e | ||
|
|
2cce0be8af | ||
|
|
cf7d8a45ba | ||
|
|
6d254af55f | ||
|
|
a4dc39f70e | ||
|
|
84bb4d0c4b | ||
|
|
e8296fe2e4 | ||
|
|
6a45d7ccd1 | ||
|
|
5df67616be | ||
|
|
f0ce5ceb71 | ||
|
|
a9acaa669d | ||
|
|
72e8ffafa6 | ||
|
|
52f4012463 | ||
|
|
d5407181a4 | ||
|
|
4ed6988be3 | ||
|
|
3f2d400f16 | ||
|
|
e84331b26a | ||
|
|
efd8d44b12 | ||
|
|
a71659ed27 | ||
|
|
b14e97a92d | ||
|
|
826b7dca1a | ||
|
|
d720d0f66c | ||
|
|
c1b8e28601 | ||
|
|
aa54e901b1 | ||
|
|
a03149cd40 | ||
|
|
588fbbbec7 | ||
|
|
6341752986 | ||
|
|
11bcd7027d | ||
|
|
4a0242e496 | ||
|
|
48e4c7e6d3 | ||
|
|
991f53f8b2 | ||
|
|
7a5ad10bdc | ||
|
|
3b5441a1c2 | ||
|
|
a1fca3706f | ||
|
|
49346fd3c6 | ||
|
|
bff97df3b5 | ||
|
|
dbe4c3d42f | ||
|
|
fad8a23b87 | ||
|
|
834de0f02c | ||
|
|
1ff38722a2 | ||
|
|
1c0cd6b6b0 | ||
|
|
4973a61e39 | ||
|
|
99c12f6cd4 | ||
|
|
042cec33d8 | ||
|
|
8c940dbb96 | ||
|
|
9636612755 | ||
|
|
18f6c6ac4e | ||
|
|
88aa81dfe5 | ||
|
|
1b47c95cf6 | ||
|
|
aa7309c136 | ||
|
|
d162167580 | ||
|
|
6688e27787 | ||
|
|
89751c8e9f | ||
|
|
eae506113b | ||
|
|
3400568b09 | ||
|
|
d2bb423220 | ||
|
|
c6b0a8247b | ||
|
|
8ce8fc780f | ||
|
|
ac2ec585f6 | ||
|
|
338eddb454 | ||
|
|
3573ccb7a3 | ||
|
|
82b3d061af | ||
|
|
fc94a8e36b | ||
|
|
efc8c60b5d | ||
|
|
3e79ad6300 | ||
|
|
273f2e152d | ||
|
|
d0a23c21ee | ||
|
|
89200f3109 | ||
|
|
136773481e | ||
|
|
de7d2fab7c | ||
|
|
1b1fa93cf6 | ||
|
|
7e31ba4103 | ||
|
|
34b7a80a78 | ||
|
|
ba6c7eceec | ||
|
|
5669f792a7 | ||
|
|
f864b5c324 | ||
|
|
c8ff81e79a | ||
|
|
2bcaabdab4 | ||
|
|
4faa595b04 | ||
|
|
d7443aad5d | ||
|
|
b2beaa0f4c | ||
|
|
83a7878043 | ||
|
|
94b99350fc | ||
|
|
6dc9cdfa25 | ||
|
|
fa56ea48c3 | ||
|
|
7d3e25c90d | ||
|
|
6c9ab6e5f8 | ||
|
|
91da99282d | ||
|
|
413a86277b | ||
|
|
1879b94f3d | ||
|
|
7b5f7086b7 | ||
|
|
a8b8a379f6 | ||
|
|
eacad65cbb | ||
|
|
7a87ab4d05 | ||
|
|
c4be7c0cd6 | ||
|
|
c9765e6923 | ||
|
|
5c04d4e45b | ||
|
|
4d969ca0c5 | ||
|
|
4a084eb681 | ||
|
|
adc117972a | ||
|
|
8e84c6b9d6 | ||
|
|
d8a42d9bb4 | ||
|
|
c1b20d8f71 | ||
|
|
08ce9f6c7c | ||
|
|
0b4e40bcdf | ||
|
|
9ae2aee222 | ||
|
|
ec522e5219 | ||
|
|
4ee8f20df2 | ||
|
|
7d7c0da31b | ||
|
|
4343f1a8f8 | ||
|
|
b85980e1e2 | ||
|
|
893db51ff0 | ||
|
|
cbb3bd4be5 | ||
|
|
7ed3bef1b1 | ||
|
|
da9f7b8218 | ||
|
|
0e9104a58f | ||
|
|
b7266aceac | ||
|
|
28f36bee23 | ||
|
|
994b3e32d3 | ||
|
|
75e9feb687 | ||
|
|
ab0e3f6ee4 | ||
|
|
0194bbced9 | ||
|
|
e92cc239c1 | ||
|
|
da976ce088 | ||
|
|
6490b0fcbd | ||
|
|
ef1d05d342 | ||
|
|
e8170f8379 | ||
|
|
93fcf50131 | ||
|
|
66a132c462 | ||
|
|
6e6633c2fc | ||
|
|
594eaf5100 | ||
|
|
940db20c5c | ||
|
|
493e1d934b | ||
|
|
b9104d0f4c | ||
|
|
3c72298563 | ||
|
|
ca2194770c | ||
|
|
08fbd06c63 | ||
|
|
a20fd5bf6f | ||
|
|
7a88347c63 | ||
|
|
813443b206 | ||
|
|
c381353f86 | ||
|
|
aa6c33526a | ||
|
|
081e77d462 | ||
|
|
bca7a2a634 | ||
|
|
505da84a26 | ||
|
|
dfba411d61 | ||
|
|
fa310d3190 | ||
|
|
ef0c9ce770 | ||
|
|
7429ef3539 | ||
|
|
6d4abcc437 | ||
|
|
5bdea71622 | ||
|
|
8e0004146b | ||
|
|
557413cc4c | ||
|
|
6dc6f2a7cf | ||
|
|
8e5d8b8931 | ||
|
|
260a906b11 | ||
|
|
5ffbfaec26 | ||
|
|
b9ffe15ffb | ||
|
|
87ba30a393 | ||
|
|
cb984aa021 | ||
|
|
0225d28fd3 | ||
|
|
aba3d25d7a | ||
|
|
dc88321ed5 | ||
|
|
cc24af11fc | ||
|
|
d70354021c | ||
|
|
d61446fafc | ||
|
|
d0a8d072fd | ||
|
|
9d59461632 | ||
|
|
cea339088b | ||
|
|
07d29ec9bf | ||
|
|
464fa001b2 | ||
|
|
53a98feff3 | ||
|
|
b8ee5a7b0c | ||
|
|
289ce1263d | ||
|
|
63f57fbc12 | ||
|
|
cdaa79cf80 | ||
|
|
d53769e52b | ||
|
|
7de13415e7 | ||
|
|
d196645d88 | ||
|
|
4d2f13c0d7 | ||
|
|
5ed39300cb | ||
|
|
d7d3bc9947 | ||
|
|
cf3943342a | ||
|
|
59deef469d | ||
|
|
bb13b52d44 | ||
|
|
8d4c555638 | ||
|
|
cbf707dc56 | ||
|
|
6335991164 | ||
|
|
5d6014ecee | ||
|
|
13aca77275 | ||
|
|
1172f1646d | ||
|
|
e27825d3eb | ||
|
|
36c4f32b17 | ||
|
|
6a326dc8e0 | ||
|
|
20c14c0207 | ||
|
|
575b5c292a | ||
|
|
479bd72c9d | ||
|
|
f2efae8b01 | ||
|
|
8b2e6d1bf5 | ||
|
|
0250a9c9f4 | ||
|
|
bbfbda7562 | ||
|
|
a33b2d78b0 | ||
|
|
1280f89217 | ||
|
|
83bfd32807 | ||
|
|
4ea320b250 | ||
|
|
8909438267 | ||
|
|
9482249999 | ||
|
|
43d4036941 | ||
|
|
a410600205 | ||
|
|
864119e3cc | ||
|
|
4702244ae8 | ||
|
|
b985965bc9 | ||
|
|
a5b002b2d8 | ||
|
|
270d3ba499 | ||
|
|
1f2ed3db60 | ||
|
|
08354cc4f5 | ||
|
|
ea56a900a0 | ||
|
|
8fa1f3b497 | ||
|
|
10bc44367a | ||
|
|
1889b6b4e0 | ||
|
|
aac29d43e5 | ||
|
|
c340199191 | ||
|
|
c7241ba611 | ||
|
|
d7f351b143 | ||
|
|
62aef9f850 | ||
|
|
7d128769f6 | ||
|
|
8d4c1deb15 | ||
|
|
57a4bfdb82 | ||
|
|
5741aa4e18 | ||
|
|
ad5b614304 | ||
|
|
4f1735aad6 | ||
|
|
38b87cfdd7 | ||
|
|
bf8996fb8b | ||
|
|
2bd99ffd33 | ||
|
|
46a8efb38a | ||
|
|
b9fb716e6a | ||
|
|
154fb04987 | ||
|
|
a95d6d7101 | ||
|
|
c98fd19900 | ||
|
|
3c2675c4a1 | ||
|
|
db5a58638d | ||
|
|
2a2bc1ee65 | ||
|
|
e806a8556b | ||
|
|
049b486f82 | ||
|
|
8f11f91677 | ||
|
|
d314c02a13 | ||
|
|
ea5b6cf1f6 | ||
|
|
cb908bbb2b | ||
|
|
c221a3e0bc | ||
|
|
ddc1149fb5 | ||
|
|
944d0ad724 | ||
|
|
67d962d707 | ||
|
|
04ad7bf432 | ||
|
|
a0f80debb1 | ||
|
|
f932cf0d00 | ||
|
|
8484a34195 | ||
|
|
2cf5a58adf | ||
|
|
6f7ca13507 | ||
|
|
766e597a3b | ||
|
|
d0d1e02763 | ||
|
|
643c8177be | ||
|
|
092ab5bbdb | ||
|
|
e47f73f772 | ||
|
|
2d8854ba74 | ||
|
|
36fab37225 | ||
|
|
13abcd5958 | ||
|
|
9dcab7ac1f | ||
|
|
d78f034f5d | ||
|
|
c473771af4 | ||
|
|
252e33b502 | ||
|
|
232dd36b78 | ||
|
|
2d7df50774 | ||
|
|
31656e8cda | ||
|
|
e96f9051c0 | ||
|
|
cb461df071 | ||
|
|
e439e65258 | ||
|
|
3a449672cb | ||
|
|
7bb861b573 | ||
|
|
f0b4e30363 | ||
|
|
717a501c36 | ||
|
|
3ddf5047b5 | ||
|
|
31ac709e04 | ||
|
|
a1b2c71b89 | ||
|
|
e9c29aa1b5 | ||
|
|
f947c3f3d3 | ||
|
|
78e8ffd7ba | ||
|
|
60a8a2fa41 | ||
|
|
9e14673349 | ||
|
|
10ab9d3364 | ||
|
|
038bccb3ca | ||
|
|
9b35380849 | ||
|
|
a8f8bbaa1c | ||
|
|
188d8ffc69 | ||
|
|
0809e2b132 | ||
|
|
ab0adc36cf | ||
|
|
d4397dff08 | ||
|
|
db06610fd6 | ||
|
|
c242cf8455 | ||
|
|
ad7d8ac1c9 | ||
|
|
adff74b27b | ||
|
|
1c3c22bb68 | ||
|
|
628d4de095 | ||
|
|
48b3df2ea7 | ||
|
|
3b0cf90f5c | ||
|
|
544f72efff | ||
|
|
112091cbf6 | ||
|
|
b04bb847b1 | ||
|
|
a71bade6eb | ||
|
|
6ef97f1fad | ||
|
|
4675d42f90 | ||
|
|
a624b9a472 | ||
|
|
ad48a9ab06 | ||
|
|
18bd1a91ef | ||
|
|
4cff8879ac | ||
|
|
4dd4915bed | ||
|
|
a227ae386d | ||
|
|
32bd36f016 | ||
|
|
aa23becd14 | ||
|
|
b2f0b4cb1b | ||
|
|
209058b84a | ||
|
|
562fcd4fd8 | ||
|
|
22115f3797 | ||
|
|
9f3619e54a | ||
|
|
5b0aaa5403 | ||
|
|
733bb0fbfa | ||
|
|
0d47beba97 | ||
|
|
c0ba181246 | ||
|
|
313c44f238 | ||
|
|
46c2cfe64e | ||
|
|
cc4f18a5a2 | ||
|
|
4491c82b02 | ||
|
|
b9b8dd8cf1 | ||
|
|
9a1eab2635 | ||
|
|
30b013f354 | ||
|
|
4d4e9a063e | ||
|
|
afccb144b1 | ||
|
|
e87ef0d40e | ||
|
|
42e0617bde | ||
|
|
edeb08aa28 | ||
|
|
b0a35de9c6 | ||
|
|
b3e6fc56f7 | ||
|
|
618ae9dcbc | ||
|
|
47e5c3a917 | ||
|
|
f9706411e7 | ||
|
|
b22da94134 | ||
|
|
4476a7d755 | ||
|
|
ea4cd78921 | ||
|
|
752d0330b7 | ||
|
|
fbbd387402 | ||
|
|
bec344f6e9 | ||
|
|
ba47cc0509 | ||
|
|
34d54f9349 | ||
|
|
d1963af964 | ||
|
|
eff2a24f4c | ||
|
|
3caafbd50d | ||
|
|
cb37a1909d | ||
|
|
88eac91909 | ||
|
|
0bb9c47cf9 | ||
|
|
b28724b4d4 | ||
|
|
75c57d1725 | ||
|
|
032f5c7f83 | ||
|
|
75e462a9e9 | ||
|
|
ef3860004e | ||
|
|
032706d27f | ||
|
|
02a269910f | ||
|
|
abdf73fff4 | ||
|
|
be1d1554ea | ||
|
|
a2deea6537 | ||
|
|
1a2767ca24 | ||
|
|
cfb67a1cb9 | ||
|
|
171faafc67 | ||
|
|
db5eb0a18a | ||
|
|
582ea30459 | ||
|
|
064cefd9ff | ||
|
|
a57baf7e2c | ||
|
|
473ab64f74 | ||
|
|
c5783c1289 | ||
|
|
a64d00c1e6 | ||
|
|
7382eaa953 | ||
|
|
bcd394598b | ||
|
|
6d38f643ae | ||
|
|
532e7ad451 | ||
|
|
08d4ce77e2 | ||
|
|
8a46286373 | ||
|
|
8db0e2d238 | ||
|
|
0f5c2b5c9d | ||
|
|
d8e45694bd | ||
|
|
b64598358d | ||
|
|
ac9dc4d9ac | ||
|
|
3f843f010a | ||
|
|
9c3d3fdeed | ||
|
|
8c4b186c52 | ||
|
|
2cc399d015 | ||
|
|
f3295c6d0c | ||
|
|
4685bba313 | ||
|
|
b543f3e19b | ||
|
|
e561dfb9be | ||
|
|
7b3e0f741a | ||
|
|
7cea137bf4 | ||
|
|
8c21272048 | ||
|
|
078dab0299 | ||
|
|
f6d9ea10e2 | ||
|
|
d8a5ed194b | ||
|
|
6f42bbc6e5 | ||
|
|
74921c6570 | ||
|
|
5b27222b86 | ||
|
|
648b199be8 | ||
|
|
ae2b464492 | ||
|
|
1209879bed | ||
|
|
99aadd61c1 | ||
|
|
b30d673367 | ||
|
|
b393e12e30 | ||
|
|
3e8dc979c6 | ||
|
|
00928c90b7 | ||
|
|
caf8dec568 | ||
|
|
2423dbc726 | ||
|
|
23784b3295 | ||
|
|
4e4e71dff2 | ||
|
|
456f04112c | ||
|
|
af6f6a2812 |
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
# 2 space indentation
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
# Unix-style newlines with a newline ending every file
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
16
.gitattributes
vendored
Normal file
16
.gitattributes
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
* text=auto
|
||||
|
||||
# Force bash scripts to always use LF line endings so that if a repo is accessed
|
||||
# in Unix via a file share from Windows, the scripts will work.
|
||||
*.sh text eol=lf
|
||||
|
||||
# Force batch scripts to always use CRLF line endings so that if a repo is accessed
|
||||
# in Windows via a file share from Linux, the scripts will work.
|
||||
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.ico binary
|
||||
73
.github/CODE_OF_CONDUCT.md
vendored
Normal file
73
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at `cotes.chung@gmail.com`. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
<https://www.contributor-covenant.org/faq>
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
20
.github/CONTRIBUTING.md
vendored
20
.github/CONTRIBUTING.md
vendored
@@ -2,21 +2,15 @@
|
||||
|
||||
I want to thank you for sparing a time to improve this project! Here are some guidelines for contributing:
|
||||
|
||||
## Bug Reporting
|
||||
To ensure that the blog design is not confused, this project does not accept suggestions for design changes, such as color scheme, fonts, typography, etc. If your request is about an enhancement, it is recommended to first submit a [`Feature Request`](https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?labels=enhancement&template=feature_request.md) issue to discuss whether your idea fits the project.
|
||||
|
||||
If you found a bug, please ensure it doesn't appear in other existing [issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues). After that, [create a new issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues/new/choose) with template `Bug Report` and follow it's illustration to describe the situation.
|
||||
|
||||
|
||||
## Code Optimization
|
||||
|
||||
If you are willing to improve some of the existing code, such as performance optimization, code simplification, or even correct spelling errors of variable names, please submit a new PR to help us.
|
||||
|
||||
|
||||
## Feature Request
|
||||
|
||||
Basically, to ensure that the blog design is not confused, we do not accept suggestions for design changes, such as colors scheme, fonts, typography, etc. As long as your request is not a design issue, it is recommended to first submit a `Feature Request` issue to discuss whether your idea fits the project. Once the discussion is complete and the request is approved, fork this project, complete the development of new features, and submit a `Pull Request`. What's more, the PR should be merged into `master` branch without conflict.
|
||||
Generally, contribute to the project by:
|
||||
|
||||
1. Fork this project on GitHub and clone it locally.
|
||||
2. Create a new branch from `master` and give it a descriptive name (e.g., `my-new-feature`, `fix-a-bug`).
|
||||
3. After completing the development, commit and push to remote.
|
||||
4. Submit a new pull request.
|
||||
|
||||
---
|
||||
|
||||
:tada:Your volunteering will make the open source world more beautiful, thanks again!:tada:
|
||||
:tada: Your volunteering will make the open source world more beautiful, thanks again! :tada:
|
||||
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1 +1,3 @@
|
||||
custom: ['https://www.buymeacoffee.com/coteschung', 'https://cotes.gitee.io/alipay-wechat-donation']
|
||||
custom:
|
||||
- https://www.buymeacoffee.com/coteschung
|
||||
- https://cotes.gitee.io/alipay-wechat-donation
|
||||
|
||||
50
.github/ISSUE_TEMPLATE/bug_report.md
vendored
50
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,39 +1,55 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Create a report to help us improve
|
||||
labels: bug
|
||||
---
|
||||
|
||||
<!-- Please make sure you have read the README or Wiki, and your question does not appear in other existing issues (including closed ones). Thanks for your cooperation! Now let's start it. -->
|
||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||
|
||||
**Describe the bug**
|
||||
## Checklist
|
||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||
- [ ] I have read the [tutorials](https://chirpy.cotes.info/categories/tutorial/) and know the correct effect of the functional design.
|
||||
- [ ] There are no similar reports on existing issues (including closed ones).
|
||||
- [ ] I found the bug on the latest code of `master` branch.
|
||||
|
||||
## Describe the bug
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**To Reproduce**
|
||||
<!--
|
||||
### To Reproduce
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
<!--
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
-->
|
||||
|
||||
**Expected behavior**
|
||||
### Expected behavior
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots**
|
||||
### Screenshots
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser: [e.g. chrome, safari]
|
||||
- Version: [e.g. 22]
|
||||
### Software
|
||||
<!-- Please complete the following information -->
|
||||
- Ruby version: <!-- by running: `ruby -v` -->
|
||||
- Gem version: <!-- by running: `gem -v`-->
|
||||
- Bundler version: <!-- by running: `bundle -v`-->
|
||||
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
|
||||
- Theme version: <!-- by running: `gem list | grep jekyll-theme-chirpy` -->
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser: [e.g. stock browser, safari]
|
||||
- Version: [e.g. 22]
|
||||
### Desktop
|
||||
<!-- If necessary, uncomment and fill in the following list:
|
||||
- OS: [e.g. macOS 10.15.6]
|
||||
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
|
||||
-->
|
||||
|
||||
**Additional context**
|
||||
### Smartphone
|
||||
<!-- If necessary, uncomment and fill in the following list:
|
||||
- Device: [e.g. iPhone 6]
|
||||
- OS: [e.g. iOS 13.6.1]
|
||||
- Browser: [e.g. Chrome 22]
|
||||
-->
|
||||
|
||||
### Additional context
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
||||
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -4,18 +4,27 @@ about: Suggest an idea for this project
|
||||
labels: enhancement
|
||||
---
|
||||
|
||||
<!-- Please make sure your request does not appear in other existing issues (including closed ones). Thanks for your cooperation. Now, I can't wait to listen your idea! -->
|
||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||
|
||||
## Checklist
|
||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
|
||||
- [ ] There are no similar request on existing issues (including closed ones).
|
||||
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
|
||||
- [ ] I 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 [...] -->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
|
||||
## Describe the solution you'd like
|
||||
<!-- 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. -->
|
||||
|
||||
|
||||
**Additional context**
|
||||
## Additional context
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
|
||||
56
.github/ISSUE_TEMPLATE/question.md
vendored
56
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -4,54 +4,16 @@ about: Ask what ever you want
|
||||
labels: question
|
||||
---
|
||||
|
||||
<!-- Please make sure you have read the README or Wiki, and your question does not appear in other existing issues (including closed ones). Thanks for your cooperation. Now, uncomment the relevant part to describe the situation. -->
|
||||
<!-- NOTE: Please maintain all sections, otherwise the issue will be automatically closed :) -->
|
||||
|
||||
<!--
|
||||
**Don't understand what the README or Wiki says.**
|
||||
Point out the parts that are hard for you to understand.
|
||||
-->
|
||||
## Checklist
|
||||
|
||||
<!--
|
||||
**Want to complain about my bad days.**
|
||||
Don't hesitate to share your story!
|
||||
-->
|
||||
<!-- Please complete the following list of tasks, and then check it by change the "[ ]" to "[x]" -->
|
||||
|
||||
<!--
|
||||
**Just wanted to say hi to the author.**
|
||||
Hi, I'm ..., have a nice day !
|
||||
-->
|
||||
- [ ] I have read the [tutorials](https://chirpy.cotes.info/categories/tutorial/) and know the correct effect of the functional design.
|
||||
- [ ] There are no similar question on existing issues (including closed ones).
|
||||
- [ ] I searched the Internet for related problems, but still couldn't solve it.
|
||||
- [ ] My question is based on the latest code of `master` branch.
|
||||
|
||||
|
||||
<!--
|
||||
**Not sure if it's a bug**
|
||||
Please try to describe the problem
|
||||
|
||||
**To Reproduce**
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser: [e.g. chrome, safari]
|
||||
- Version: [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser: [e.g. stock browser, safari]
|
||||
- Version: [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
-->
|
||||
## Description
|
||||
<!-- Please describe your question in detail. -->
|
||||
|
||||
44
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
44
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
## Description
|
||||
|
||||
<!--
|
||||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
||||
|
||||
e.g. Fixes #(issue)
|
||||
-->
|
||||
|
||||
## Type of change
|
||||
|
||||
<!--
|
||||
Please select the desired item checkbox and change it to "[x]", then delete options that are not relevant.
|
||||
-->
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] Documentation update
|
||||
|
||||
## How has this been tested
|
||||
|
||||
<!--
|
||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
||||
-->
|
||||
|
||||
- [ ] I have run `bash ./tools/deploy.sh --dry-run` (at the root of the project) locally and passed
|
||||
- [ ] I have tested this feature in the browser
|
||||
|
||||
### Test Configuration
|
||||
|
||||
- Browser type & version:
|
||||
- Operating system:
|
||||
- Bundler version:
|
||||
- Ruby version:
|
||||
- Jekyll version:
|
||||
|
||||
### Checklist
|
||||
<!-- 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 own code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] I have made corresponding changes to the documentation
|
||||
- [ ] 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
|
||||
17
.github/stale.yml
vendored
Normal file
17
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Clean up the stale issues
|
||||
|
||||
daysUntilStale: 30
|
||||
daysUntilClose: 1
|
||||
|
||||
exemptLabels:
|
||||
- in progress
|
||||
- pending
|
||||
|
||||
staleLabel: stale
|
||||
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
|
||||
closeComment: false
|
||||
71
.github/workflows/ci.yml
vendored
71
.github/workflows/ci.yml
vendored
@@ -1,13 +1,13 @@
|
||||
name: build
|
||||
name: 'Continuous Integration'
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- stable
|
||||
- 'production'
|
||||
tags-ignore:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
- '!.github/workflows/**'
|
||||
- '!.github/workflows/ci.yml'
|
||||
- '.travis.yml'
|
||||
- '.gitignore'
|
||||
- 'docs/**'
|
||||
@@ -15,7 +15,7 @@ on:
|
||||
- 'LICENSE'
|
||||
pull_request:
|
||||
paths:
|
||||
- "**"
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
@@ -25,67 +25,16 @@ jobs:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.6.x'
|
||||
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7.x'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Bundle Caching
|
||||
id: bundle-cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gems-
|
||||
fetch-depth: 0 # for posts's lastmod
|
||||
|
||||
- id: get-pip-cache-path
|
||||
run: |
|
||||
echo "::set-output name=path::`pip show pip | grep "Location" | awk '{print $2}'`"
|
||||
|
||||
- name: Pip caching
|
||||
id: pip-cache
|
||||
uses: actions/cache@v1
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
path: ${{ steps.get-pip-cache-path.outputs.path }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install gnu-coreutils for macOS
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
brew install coreutils
|
||||
|
||||
- name: Bundle config
|
||||
run: |
|
||||
bundle config path vendor/bundle
|
||||
|
||||
- name: Bundle Install
|
||||
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
bundle install
|
||||
|
||||
- name: Bundle Install locally
|
||||
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
bundle install --local
|
||||
|
||||
- name: Pip installing
|
||||
if: steps.pip-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
pip install -r _scripts/py/requirements.txt
|
||||
|
||||
- name: Build Site
|
||||
run: |
|
||||
bash tools/build.sh
|
||||
ruby-version: 2.7
|
||||
bundler-cache: true
|
||||
|
||||
- name: Test Site
|
||||
run: |
|
||||
bash tools/test.sh
|
||||
run: bash tools/deploy.sh --dry-run
|
||||
|
||||
18
.github/workflows/issue-interceptor.yml
vendored
Normal file
18
.github/workflows/issue-interceptor.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Intercept bad issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
auto_close_issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Auto close issues that did not follow template
|
||||
uses: lucasbento/auto-close-issues@v1.0.2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-close-message: ":wave: Hi @${issue.user.login},\n\nThis issue is being automatically closed because it does not follow the issue template. Please DO NOT open another similar issue, try to edit the current issue according to the template, then it will be reopened automatically."
|
||||
closed-issues-label: "🙁 Not following issue template"
|
||||
29
.github/workflows/pages-deploy.yml.hook
vendored
Normal file
29
.github/workflows/pages-deploy.yml.hook
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: 'Automatic build'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- .gitignore
|
||||
- README.md
|
||||
- LICENSE
|
||||
|
||||
jobs:
|
||||
continuous-delivery:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # for posts's lastmod
|
||||
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
bundler-cache: true
|
||||
|
||||
- name: Deploy
|
||||
run: bash tools/deploy.sh
|
||||
21
.gitignore
vendored
21
.gitignore
vendored
@@ -1,17 +1,18 @@
|
||||
# hidden files
|
||||
.*
|
||||
!.git*
|
||||
!.editorconfig
|
||||
!.nojekyll
|
||||
!.travis.yml
|
||||
|
||||
# python compiled files
|
||||
*.pyc
|
||||
|
||||
# jekyll debug
|
||||
# bundler cache
|
||||
_site
|
||||
|
||||
# Jeykll Gemfile.lock
|
||||
vendor
|
||||
Gemfile.lock
|
||||
|
||||
# yui-compressor
|
||||
*.jar
|
||||
# rubygem
|
||||
*.gem
|
||||
|
||||
# bundle cache
|
||||
vendor
|
||||
# npm dependencies
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
||||
53
.travis.yml
53
.travis.yml
@@ -1,37 +1,40 @@
|
||||
os: linux
|
||||
dist: bionic
|
||||
|
||||
language: ruby
|
||||
rvm: 2.6.5
|
||||
language: minimal
|
||||
|
||||
before_install:
|
||||
- pyenv global 3.7.6
|
||||
if: tag =~ /^v(\d)+(\.(\d)+){2}$/
|
||||
|
||||
install:
|
||||
- pip install -r _scripts/py/requirements.txt
|
||||
- bundle install --path vendor/bundle --quiet
|
||||
|
||||
addons:
|
||||
jobs:
|
||||
include:
|
||||
- name: Deploy
|
||||
language: ruby
|
||||
rvm: 2.7.0
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
|
||||
|
||||
script:
|
||||
- >-
|
||||
git clone https://${GH_PAT}@github.com/${GH_USER}/${BUILDER_REPO}.git
|
||||
${HOME}/${BUILDER_REPO} --depth=1 -q
|
||||
- cp -r ${HOME}/${BUILDER_REPO}/framework/* .
|
||||
- bash _cibuild.sh
|
||||
|
||||
branches:
|
||||
only: stable
|
||||
|
||||
git:
|
||||
depth: false # for posts lastmod
|
||||
|
||||
cache:
|
||||
# required to avoid SSL error (for htmlproofer)
|
||||
- libcurl4-openssl-dev
|
||||
cache:
|
||||
directories:
|
||||
- $TRAVIS_BUILD_DIR/vendor/bundle
|
||||
before_install:
|
||||
# match the Gemfile.lock, travis' bundler is 2.1.2
|
||||
- gem install bundler:2.2.4
|
||||
- bundle config path 'vendor/bundle'
|
||||
install:
|
||||
# overriding to drop the travis `--development` flag
|
||||
- bundle install --jobs=3 --retry=3
|
||||
script:
|
||||
- eval "$BUILD_CMD"
|
||||
git:
|
||||
depth: false # for posts' lastmod
|
||||
|
||||
- name: Flush Starter
|
||||
script: eval "$FLUSH_STARTER"
|
||||
|
||||
before_script:
|
||||
- git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
||||
25
404.html
25
404.html
@@ -1,25 +0,0 @@
|
||||
---
|
||||
# The 404 page
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT License
|
||||
layout: page
|
||||
title: "404: Page not found"
|
||||
permalink: /404.html
|
||||
|
||||
redirect_from: # part of site.sitemap_exclude
|
||||
- /norobots/
|
||||
- /assets/
|
||||
- /tabs/
|
||||
- /categories/
|
||||
- /tags/
|
||||
- /posts/
|
||||
|
||||
dynamic_title: true
|
||||
---
|
||||
|
||||
<div class="lead">
|
||||
<p>Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. </p>
|
||||
<p><a href="{{ site.baseurl }}/">Head back Home</a> to try finding it again, or search for it on the <a href="{{ site.baseurl }}/tabs/archives">Archives page</a>.</p>
|
||||
</div>
|
||||
27
Gemfile
27
Gemfile
@@ -1,17 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "jekyll", ">=3.8.6"
|
||||
|
||||
# Official Plugins
|
||||
group :jekyll_plugins do
|
||||
gem "jekyll-paginate"
|
||||
gem "jekyll-redirect-from"
|
||||
gem "jekyll-seo-tag", "~> 2.6.1"
|
||||
end
|
||||
gemspec
|
||||
|
||||
group :test do
|
||||
gem "html-proofer"
|
||||
gem "html-proofer", "~> 3.18"
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
# and associated library.
|
||||
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
|
||||
gem "tzinfo", "~> 1.2"
|
||||
gem "tzinfo-data"
|
||||
end
|
||||
|
||||
# Performance-booster for watching directories on Windows
|
||||
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
|
||||
|
||||
# Jekyll <= 4.2.0 compatibility with Ruby 3.0
|
||||
gem "webrick", "~> 1.7"
|
||||
|
||||
405
README.md
405
README.md
@@ -1,260 +1,247 @@
|
||||
# Jekyll Theme Chirpy
|
||||
<div align="right">
|
||||
|
||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=event%3Apush)
|
||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||
[](https://996.icu)
|
||||
EN /
|
||||
[中文(简体)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/README.zh-CN.md)
|
||||
|
||||
Language: English | [简体中文](docs/README_zh-CN.md)
|
||||
</div>
|
||||
|
||||
A minimal, portfolio, sidebar, bootstrap Jekyll theme with responsive web design and focuses on text exhibition. It will help you easily record and share your knowledge.
|
||||
<div align="center">
|
||||
|
||||
**Features**
|
||||
# Chirpy Jekyll Theme
|
||||
|
||||
* Auto Dark Mode
|
||||
* Posts' Last Modified Date
|
||||
* Table of Contents
|
||||
* Automatically Recommend Related Posts
|
||||
* Syntax highlighting
|
||||
* Two Level Categories
|
||||
* Search
|
||||
* Atom Feeds
|
||||
* Disqus Comments
|
||||
* Google Analytics
|
||||
* GA Pageviews (Advanced)
|
||||
* SEO Tag
|
||||
* Performance Optimization
|
||||
[](https://rubygems.org/gems/jekyll-theme-chirpy)
|
||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
|
||||
[](https://app.codacy.com/manual/cotes2020/jekyll-theme-chirpy?utm_source=github.com&utm_medium=referral&utm_content=cotes2020/jekyll-theme-chirpy&utm_campaign=Badge_Grade_Dashboard)
|
||||
[](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||
[](https://996.icu)
|
||||
|
||||
[](https://chirpy.cotes.info)
|
||||
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
|
||||
|
||||
## Table of Contents
|
||||
**[Live Demo →](https://chirpy.cotes.info)**
|
||||
|
||||
* [Installing](#installing)
|
||||
* [Usage](#usage)
|
||||
* [Contributing](#contributing)
|
||||
* [Credits](#credits)
|
||||
* [Support](#support)
|
||||
* [License](#license)
|
||||
[](https://chirpy.cotes.info)
|
||||
|
||||
</div>
|
||||
|
||||
## Installing
|
||||
## Features
|
||||
|
||||
### Prerequisites
|
||||
- Localized Layout
|
||||
- Configurable Theme Mode
|
||||
- Pinned Posts
|
||||
- Hierarchical Categories
|
||||
- Last Modified Date for Posts
|
||||
- Table of Contents
|
||||
- Automatically Recommend Related Posts
|
||||
- Syntax Highlighting
|
||||
- Mathematical Expressions
|
||||
- Mermaid Diagram & Flowchart
|
||||
- Search
|
||||
- Atom Feeds
|
||||
- Disqus Comments
|
||||
- Google Analytics
|
||||
- GA Pageviews Reporting (Advanced)
|
||||
- SEO & Performance Optimization
|
||||
|
||||
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (`Ruby `, `RubyGems` and `Bundler`). In order to use the script tools to save time, we also need to install [Python](https://www.python.org/downloads/)(version 3.5 or abover) and [ruamel.yaml](https://pypi.org/project/ruamel.yaml/).
|
||||
## Prerequisites
|
||||
|
||||
In addition, if your machine is running Debian or macOS, make sure the [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, get it by:
|
||||
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`.
|
||||
|
||||
* Debian
|
||||
## Installation
|
||||
|
||||
### Creating a New Site
|
||||
|
||||
There are two ways to create a new repository for this theme:
|
||||
|
||||
- **[Using the Chirpy Starter](#option-1-using-the-chirpy-starter)** - Easy to upgrade, isolates irrelevant project files so you can focus on writing.
|
||||
|
||||
- **[Forking on GitHub](#option-2-forking-on-github)** - Convenient for custom development, but difficult to upgrade. Unless you are familiar with Jekyll and are determined to tweak or contribute to this project, this approach is not recommended.
|
||||
|
||||
#### Option 1. Using the Chirpy Starter
|
||||
|
||||
Create a new repository from the [**Chirpy Starter**][use-starter] and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
|
||||
|
||||
#### Option 2. Forking on GitHub
|
||||
|
||||
[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](https://github.com/cotes2020/jekyll-theme-chirpy/tags) and start writing.
|
||||
|
||||
And then execute:
|
||||
|
||||
```console
|
||||
$ sudo apt-get install coreutils
|
||||
```
|
||||
|
||||
* macOS
|
||||
|
||||
```console
|
||||
$ brew install coreutils
|
||||
```
|
||||
|
||||
|
||||
### Jekyll Plugins
|
||||
|
||||
[Fork **Chirpy** from GitHub](https://github.com/cotes2020/jekyll-theme-chirpy/fork), then clone your forked repo to local:
|
||||
|
||||
```console
|
||||
$ git clone git@github.com:USER/jekyll-theme-chirpy.git
|
||||
```
|
||||
|
||||
replace the `USER` above to your GitHub username.
|
||||
|
||||
The first time you run or build the project on your machine, perform the installation of Jekyll plugins. Go to the root of repo and run:
|
||||
|
||||
```terminal
|
||||
$ bundle install
|
||||
```
|
||||
|
||||
`bundle` will automatically install all the dependent Jekyll Plugins that listed in the `Gemfile`.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### Directory Structure
|
||||
|
||||
The main files and related brief introductions are listed below.
|
||||
|
||||
```sh
|
||||
jekyll-theme-chirpy/
|
||||
├── _data
|
||||
├── _includes
|
||||
├── _layouts
|
||||
├── _posts # posts stay here
|
||||
├── _scripts
|
||||
├── .travis.yml # remove it
|
||||
├── .github # remove this, too
|
||||
├── assets
|
||||
├── tabs
|
||||
│ └── about.md # the ABOUT page
|
||||
├── .gitignore
|
||||
├── 404.html
|
||||
├── Gemfile
|
||||
├── LICENSE
|
||||
├── README.md
|
||||
├── _config.yml # configuration file
|
||||
├── tools # script tools
|
||||
├── docs
|
||||
├── feed.xml
|
||||
├── index.html
|
||||
├── robots.txt
|
||||
└── sitemap.xml
|
||||
```
|
||||
|
||||
|
||||
As mentioned above, some files or directories should be removed from your repo:
|
||||
|
||||
- .travis.yml
|
||||
- .github
|
||||
|
||||
|
||||
### Customization
|
||||
|
||||
Basically, go to `_config.yml` and customize the variables as needed, some of them are typical options:
|
||||
|
||||
* `url`
|
||||
|
||||
Set to your website url and there should be no slash symbol at the tail. Format: `<protocol>://<domain>`.
|
||||
|
||||
|
||||
* `avatar`
|
||||
|
||||
It defines the image file location of avatar. The sample image is `/assets/img/sample/avatar.jpg`, and should be replaced by your own one(a square image). Notice that a huge image file will increase the load time of your site, so keep your avatar image size as samll as possible(may be *<https://tinypng.com/>* will help).
|
||||
|
||||
* `timezone`
|
||||
|
||||
To ensure that the posts' release date matches the city you live in, please modify the field `timezone` correctly. A list of all available values can be found on [TimezoneConverter](http://www.timezoneconverter.com/cgi-bin/findzone/findzone) or [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
||||
|
||||
* `theme_mode`
|
||||
|
||||
There are three options for the theme color scheme:
|
||||
|
||||
- **dual** - The default color scheme will follow the system settings, but if the system does not support dark mode, or the browser does not support `Media Queries Level 5`, the theme will be displayed as `light` mode by default. Anyway, the bottom left corner of the Sidebar will provide a button for users to switch color schemes.
|
||||
|
||||
- **dark** - Always show dark mode.
|
||||
- **light** - Always show light mode.
|
||||
|
||||
|
||||
### Run Locally
|
||||
|
||||
You may want to preview the site before publishing, so just run the script tool:
|
||||
|
||||
```terminal
|
||||
$ bash tools/run.sh
|
||||
```
|
||||
|
||||
Open a modern brower and visit at <http://localhost:4000>.
|
||||
|
||||
Few days later, you may find that the file modification(e.g. edits to a post) does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine. Type `-h` for more information.
|
||||
|
||||
### Deploying to GitHub Pages
|
||||
|
||||
Before the deployment begins, ensure the `url` in file `_config.yml` has been set to `https://<username>.github.io`(or the custom domain, if you have. e.g. `https://yourdomain.com`). What's more, if you prefer to the [Project site](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites), change `baseurl` of file `_config.yml` to your project name, starting with a slash. e.g. `/project`.
|
||||
|
||||
#### Option 1: Built by GitHub Pages
|
||||
|
||||
By deploying the site in this way, you're allowed to push the source code directly to the remote.
|
||||
|
||||
> **Note**: If you want to use any third-party Jekyll plugins that not in [this list](https://pages.github.com/versions/), stop reading the current approach and go to [*Option 2: Build locally*](#option-2-build-locally).
|
||||
|
||||
**1**. Rename the repository to:
|
||||
|
||||
|Site Type | Repo's Name|
|
||||
|:---|:---|
|
||||
|User or Organization | `<username>.github.io`|
|
||||
|Project| any one except `<username>.github.io`, let's say `project`|
|
||||
|
||||
**2**. Commit the changes of the repo first, then run the initialization script:
|
||||
|
||||
```terminal
|
||||
$ bash tools/init.sh
|
||||
```
|
||||
|
||||
>**Note**: The *Recent Update* requires the posts' latest git-log date, so make sure the changes in `_posts` have been committed before running this command.
|
||||
> **Note**: If you don't want to deploy your site on GitHub Pages, append option `--no-gh` at the end of the above command.
|
||||
|
||||
it will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts and submit a commit. Its output is similar to the following log:
|
||||
The above command will:
|
||||
|
||||
```terminal
|
||||
[INFO] Success to update lastmod for 4 post(s).
|
||||
[INFO] Succeed! 3 category-pages created.
|
||||
[INFO] Succeed! 4 tag-pages created.
|
||||
[Automation] Updated the Categories, Tags, Lastmod for post(s).
|
||||
11 files changed, 46 insertions(+), 3 deletions(-)
|
||||
...
|
||||
Updated the Categories, Tags, Lastmod for post(s).
|
||||
```
|
||||
1. Removes some files or directories from your repository:
|
||||
- `.travis.yml`
|
||||
- files under `_posts`
|
||||
- folder `docs`
|
||||
|
||||
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repo.
|
||||
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
||||
|
||||
**4**. Check it out:
|
||||
3. Removes item `Gemfile.lock` from `.gitignore`.
|
||||
|
||||
|Site Type | Site URL |
|
||||
|:---|:---|
|
||||
|User or Organization | `https://<username>.github.io/`|
|
||||
|Project| `https://<username>.github.io/project/`|
|
||||
4. Creates a new commit to save the changes automatically.
|
||||
|
||||
### Installing Dependencies
|
||||
|
||||
#### Option 2: Build Locally
|
||||
|
||||
For security reasons, GitHub Pages runs on `safe` mode, which means the third-party Jekyll plugins or custom scripts won't work. If you want to use any another plugins that not in the [whitelist](https://pages.github.com/versions/), **you have to generate the site locally rather than on GitHub Pages**.
|
||||
|
||||
**1**. Browse to GitHub website, create a brand new repo named:
|
||||
|
||||
|Site Type | Repo's Name|
|
||||
|:---|:---|
|
||||
|User or Organization | `<username>.github.io`|
|
||||
|Project| any one except `<username>.github.io`, let's say `project`|
|
||||
|
||||
and clone it.
|
||||
|
||||
**2**. In the root of the source project, build your site by:
|
||||
Before running for the first time, go the root directory of your site, and install dependencies as follows:
|
||||
|
||||
```console
|
||||
$ bash tools/build.sh -d /path/to/local/project/
|
||||
$ bundle
|
||||
```
|
||||
|
||||
The generated static files will be placed in the root of `/path/to/local/project`. Commit and push the changes to the `master` branch on GitHub.
|
||||
## Usage
|
||||
|
||||
**3**. Go to GitHub website and enable Pages service for the new repository.
|
||||
### Configuration
|
||||
|
||||
**4**. Visit at:
|
||||
Update the variables of `_config.yml` as needed. Some of them are typical options:
|
||||
|
||||
|Site Type | Site URL |
|
||||
|:---|:---|
|
||||
|User or Organization | `https://<username>.github.io/`|
|
||||
|Project| `https://<username>.github.io/project/`|
|
||||
- `url`
|
||||
- `avatar`
|
||||
- `timezone`
|
||||
- `lang`
|
||||
|
||||
and enjoy!
|
||||
### Customing Stylesheet
|
||||
|
||||
### Documentation
|
||||
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.
|
||||
|
||||
For more details and the better reading experience, please check out the [tutorial in 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).
|
||||
Starting from [`v4.1.0`][chirpy-4.1.0], if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
||||
|
||||
### Running Local Server
|
||||
|
||||
You may want to preview the site contents before publishing, so just run it by:
|
||||
|
||||
```console
|
||||
$ bundle exec jekyll s
|
||||
```
|
||||
|
||||
Or run the site on Docker with the following command:
|
||||
|
||||
```console
|
||||
$ docker run -it --rm \
|
||||
--volume="$PWD:/srv/jekyll" \
|
||||
-p 4000:4000 jekyll/jekyll \
|
||||
jekyll serve
|
||||
```
|
||||
|
||||
After a while, the local service will be published at _<http://127.0.0.1:4000>_.
|
||||
|
||||
### Deployment
|
||||
|
||||
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base URL on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash, e.g, `/project-name`.
|
||||
|
||||
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||
|
||||
#### Deploy by Using Github Actions
|
||||
|
||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the GitHub Pages service.
|
||||
|
||||
Quickly check the files needed for GitHub Actions build:
|
||||
|
||||
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [sample file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
|
||||
|
||||
- Ensure your Jekyll site has file `tools/deploy.sh`. Otherwise, copy it from here to your Jekyll site.
|
||||
|
||||
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lockfile:
|
||||
|
||||
```console
|
||||
$ bundle lock --add-platform x86_64-linux
|
||||
```
|
||||
|
||||
After the above steps, rename your repository to `<GH_USERNAME>.github.io` on GitHub.
|
||||
|
||||
Now publish your Jekyll site by:
|
||||
|
||||
1. Push any commit to remote to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
||||
|
||||
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
||||
|
||||

|
||||
|
||||
3. Visit your website at the address indicated by GitHub.
|
||||
|
||||
#### Manually Build and Deploy
|
||||
|
||||
On self-hosted servers, you cannot enjoy the convenience of **GitHub Actions**. Therefore, you should build the site on your local machine and then upload the site files to the server.
|
||||
|
||||
Go to the root of the source project, and build your site as follows:
|
||||
|
||||
```console
|
||||
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||
```
|
||||
|
||||
Or build the site on Docker:
|
||||
|
||||
```console
|
||||
$ docker run -it --rm \
|
||||
--env JEKYLL_ENV=production \
|
||||
--volume="$PWD:/srv/jekyll" \
|
||||
jekyll/jekyll \
|
||||
jekyll build
|
||||
```
|
||||
|
||||
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to the target server.
|
||||
|
||||
### Upgrading
|
||||
|
||||
It depends on how you use the theme:
|
||||
|
||||
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the them gem, for example:
|
||||
```diff
|
||||
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
|
||||
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
|
||||
```
|
||||
|
||||
And then execute the following command:
|
||||
|
||||
```console
|
||||
$ bundle update jekyll-theme-chirpy
|
||||
```
|
||||
|
||||
As the version upgrades, the critical files (for details, see the [Startup Template][starter]) and configuration options will change. Please refer to the [Upgrade Guide](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide) to keep your repo's files in sync with the latest version of the theme.
|
||||
|
||||
- If you forked from the source project (there will be `gemspec` in the `Gemfile` of your site), then merge the [latest upstream tags][latest-tag] into your Jekyll site to complete the upgrade.
|
||||
The merge is likely to conflict with your local modifications. Please be patient and careful to resolve these conflicts.
|
||||
|
||||
## Documentation
|
||||
|
||||
For more details and a better reading experience, please check out the [tutorials on the demo site](https://chirpy.cotes.info/categories/tutorial/). In the meanwhile, a copy of the tutorial is also available on the [Wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Please note that the tutorials on the demo website or Wiki are based on the latest release, and the features of `master` branch usually ahead of the documentation.
|
||||
|
||||
## Contributing
|
||||
|
||||
The old saying: "Two heads are better than one. Five heads are better than two." So, welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
|
||||
|
||||
The old saying, "Two heads are better than one." Consequently, welcome to report bugs, improve code quality or submit a new feature. For more information, see [contributing guidelines](.github/CONTRIBUTING.md).
|
||||
|
||||
## Credits
|
||||
|
||||
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools(their copyright information can be found in the relevant files).
|
||||
This theme is mainly built with [Jekyll](https://jekyllrb.com/) ecosystem, [Bootstrap](https://getbootstrap.com/), [Font Awesome](https://fontawesome.com/) and some other wonderful tools (their copyright information can be found in the relevant files). The avatar and favicon design comes from [Clipart Max](https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/).
|
||||
|
||||
:tada:Thanks to all the volunteers who contributed to this project, their GitHub IDs are on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget those guys who submitted the issues or unmerged PR because they reported bugs, shared ideas or inspired me to write more readable documentation.
|
||||
:tada: Thanks to all the volunteers who contributed to this project, their GitHub IDs are on [this list](https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors). Also, I won't forget those guys who submitted the issues or unmerged PR because they reported bugs, shared ideas, or inspired me to write more readable documentation.
|
||||
|
||||
Last but not least, thank [JetBrains][jb] for providing the open source license.
|
||||
|
||||
## Support
|
||||
## Sponsoring
|
||||
|
||||
If you enjoy this theme or find it helpful, please consider becoming my sponsor, I'd really appreciate it! Click the button <kbd>:heart:Sponsor</kbd> at the top of the [Home Page](https://github.com/cotes2020/jekyll-theme-chirpy) and choose a link that suits you to donate; this will encourage and help me better maintain the project.
|
||||
If you 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)
|
||||
[][cn-donation]
|
||||
[][cn-donation]
|
||||
|
||||
## License
|
||||
|
||||
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
|
||||
|
||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
||||
[pages-src]: https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
|
||||
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
||||
|
||||
<!-- ReadMe links -->
|
||||
|
||||
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||
[cn-donation]: https://cotes.gitee.io/alipay-wechat-donation/
|
||||
|
||||
202
_config.yml
202
_config.yml
@@ -1,28 +1,34 @@
|
||||
# The Site Settings
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT licensed
|
||||
# The Site Configuration
|
||||
|
||||
# Import the theme
|
||||
theme: jekyll-theme-chirpy
|
||||
|
||||
# Change the following value to '/PROJECT_NAME' ONLY IF your site type is GitHub Pages Project sites
|
||||
# and doesn't have a custom domain.
|
||||
baseurl: ''
|
||||
|
||||
# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm
|
||||
# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed,
|
||||
# otherwise, the layout language will use the default value of 'en'.
|
||||
lang: en
|
||||
|
||||
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
||||
timezone: Asia/Shanghai
|
||||
|
||||
# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
|
||||
#--------------------------
|
||||
# ↓ --------------------------
|
||||
|
||||
title: Chirpy # the main title
|
||||
|
||||
tagline: A text-focused Jekyll theme. # it will display as the sub-title
|
||||
tagline: A text-focused Jekyll theme # it will display as the sub-title
|
||||
|
||||
description: >- # used by seo meta and the atom feed
|
||||
A minimal, portfolio, sidebar,
|
||||
bootstrap Jekyll theme with responsive web design
|
||||
and focuses on text presentation.
|
||||
|
||||
# Replace with the website url, e.g. 'https://username.github.io'
|
||||
url: 'protocol://domain'
|
||||
|
||||
author: your_full_name # change to your full name
|
||||
|
||||
avatar: /assets/img/sample/avatar.jpg # support internet resources
|
||||
# fill in the protocol & hostname for your site, e.g., 'https://username.github.io'
|
||||
url: ''
|
||||
|
||||
github:
|
||||
username: github_username # change to your github username
|
||||
@@ -31,7 +37,9 @@ twitter:
|
||||
username: twitter_username # change to your twitter username
|
||||
|
||||
social:
|
||||
name: your_full_name # it will shows as the copyright owner in Footer
|
||||
# Change to your full name.
|
||||
# It will be displayed as the default author of the posts and the copyright owner in the Footer
|
||||
name: your_full_name
|
||||
email: example@doamin.com # change to your email address
|
||||
links:
|
||||
# The first element serves as the copyright owner's link
|
||||
@@ -43,57 +51,54 @@ social:
|
||||
|
||||
google_site_verification: google_meta_tag_verification # change to your verification string
|
||||
|
||||
#--------------------------
|
||||
# ↑ --------------------------
|
||||
|
||||
# if your site type is Project Pages site, change below value to '/projectname'
|
||||
baseurl: ''
|
||||
|
||||
# Change to your timezone › http://www.timezoneconverter.com/cgi-bin/findzone/findzone
|
||||
timezone: Asia/Shanghai
|
||||
|
||||
google_analytics:
|
||||
# Fill with your Google Analytics ID
|
||||
id: ''
|
||||
# The Google Analytics pageviews switch.
|
||||
|
||||
id: '' # fill in your Google Analytics ID
|
||||
# Google Analytics pageviews report settings
|
||||
pv:
|
||||
# DO NOT enable it unless you know how to deploy the Google Analytics superProxy.
|
||||
enabled: false
|
||||
# the next options only valid when `google_analytics.pv` is enabled.
|
||||
proxy_url: ''
|
||||
proxy_endpoint: ''
|
||||
cache: false # pv data local cache, good for the users from GFW area.
|
||||
proxy_endpoint: # fill in the Google Analytics superProxy endpoint of Google App Engine
|
||||
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
||||
|
||||
# Prefer color scheme setting.
|
||||
#
|
||||
# Note: Keep empty will follow the system prefer color by default,
|
||||
# and there will be a toggle to switch the theme between dark and light
|
||||
# on the bottom left of the sidebar.
|
||||
#
|
||||
# Available options:
|
||||
#
|
||||
# light - Use the light color scheme
|
||||
# dark - Use the dark color scheme
|
||||
#
|
||||
theme_mode: # [light|dark]
|
||||
|
||||
# The CDN endpoint for images.
|
||||
# Notice that once it is assigned, the CDN url
|
||||
# will be added to all image (site avatar & posts' images) paths starting with '/'
|
||||
#
|
||||
# e.g. 'https://cdn.com'
|
||||
img_cdn: 'https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5'
|
||||
|
||||
# the avatar on sidebar, support local or CORS resources
|
||||
avatar: '/commons/avatar.jpg'
|
||||
|
||||
# boolean type, the global switch for ToC in posts.
|
||||
toc: true
|
||||
|
||||
disqus:
|
||||
comments: false # boolean type, the global switch for posts comments.
|
||||
shortname: '' # Fill with your Disqus shortname. › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
|
||||
|
||||
|
||||
# Prefer color scheme setting, available values:
|
||||
#
|
||||
# dual - Follow the system prefer color by default, and a toggle will display
|
||||
# in the left bottom of Sidebar, which used for switch the theme between dark and light.
|
||||
#
|
||||
# light - Use the light color scheme
|
||||
#
|
||||
# dark - Use the dark color scheme
|
||||
#
|
||||
theme_mode: dual
|
||||
|
||||
# boolean type, global switch for ToC in posts.
|
||||
toc: true
|
||||
|
||||
paginate: 10
|
||||
|
||||
markdown: kramdown
|
||||
|
||||
highlighter: rouge
|
||||
# ------------ The following options are not recommended to be modified ------------------
|
||||
|
||||
kramdown:
|
||||
input: GFM
|
||||
syntax_highlighter: rouge
|
||||
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
|
||||
css_class: 'highlight'
|
||||
css_class: highlight
|
||||
# default_lang: console
|
||||
span:
|
||||
line_numbers: false
|
||||
@@ -101,22 +106,24 @@ kramdown:
|
||||
line_numbers: true
|
||||
start_line: 1
|
||||
|
||||
permalink: /posts/:title/
|
||||
collections:
|
||||
tabs:
|
||||
output: true
|
||||
sort_by: order
|
||||
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # An empty string here means all files in the project
|
||||
path: '' # An empty string here means all files in the project
|
||||
type: posts
|
||||
values:
|
||||
layout: post
|
||||
comments: true # Enable comments in posts.
|
||||
toc: true # Display TOC column in posts.
|
||||
location: Post
|
||||
breadcrumb:
|
||||
-
|
||||
label: Posts
|
||||
url: /
|
||||
# DO NOT modify the following parameter unless you are confident enough
|
||||
# to update the code of all other post links in this project.
|
||||
permalink: /posts/:title/
|
||||
-
|
||||
scope:
|
||||
path: _drafts
|
||||
@@ -124,80 +131,41 @@ defaults:
|
||||
comments: false
|
||||
-
|
||||
scope:
|
||||
path: tags
|
||||
values:
|
||||
tab_active: Tags
|
||||
location: Tag
|
||||
breadcrumb:
|
||||
-
|
||||
label: Home
|
||||
url: /
|
||||
-
|
||||
label: Tags
|
||||
url: /tabs/tags/
|
||||
-
|
||||
scope:
|
||||
path: categories
|
||||
values:
|
||||
tab_active: Categories
|
||||
location: Category
|
||||
breadcrumb:
|
||||
-
|
||||
label: Home
|
||||
url: /
|
||||
-
|
||||
label: Categories
|
||||
url: /tabs/categories/
|
||||
-
|
||||
scope:
|
||||
path: tabs
|
||||
path: ''
|
||||
type: tabs # see `site.collections`
|
||||
values:
|
||||
layout: page
|
||||
permalink: /:title/
|
||||
dynamic_title: true # Hide title in mobile screens.
|
||||
breadcrumb:
|
||||
-
|
||||
label: Home
|
||||
url: /
|
||||
-
|
||||
scope:
|
||||
path: assets/data
|
||||
values:
|
||||
layout: compress
|
||||
|
||||
|
||||
sass:
|
||||
sass_dir: /assets/css
|
||||
style: compressed
|
||||
|
||||
compress_html:
|
||||
clippings: all
|
||||
comments: ["<!-- ", " -->"]
|
||||
endings: [html, head, body, dt, dd, rt, rp,
|
||||
optgroup, option, colgroup, caption,
|
||||
thead, tbody, tfoot, tr, td, th]
|
||||
comments: all
|
||||
endings: all
|
||||
profile: false
|
||||
blanklines: false
|
||||
ignore:
|
||||
envs: []
|
||||
envs: [development]
|
||||
|
||||
exclude:
|
||||
- vendor # Avoid Jekyll mistakenly read the vender directory on Travis-CI's VM .
|
||||
- Gemfile.lock
|
||||
- Gemfile
|
||||
- '*.gem'
|
||||
- '*.gemspec'
|
||||
- tools
|
||||
- docs
|
||||
- README.md
|
||||
- LICENSE
|
||||
- gulpfile.js
|
||||
- node_modules
|
||||
- '*.json'
|
||||
|
||||
sitemap_exclude: # Sitemap will exclude the following items.
|
||||
fuzzy:
|
||||
- /assets/
|
||||
accurate:
|
||||
- /norobots/
|
||||
- /tabs/
|
||||
- /categories/
|
||||
- /tags/
|
||||
- /posts/
|
||||
- 404.html
|
||||
- feed.xml
|
||||
- sitemap.xml
|
||||
- robots.txt
|
||||
- redirects.json
|
||||
jekyll-archives:
|
||||
enabled: [categories, tags]
|
||||
layouts:
|
||||
category: category
|
||||
tag: tag
|
||||
permalinks:
|
||||
tag: /tags/:name/
|
||||
category: /categories/:name/
|
||||
|
||||
30
_data/contact.yml
Normal file
30
_data/contact.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
# The contact options.
|
||||
|
||||
-
|
||||
type: github
|
||||
icon: 'fab fa-github'
|
||||
-
|
||||
type: twitter
|
||||
icon: 'fab fa-twitter'
|
||||
-
|
||||
type: email
|
||||
icon: 'fas fa-envelope'
|
||||
noblank: true # open link in current tab
|
||||
-
|
||||
type: rss
|
||||
icon: 'fas fa-rss'
|
||||
noblank: true
|
||||
|
||||
# Uncomment and complete the url below to enable more contact options
|
||||
# -
|
||||
# type: mastodon
|
||||
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
|
||||
# url: '' # Fill with your mastodon account page
|
||||
# -
|
||||
# type: linkedin
|
||||
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
|
||||
# url: '' # Fill with your Linkedin homepage
|
||||
# -
|
||||
# type: stack-overflow
|
||||
# icon: 'fab fa-stack-overflow'
|
||||
# url: '' # Fill with your stackoverflow homepage
|
||||
@@ -1,9 +0,0 @@
|
||||
# The date format
|
||||
# v2.1
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
|
||||
tooltip: "%a, %b %e, %Y, %l:%M %p %z"
|
||||
post: "%b %e, %Y"
|
||||
@@ -1,19 +0,0 @@
|
||||
# The label text of site.
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
|
||||
panel:
|
||||
lastmod: "Recent Update"
|
||||
trending_tags: "Trending Tags"
|
||||
toc: "Contents"
|
||||
|
||||
post:
|
||||
relate_posts: "Further Reading"
|
||||
button:
|
||||
next: Newer
|
||||
previous: Older
|
||||
|
||||
search_hint: "Search" # text show on search bar
|
||||
90
_data/locales/en.yml
Normal file
90
_data/locales/en.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
# The layout text of site
|
||||
|
||||
# ----- Commons label -----
|
||||
|
||||
layout:
|
||||
post: Post
|
||||
category: Category
|
||||
tag: Tag
|
||||
|
||||
# The tabs of sidebar
|
||||
tabs:
|
||||
# format: <filename_without_extension>: <value>
|
||||
home: Home
|
||||
categories: Categories
|
||||
tags: Tags
|
||||
archives: Archives
|
||||
about: About
|
||||
|
||||
# the text displayed in the search bar & search results
|
||||
search:
|
||||
hint: search
|
||||
cancel: Cancel
|
||||
no_results: Oops! No result founds.
|
||||
|
||||
panel:
|
||||
lastmod: Recent Update
|
||||
trending_tags: Trending Tags
|
||||
toc: Contents
|
||||
|
||||
# The liquid date format › http://strftime.net/
|
||||
date_format:
|
||||
tooltip: '%a, %b %e, %Y, %l:%M %p %z'
|
||||
post:
|
||||
long: '%b %e, %Y'
|
||||
short: '%b %e'
|
||||
archive_month: '%b'
|
||||
|
||||
copyright:
|
||||
# Shown at the bottom of the post
|
||||
license:
|
||||
template: This post is licensed under :LICENSE_NAME by the author.
|
||||
name: CC BY 4.0
|
||||
link: https://creativecommons.org/licenses/by/4.0/
|
||||
|
||||
# Displayed in the footer
|
||||
brief: Some rights reserved.
|
||||
verbose: >-
|
||||
Except where otherwise noted, the blog posts on this site are licensed
|
||||
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
|
||||
|
||||
meta: Powered by :PLATFORM with :THEME theme.
|
||||
|
||||
not_found:
|
||||
statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist.
|
||||
hint_template: :HEAD_BAK to try finding it again, or search for it on the :ARCHIVES_PAGE.
|
||||
head_back: Head back Home
|
||||
archives_page: Archives page
|
||||
|
||||
# ----- Posts related labels -----
|
||||
|
||||
post:
|
||||
published: 'on'
|
||||
updated: Updated
|
||||
timeago:
|
||||
day: days ago
|
||||
hour: hours ago
|
||||
minute: minutes ago
|
||||
just_now: just now
|
||||
words: words
|
||||
pageview_measure: views
|
||||
read_time:
|
||||
unit: min
|
||||
prompt: read
|
||||
relate_posts: Further Reading
|
||||
share: Share
|
||||
button:
|
||||
next: Newer
|
||||
previous: Older
|
||||
copy_code:
|
||||
succeed: Copied!
|
||||
share_link:
|
||||
title: Copy link
|
||||
succeed: Link copied successfully!
|
||||
# pinned prompt of posts list on homepage
|
||||
pin_prompt: Pinned
|
||||
|
||||
# categories page
|
||||
categories:
|
||||
category_measure: categories
|
||||
post_measure: posts
|
||||
90
_data/locales/id-ID.yml
Normal file
90
_data/locales/id-ID.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
# The layout text of site
|
||||
|
||||
# ----- Commons label -----
|
||||
|
||||
layout:
|
||||
post: Postingan
|
||||
category: Kategori
|
||||
tag: Tagar
|
||||
|
||||
# The tabs of sidebar
|
||||
tabs:
|
||||
# format: <filename_without_extension>: <value>
|
||||
home: Beranda
|
||||
categories: Kategori
|
||||
tags: Tagar
|
||||
archives: Arsip
|
||||
about: Tentang
|
||||
|
||||
# the text displayed in the search bar & search results
|
||||
search:
|
||||
hint: Cari
|
||||
cancel: Batal
|
||||
no_results: Ups! Tidak ada hasil yang ditemukan.
|
||||
|
||||
panel:
|
||||
lastmod: Postingan Terbaru
|
||||
trending_tags: Tagar Terpopuler
|
||||
toc: Konten
|
||||
|
||||
# The liquid date format › http://strftime.net/
|
||||
date_format:
|
||||
tooltip: "%a, %e %b, %Y, %l:%M %p"
|
||||
post:
|
||||
long: "%e %b, %Y"
|
||||
short: "%e %b"
|
||||
archive_month: "%b"
|
||||
|
||||
copyright:
|
||||
# Shown at the bottom of the post
|
||||
license:
|
||||
template: Postingan ini dilisensikan di bawah :LICENSE_NAME oleh penulis.
|
||||
name: CC BY 4.0
|
||||
link: https://creativecommons.org/licenses/by/4.0/
|
||||
|
||||
# Displayed in the footer
|
||||
brief: Sebagian konten dilindungi.
|
||||
verbose: >-
|
||||
Kecuali jika dinyatakan, Postingan blog di situs ini dilisensikan
|
||||
di bawah Lisensi Creative Commons Attribution 4.0 International (CC BY 4.0) oleh penulis.
|
||||
|
||||
meta: Didukung oleh :PLATFORM dengan tema :THEME.
|
||||
|
||||
not_found:
|
||||
statment: Maaf, kami gagal menemukan URL itu atau memang mengarah ke sesuatu yang tidak ada.
|
||||
hint_template: :HEAD_BAK untuk mencoba mencari kembali, atau cari di :ARCHIVES_PAGE.
|
||||
head_back: Kembali ke Beranda
|
||||
archives_page: Halaman Arsip
|
||||
|
||||
# ----- Posts related labels -----
|
||||
|
||||
post:
|
||||
published: "pada"
|
||||
updated: Diperbarui
|
||||
timeago:
|
||||
day: hari yang lalu
|
||||
hour: jam yang lalu
|
||||
minute: menit yang lalu
|
||||
just_now: baru saja
|
||||
words: kata
|
||||
pageview_measure: dilihat
|
||||
read_time:
|
||||
unit: menit
|
||||
prompt: baca
|
||||
relate_posts: Postingan Lainya
|
||||
share: Bagikan
|
||||
button:
|
||||
next: Terbaru
|
||||
previous: Terlama
|
||||
copy_code:
|
||||
succeed: Disalin!
|
||||
share_link:
|
||||
title: Salin tautan
|
||||
succeed: Tautan berhasil disalin!
|
||||
# pinned prompt of posts list on homepage
|
||||
pin_prompt: Disematkan
|
||||
|
||||
# categories page
|
||||
categories:
|
||||
category_measure: kategori
|
||||
post_measure: Postingan
|
||||
89
_data/locales/zh-CN.yml
Normal file
89
_data/locales/zh-CN.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
# 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: '%F'
|
||||
short: '%m-%d'
|
||||
archive_month: '%m月'
|
||||
|
||||
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: >-
|
||||
除非另有说明,本网站上的博客文章均由作者按照知识共享署名 4.0 国际 (CC BY 4.0) 许可协议进行授权。
|
||||
|
||||
meta: 本站由 :PLATFORM 生成,采用 :THEME 主题。
|
||||
|
||||
not_found:
|
||||
statment: 抱歉,我们放错了该 URL,或者它指向了不存在的内容。
|
||||
hint_template: :HEAD_BAK尝试再次查找它,或在:ARCHIVES_PAGE上搜索它。
|
||||
head_back: 返回主页
|
||||
archives_page: 归档页面
|
||||
|
||||
# ----- Posts related labels -----
|
||||
|
||||
post:
|
||||
published: 发表于
|
||||
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: 篇文章
|
||||
@@ -1,21 +0,0 @@
|
||||
# License data.
|
||||
#
|
||||
# v2.1
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
|
||||
license:
|
||||
link: "https://creativecommons.org/licenses/by/4.0/"
|
||||
prompt: This post is licensed under
|
||||
name: CC BY 4.0
|
||||
icons:
|
||||
- "fab fa-creative-commons"
|
||||
- "fab fa-creative-commons-by"
|
||||
|
||||
brief: Some rights reserved.
|
||||
|
||||
verbose: >-
|
||||
The blog posts on this site are licensed
|
||||
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License.
|
||||
@@ -1,12 +1,5 @@
|
||||
# Sharing options at the bottom of the post.
|
||||
# Icons from <https://fontawesome.com/>
|
||||
#
|
||||
# v2.1
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
label: "Share"
|
||||
|
||||
platforms:
|
||||
-
|
||||
@@ -24,6 +17,11 @@ platforms:
|
||||
|
||||
# Uncomment below if you need to.
|
||||
# -
|
||||
# type: Linkedin
|
||||
# icon: "fab fa-linkedin"
|
||||
# link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
|
||||
#
|
||||
# -
|
||||
# type: Weibo
|
||||
# icon: "fab fa-weibo"
|
||||
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# The tab data.
|
||||
# v2.1
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2020 Cotes Chung
|
||||
# MIT Licensed
|
||||
|
||||
|
||||
-
|
||||
name: Home
|
||||
icon: "fas fa-home"
|
||||
-
|
||||
name: Categories
|
||||
icon: "fas fa-stream"
|
||||
path: tabs
|
||||
url: categories
|
||||
-
|
||||
name: "Tags"
|
||||
icon: "fas fa-tags"
|
||||
path: tabs
|
||||
url: tags
|
||||
-
|
||||
name: "Archives"
|
||||
path: tabs
|
||||
url: archives
|
||||
icon: "fas fa-archive"
|
||||
-
|
||||
name: "About"
|
||||
icon: "fas fa-info"
|
||||
path: tabs
|
||||
url: about
|
||||
15
_includes/css-selector.html
Normal file
15
_includes/css-selector.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!--
|
||||
CSS selector for site.
|
||||
-->
|
||||
|
||||
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
|
||||
|
||||
{% if site.toc and page.toc %}
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.css">
|
||||
{% endif %}
|
||||
|
||||
{% if page.layout == 'page' or page.layout == 'post' %}
|
||||
<!-- Manific Popup -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/magnific-popup.min.css">
|
||||
{% endif %}
|
||||
@@ -1,26 +1,54 @@
|
||||
<!--
|
||||
The Disqus lazy loading.
|
||||
Powered by: https://osvaldas.info/lazy-loading-disqus-comments
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<div id="disqus" class="pt-2 pb-4">
|
||||
<p class="font-italic text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p>
|
||||
<div id="disqus_thread" class="pt-2 pb-2">
|
||||
<p class="text-center text-muted small">
|
||||
Comments powered by <a href="https://disqus.com/">Disqus</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script src="{{ site.baseurl }}/assets/lib/jquery.disqusloader.min.js"></script>
|
||||
<script>
|
||||
var options = {
|
||||
scriptUrl: '//{{ site.disqus.shortname }}.disqus.com/embed.js',
|
||||
|
||||
disqusConfig: function() {
|
||||
this.page.url = '{{ site.url | append: site.baseurl | append: page.url }}';
|
||||
<script type="text/javascript">
|
||||
var disqus_config = function () {
|
||||
this.page.url = '{{ page.url | absolute_url }}';
|
||||
this.page.identifier = '{{ page.url }}';
|
||||
}
|
||||
};
|
||||
|
||||
$.disqusLoader('#disqus', options);
|
||||
/* Lazy loading */
|
||||
|
||||
var disqus_observer = new IntersectionObserver(function (entries) {
|
||||
if(entries[0].isIntersecting) {
|
||||
(function () {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
|
||||
disqus_observer.disconnect();
|
||||
}
|
||||
}, { threshold: [0] });
|
||||
|
||||
disqus_observer.observe(document.querySelector('#disqus_thread'));
|
||||
|
||||
/* Auto switch theme */
|
||||
|
||||
function reloadDisqus() {
|
||||
/* Disqus hasn't been loaded */
|
||||
if (typeof DISQUS === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.readyState == 'complete') {
|
||||
DISQUS.reset({ reload: true, config: disqus_config });
|
||||
}
|
||||
}
|
||||
|
||||
const modeToggle = document.querySelector(".mode-toggle");
|
||||
|
||||
if (modeToggle !== null) {
|
||||
modeToggle.addEventListener('click', reloadDisqus);
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,36 +1,17 @@
|
||||
<!--
|
||||
The Favicons for Web, Android, Microsoft, and iOS (iPhone and iPad) Apps
|
||||
Generated by: https://www.favicon-generator.org/
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
Published under the MIT license
|
||||
Generated by: https://realfavicongenerator.net/
|
||||
-->
|
||||
|
||||
{% capture icon_url %}{{ site.baseurl }}/assets/img/favicons{% endcapture %}
|
||||
{% capture favicon_path %}{{ '/assets/img/favicons' | relative_url }}{% endcapture %}
|
||||
|
||||
<link rel="shortcut icon" href="{{ icon_url }}/favicon.ico" type="image/x-icon">
|
||||
<link rel="icon" href="{{ icon_url }}/favicon.ico" type="image/x-icon">
|
||||
|
||||
<link rel="apple-touch-icon" href="{{ icon_url }}/apple-icon.png">
|
||||
<link rel="apple-touch-icon" href="{{ icon_url }}/apple-icon-precomposed.png">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="{{ icon_url }}/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="{{ icon_url }}/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="{{ icon_url }}/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="{{ icon_url }}/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="{{ icon_url }}/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="{{ icon_url }}/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="{{ icon_url }}/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="{{ icon_url }}/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ icon_url }}/apple-icon-180x180.png">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="{{ icon_url }}/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ icon_url }}/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="{{ icon_url }}/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ icon_url }}/favicon-16x16.png">
|
||||
|
||||
<link rel="manifest" href="{{ icon_url }}/manifest.json">
|
||||
<meta name='msapplication-config' content='{{ icon_url }}/browserconfig.xml'>
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="{{ icon_url }}/ms-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ favicon_path }}/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ favicon_path }}/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ favicon_path }}/favicon-16x16.png">
|
||||
<link rel="manifest" href="{{ favicon_path }}/site.webmanifest">
|
||||
<link rel="shortcut icon" href="{{ favicon_path }}/favicon.ico">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ site.title }}">
|
||||
<meta name="application-name" content="{{ site.title }}">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-config" content="{{ favicon_path }}/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<!--
|
||||
Fixed kramdown code highlight rendering:
|
||||
https://github.com/penibelst/jekyll-compress-html/issues/101
|
||||
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
||||
-->
|
||||
{% if _content contains '<pre class="highlight">' %}
|
||||
{% assign _content = _content | replace: '<pre class="highlight"><code', '<code' %}
|
||||
{% assign _content = _content | replace: '</code></pre>', '</code>' %}
|
||||
{% endif %}
|
||||
@@ -1,9 +1,5 @@
|
||||
<!--
|
||||
The Footer
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<footer class="d-flex w-100 justify-content-center">
|
||||
@@ -12,19 +8,28 @@
|
||||
<p class="mb-0">
|
||||
© {{ 'now' | date: "%Y" }}
|
||||
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
||||
{% if site.data.right.brief %}
|
||||
{% if site.data.locales[lang].copyright.brief %}
|
||||
<span data-toggle="tooltip" data-placement="top"
|
||||
title="{{ site.data.right.verbose }}">{{ site.data.right.brief }}</span>
|
||||
title="{{ site.data.locales[lang].copyright.verbose }}">{{ site.data.locales[lang].copyright.brief }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="footer-right">
|
||||
<p class="mb-0">
|
||||
Powered by
|
||||
<a href="https://jekyllrb.com" target="_blank">Jekyll</a>
|
||||
with theme
|
||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/">Chirpy</a>.
|
||||
{% capture _platform %}
|
||||
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
|
||||
{% endcapture %}
|
||||
|
||||
{% capture _theme %}
|
||||
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
|
||||
{% endcapture %}
|
||||
|
||||
{{ site.data.locales[lang].meta
|
||||
| default: 'Powered by :PLATFORM with :THEME theme.'
|
||||
| replace: ':PLATFORM', _platform | replace: ':THEME', _theme
|
||||
}}
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<!--
|
||||
The GA snippet
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics.id }}"></script>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
|
||||
ga('create', '{{ site.google_analytics.id }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ site.google_analytics.id }}');
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,32 +1,45 @@
|
||||
<!--
|
||||
The Head
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>
|
||||
{%- if page.layout == "home" -%}
|
||||
{{- site.title -}}
|
||||
{%- else -%}
|
||||
{{ page.title }} | {{ site.title }}
|
||||
{%- endif -%}
|
||||
</title>
|
||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||
|
||||
<!-- i18n for `_javascript/utils/timeago.js` -->
|
||||
<meta name="day-prompt" content="{{ site.data.locales[lang].post.timeago.day }}">
|
||||
<meta name="hour-prompt" content="{{ site.data.locales[lang].post.timeago.hour }}">
|
||||
<meta name="minute-prompt" content="{{ site.data.locales[lang].post.timeago.minute }}">
|
||||
<meta name="justnow-prompt" content="{{ site.data.locales[lang].post.timeago.just_now }}">
|
||||
|
||||
{% if site.google_analytics.pv.proxy_endpoint %}
|
||||
<meta name="pv-proxy-endpoint" content="{{ site.google_analytics.pv.proxy_endpoint }}">
|
||||
{% endif %}
|
||||
|
||||
{% if site.google_analytics.pv.cache_path %}
|
||||
<meta name="pv-cache-path" content="{{ site.google_analytics.pv.cache_path | relative_url }}">
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% seo title=false %}
|
||||
|
||||
<title>
|
||||
{%- unless page.layout == "home" -%}
|
||||
{{ page.title | append: " | "}}
|
||||
{%- endunless -%}
|
||||
{{ site.title }}
|
||||
</title>
|
||||
|
||||
{% include favicons.html %}
|
||||
|
||||
<!-- google fonts -->
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
|
||||
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
|
||||
|
||||
<!-- ga -->
|
||||
<!-- GA -->
|
||||
{% if jekyll.environment == 'production' %}
|
||||
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
|
||||
<link rel="dns-prefetch" href="https://www.google-analytics.com">
|
||||
@@ -34,120 +47,29 @@
|
||||
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
|
||||
<link rel="dns-prefetch" href="https://www.googletagmanager.com">
|
||||
|
||||
{% if site.google_analytics.pv.proxy_url and site.google_analytics.pv.enabled %}
|
||||
<link rel="preconnect" href="{{ site.google_analytics.pv.proxy_url }}" crossorigin="use-credentials">
|
||||
<link rel="dns-prefetch" href="{{ site.google_analytics.pv.proxy_url }}">
|
||||
{% if site.google_analytics.pv.proxy_endpoint %}
|
||||
{% assign proxy_url = site.google_analytics.pv.proxy_endpoint
|
||||
| replace: "https://", "" | split: "/" | first | prepend: "https://" %}
|
||||
|
||||
<link rel="preconnect" href="{{ proxy_url }}" crossorigin="use-credentials">
|
||||
<link rel="dns-prefetch" href="{{ proxy_url }}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<!-- jsdelivr CDN -->
|
||||
<link rel="preconnect" href="cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="cdn.jsdelivr.net">
|
||||
<!-- jsDelivr CDN -->
|
||||
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
|
||||
<link rel="preload" as="style"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css">
|
||||
|
||||
<link rel="preload" as="style"
|
||||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css"
|
||||
integrity="sha256-+N4/V/SbAFiW1MPBCXnfnP9QSN3+Keu+NlB+0ev/YKQ="
|
||||
crossorigin="anonymous">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css">
|
||||
|
||||
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/main.css">
|
||||
{% include css-selector.html %}
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
|
||||
integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous">
|
||||
<!-- JavaScript -->
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css"
|
||||
integrity="sha256-+N4/V/SbAFiW1MPBCXnfnP9QSN3+Keu+NlB+0ev/YKQ="
|
||||
crossorigin="anonymous">
|
||||
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css">
|
||||
|
||||
{% if page.layout == 'home' %}
|
||||
<link rel="preload" href="{{ site.baseurl }}/assets/css/home.css" as="style">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/home.css">
|
||||
{% endif %}
|
||||
|
||||
{% if page.title == 'Categories' and page.layout == 'page' %}
|
||||
<link rel="preload" href="{{ site.baseurl }}/assets/css/categories.css" as="style">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/categories.css">
|
||||
{% endif %}
|
||||
|
||||
{% if page.title == 'Tags' and page.layout == 'page' %}
|
||||
<link rel="preload" href="{{ site.baseurl }}/assets/css/tags.css" as="style">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/tags.css">
|
||||
{% endif %}
|
||||
|
||||
{% if page.layout == 'category' or page.layout == 'tag' %}
|
||||
<link rel="preload" href="{{ site.baseurl }}/assets/css/category-tag.css" as="style">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/category-tag.css">
|
||||
{% endif %}
|
||||
|
||||
{% if page.title == 'Archives' and page.layout == 'page' %}
|
||||
<link rel="preload" href="{{ site.baseurl }}/assets/css/archives.css" as="style">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/archives.css">
|
||||
{% endif %}
|
||||
|
||||
{% if page.title == 'About' and page.layout == 'page' %}
|
||||
<link rel="preload" href="{{ site.baseurl }}/assets/css/syntax.css" as="style">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/syntax.css">
|
||||
{% endif %}
|
||||
|
||||
<!-- jquery -->
|
||||
<link rel="preload" as="script"
|
||||
href="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"
|
||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous">
|
||||
|
||||
<!-- popper -->
|
||||
<link rel="preload" as="script"
|
||||
href="https://cdn.jsdelivr.net/npm/popper.js@1.15.0/dist/umd/popper.min.js"
|
||||
integrity="sha256-fTuUgtT7O2rqoImwjrhDgbXTKUwyxxujIMRIK7TbuNU=" crossorigin>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"
|
||||
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
window.jQuery || document.write('<script src="{{ site.baseurl }}/assets/lib/jquery-3.4.1.min.js"><\/script>');
|
||||
</script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.15.0/dist/umd/popper.min.js"
|
||||
integrity="sha256-fTuUgtT7O2rqoImwjrhDgbXTKUwyxxujIMRIK7TbuNU=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"
|
||||
integrity="sha256-5+02zu5UULQkO7w1GIr6vftCgMfFdZcAHeDtFnKZsBs=" crossorigin="anonymous" async></script>
|
||||
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/commons.js" async></script>
|
||||
|
||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/timeago.min.js" async></script>
|
||||
{% if site.google_analytics.pv.enabled %}
|
||||
<script src="{{ site.baseurl }}/assets/data/pv-data.json"></script>
|
||||
<script src="{{ site.baseurl }}/assets/lib/countUp.min.js" async></script>
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/pageviews.min.js" async></script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.layout == 'post' %}
|
||||
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/post.css">
|
||||
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/syntax.css">
|
||||
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/post.css">
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/syntax.css">
|
||||
|
||||
{% if site.toc and page.toc %}
|
||||
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css">
|
||||
<link rel="preload" as="script" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js">
|
||||
|
||||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css" />
|
||||
<script src="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js" async></script>
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/toc.min.js" async></script>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<script src="{{ site.baseurl }}/assets/js/dist/tooltip-loader.min.js" async></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
|
||||
|
||||
</head>
|
||||
68
_includes/js-selector.html
Normal file
68
_includes/js-selector.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!--
|
||||
JS selector for site.
|
||||
-->
|
||||
|
||||
<!-- layout specified -->
|
||||
|
||||
{% if page.layout == 'home' or page.layout == 'post' %}
|
||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
||||
<!-- pv-report needs countup.js -->
|
||||
<script async src="https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js"></script>
|
||||
<script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.layout == 'post' or page.layout == 'page' %}
|
||||
<!-- image lazy-loading & popup -->
|
||||
<script src="https://cdn.jsdelivr.net/combine/npm/lozad/dist/lozad.min.js,npm/magnific-popup@1/dist/jquery.magnific-popup.min.js,npm/clipboard@2/dist/clipboard.min.js"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if page.layout == 'home'
|
||||
or page.layout == 'categories'
|
||||
or page.layout == 'post'
|
||||
or page.layout == 'page' %}
|
||||
{% assign type = page.layout %}
|
||||
{% else %}
|
||||
{% assign type = "commons" %}
|
||||
{% endif %}
|
||||
|
||||
{% assign js = type | prepend: '/assets/js/dist/' | append: '.min.js' %}
|
||||
<script defer src="{{ js | relative_url }}"></script>
|
||||
|
||||
{% if page.math %}
|
||||
<!-- MathJax -->
|
||||
<script>
|
||||
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [ /* start/end delimiter pairs for in-line math */
|
||||
['$','$'],
|
||||
['\\(','\\)']
|
||||
],
|
||||
displayMath: [ /* start/end delimiter pairs for display math */
|
||||
['$$', '$$'],
|
||||
['\\[', '\\]']
|
||||
]
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- commons -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/combine/npm/popper.js@1.16.1,npm/bootstrap@4/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
{% if jekyll.environment == 'production' %}
|
||||
<!-- PWA -->
|
||||
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
||||
|
||||
<!-- GA -->
|
||||
{% if site.google_analytics.id %}
|
||||
{% include google-analytics.html %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
8
_includes/lang.html
Normal file
8
_includes/lang.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% comment %}
|
||||
Detect appearance language and return it through variable "lang"
|
||||
{% endcomment %}
|
||||
{% if site.data.locales[site.lang] %}
|
||||
{% assign lang = site.lang %}
|
||||
{% else %}
|
||||
{% assign lang = 'en' %}
|
||||
{% endif %}
|
||||
72
_includes/language-alias.html
Normal file
72
_includes/language-alias.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{% comment %}
|
||||
|
||||
Convert the alias of the syntax language to the official name
|
||||
|
||||
See: <https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers>
|
||||
|
||||
{% endcomment %}
|
||||
|
||||
{% assign _lang = include.language | default: '' %}
|
||||
|
||||
{% case _lang %}
|
||||
{% when 'actionscript', 'as', 'as3' %}
|
||||
{{ 'ActionScript' }}
|
||||
{% when 'applescript' %}
|
||||
{{ 'AppleScript' }}
|
||||
{% when 'brightscript', 'bs', 'brs' %}
|
||||
{{ 'BrightScript' }}
|
||||
{% when 'cfscript', 'cfc' %}
|
||||
{{ 'CFScript' }}
|
||||
{% when 'coffeescript', 'coffee', 'coffee-script' %}
|
||||
{{ 'CoffeeScript' }}
|
||||
{% when 'cs', 'csharp' %}
|
||||
{{ 'C#' }}
|
||||
{% when 'erl' %}
|
||||
{{ 'Erlang' }}
|
||||
{% when 'graphql' %}
|
||||
{{ 'GraphQL' }}
|
||||
{% when 'haskell', 'hs' %}
|
||||
{{ 'Haskell' }}
|
||||
{% when 'javascript', 'js' %}
|
||||
{{ 'JavaScript' }}
|
||||
{% when 'make', 'mf', 'gnumake', 'bsdmake' %}
|
||||
{{ 'Makefile' }}
|
||||
{% when 'md', 'mkd' %}
|
||||
{{ 'Markdown' }}
|
||||
{% when 'm' %}
|
||||
{{ 'Matlab' }}
|
||||
{% when 'objective_c', 'objc', 'obj-c', 'obj_c', 'objectivec' %}
|
||||
{{ 'Objective-C' }}
|
||||
{% when 'perl', 'pl' %}
|
||||
{{ 'Perl' }}
|
||||
{% when 'php','php3','php4','php5' %}
|
||||
{{ 'PHP' }}
|
||||
{% when 'plaintext', 'text' %}
|
||||
{{ 'Text' }}
|
||||
{% when 'py' %}
|
||||
{{ 'Python' }}
|
||||
{% when 'rb' %}
|
||||
{{ 'Ruby' }}
|
||||
{% when 'rs','no_run','ignore','should_panic' %}
|
||||
{{ 'Rust' }}
|
||||
{% when 'bash', 'zsh', 'ksh', 'sh' %}
|
||||
{{ 'Shell' }}
|
||||
{% when 'st', 'squeak' %}
|
||||
{{ 'Smalltalk' }}
|
||||
{% when 'tex'%}
|
||||
{{ 'TeX' }}
|
||||
{% when 'latex' %}
|
||||
{{ 'LaTex' }}
|
||||
{% when 'ts', 'typescript' %}
|
||||
{{ 'TypeScript' }}
|
||||
{% when 'vb', 'visualbasic' %}
|
||||
{{ 'Visual Basic' }}
|
||||
{% when 'vue', 'vuejs' %}
|
||||
{{ 'Vue.js' }}
|
||||
{% when 'yml' %}
|
||||
{{ 'YAML' }}
|
||||
{% when 'css', 'html', 'scss', 'ssh', 'toml', 'xml', 'yaml' %}
|
||||
{{ _lang | upcase }}
|
||||
{% else %}
|
||||
{{ _lang | capitalize }}
|
||||
{% endcase %}
|
||||
@@ -1,7 +0,0 @@
|
||||
<!-- image lazy load -->
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
const observer = lozad();
|
||||
observer.observe();
|
||||
</script>
|
||||
29
_includes/mermaid.html
Normal file
29
_includes/mermaid.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!--
|
||||
mermaid-js loader
|
||||
-->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
let initTheme = "default";
|
||||
|
||||
if ($("html[mode=dark]").length > 0
|
||||
|| ($("html[mode]").length == 0
|
||||
&& window.matchMedia("(prefers-color-scheme: dark)").matches ) ) {
|
||||
initTheme = "dark";
|
||||
}
|
||||
|
||||
let mermaidConf = {
|
||||
theme: initTheme /* <default|dark|forest|neutral> */
|
||||
};
|
||||
|
||||
/* Markdown converts to HTML */
|
||||
$("pre").has("code.language-mermaid").each(function() {
|
||||
let svgCode = $(this).children().html();
|
||||
$(this).addClass("unloaded");
|
||||
$(this).after(`<div class=\"mermaid\">${svgCode}</div>`);
|
||||
});
|
||||
|
||||
mermaid.initialize(mermaidConf);
|
||||
});
|
||||
</script>
|
||||
@@ -1,14 +1,8 @@
|
||||
<!--
|
||||
Switch the mode between dark and light.
|
||||
|
||||
v2.1
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2020 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<i class="mode-toggle fas fa-sun" light-mode-invisible></i>
|
||||
<i class="mode-toggle fas fa-moon" dark-mode-invisible></i>
|
||||
<i class="mode-toggle fas fa-adjust"></i>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -18,8 +12,8 @@
|
||||
static get LIGHT_MODE() { return "light"; }
|
||||
|
||||
constructor() {
|
||||
if (this.mode != null) {
|
||||
if (this.mode == ModeToggle.DARK_MODE) {
|
||||
if (this.hasMode) {
|
||||
if (this.isDarkMode) {
|
||||
if (!this.isSysDarkPrefer) {
|
||||
this.setDark();
|
||||
}
|
||||
@@ -34,8 +28,8 @@
|
||||
|
||||
/* always follow the system prefers */
|
||||
this.sysDarkPrefers.addListener(function() {
|
||||
if (self.mode != null) {
|
||||
if (self.mode == ModeToggle.DARK_MODE) {
|
||||
if (self.hasMode) {
|
||||
if (self.isDarkMode) {
|
||||
if (!self.isSysDarkPrefer) {
|
||||
self.setDark();
|
||||
}
|
||||
@@ -48,6 +42,8 @@
|
||||
|
||||
self.clearMode();
|
||||
}
|
||||
|
||||
self.updateMermaid();
|
||||
});
|
||||
|
||||
} /* constructor() */
|
||||
@@ -74,16 +70,43 @@
|
||||
|
||||
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
|
||||
|
||||
get isLightkMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
||||
get isLightMode() { return this.mode == ModeToggle.LIGHT_MODE; }
|
||||
|
||||
get hasMode() { return this.mode != null; }
|
||||
|
||||
get 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.isLightkMode) {
|
||||
if (this.isLightMode) {
|
||||
this.clearMode();
|
||||
} else {
|
||||
this.setLight();
|
||||
@@ -105,6 +128,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
this.updateMermaid();
|
||||
|
||||
} /* flipMode() */
|
||||
|
||||
} /* ModeToggle */
|
||||
@@ -112,7 +137,9 @@
|
||||
let toggle = new ModeToggle();
|
||||
|
||||
$(".mode-toggle").click(function() {
|
||||
|
||||
toggle.flipMode();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
10
_includes/no-linenos.html
Normal file
10
_includes/no-linenos.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% comment %}
|
||||
Remove the line number of the code snippet.
|
||||
{% endcomment %}
|
||||
|
||||
{% assign content = include.content %}
|
||||
|
||||
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
|
||||
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
|
||||
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
|
||||
{% endif %}
|
||||
13
_includes/no-zero-date.html
Normal file
13
_includes/no-zero-date.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% comment %}
|
||||
Remove the zero padding from a month/day string
|
||||
{% endcomment %}
|
||||
|
||||
{% assign ret = include.date_str %}
|
||||
{% assign _first_chat = ret | slice: 0 %}
|
||||
|
||||
{% if _first_chat == '0' %}
|
||||
{% assign _last_idx = ret.size | minus: 1 %}
|
||||
{% assign ret = ret | slice: 1, _last_idx %}
|
||||
{% endif %}
|
||||
|
||||
{{ ret | replace: ' 0', ' ' }}
|
||||
@@ -1,65 +1,57 @@
|
||||
<!--
|
||||
The Pannel on right side (Desktop views)
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<div id="panel-wrapper" class="col-xl-3 pl-2 topbar-down">
|
||||
{% include lang.html %}
|
||||
|
||||
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
|
||||
|
||||
<div class="access">
|
||||
{% assign lastmod_list = "" | split: "" %}
|
||||
{% assign index = 0 %}
|
||||
|
||||
{% for post in site.posts %}
|
||||
{% if post.seo.date_modified > post.date and post.seo.date_modified != nil %}
|
||||
{% capture item %}
|
||||
{{ post.seo.date_modified }}::{{ index }}
|
||||
{% endcapture %}
|
||||
{% assign lastmod_list = lastmod_list | push: item %}
|
||||
{% endif %}
|
||||
{% assign index = index | plus: 1 %}
|
||||
{% endfor %}
|
||||
{% include update-list.html %}
|
||||
|
||||
{% if update_list.size > 0 %}
|
||||
|
||||
{% if lastmod_list.size > 0 %}
|
||||
<div id="access-lastmod" class="post">
|
||||
<h3 data-toc-skip>
|
||||
{{- site.data.label.panel.lastmod -}}
|
||||
</h3>
|
||||
<span>{{- site.data.locales[lang].panel.lastmod -}}</span>
|
||||
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
|
||||
{% assign MAX_SIZE = 5 %}
|
||||
{% assign sum = 0 %}
|
||||
{% assign lastmod_list = lastmod_list | sort | reverse %}
|
||||
{% for item in lastmod_list %}
|
||||
|
||||
{% for item in update_list %}
|
||||
{% assign index = item | split: "::" | last | plus: 0 %}
|
||||
{% assign post = site.posts[index] %}
|
||||
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
|
||||
{% assign sum = sum | plus: 1 %}
|
||||
{% if sum >= MAX_SIZE %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% assign url = post.url | relative_url %}
|
||||
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
</div><!-- #access-lastmod -->
|
||||
</div> <!-- #access-lastmod -->
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div id="access-tags">
|
||||
<h3 data-toc-skip>
|
||||
{{- site.data.label.panel.trending_tags -}}
|
||||
</h3>
|
||||
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
|
||||
{% include trending-tags.html %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% 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 page.layout == 'post' and site.toc and page.toc %}
|
||||
{% 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">
|
||||
<h3 data-toc-skip class="pl-3 pt-2 mb-3">
|
||||
{{- site.data.label.panel.toc -}}
|
||||
</h3>
|
||||
<span class="pl-3 pt-2 mb-2">
|
||||
{{- site.data.locales[lang].panel.toc -}}
|
||||
</span>
|
||||
<nav id="toc" data-toggle="toc"></nav>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
<!--
|
||||
Navigation buttons at the bottom of the post.
|
||||
|
||||
v2.1
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2020 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<div class="post-navigation d-flex justify-content-between">
|
||||
{% if page.previous.url %}
|
||||
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary">
|
||||
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
|
||||
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
||||
<p>{{ page.previous.title }}</p>
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="btn btn-outline-primary disabled">
|
||||
<span class="btn btn-outline-primary disabled"
|
||||
prompt="{{ site.data.locales[lang].post.button.previous }}">
|
||||
<p>-</p>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if page.next.url %}
|
||||
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary">
|
||||
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
|
||||
prompt="{{ site.data.locales[lang].post.button.next }}">
|
||||
<p>{{ page.next.title }}</p>
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="btn btn-outline-primary disabled">
|
||||
<span class="btn btn-outline-primary disabled"
|
||||
prompt="{{ site.data.locales[lang].post.button.next }}">
|
||||
<p>-</p>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,26 +1,20 @@
|
||||
<!--
|
||||
The paginator for post list on HomgPage.
|
||||
|
||||
v2.1
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2020 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<ul class="pagination mt-4 mb-0 pl-lg-2">
|
||||
<ul class="pagination align-items-center mt-4 mb-0 pl-lg-2">
|
||||
<!-- left arrow -->
|
||||
{% if paginator.previous_page %}
|
||||
<li class="page-item">
|
||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}{{ paginator.previous_page_path }}">
|
||||
{% assign prev_url = paginator.previous_page_path | relative_url %}
|
||||
{% else %}
|
||||
{% assign prev_url = "#" %}
|
||||
{% endif %}
|
||||
|
||||
<li class="page-item {% unless paginator.previous_page %}disabled{% endunless %}">
|
||||
<a class="page-link btn-box-shadow" href="{{ prev_url }}" aria-label="previous-page">
|
||||
<i class="fas fa-angle-left"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link btn-box-shadow" href="#"><i class="fas fa-angle-left"></i></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<!-- endof left arrow -->
|
||||
|
||||
<!-- page numbers -->
|
||||
{% assign left_ellipsis = false %}
|
||||
@@ -72,17 +66,23 @@
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<!-- mobile pagination -->
|
||||
<li class="page-index align-middle">
|
||||
<span>{{ paginator.page }}</span>
|
||||
<span class="text-muted">/ {{ paginator.total_pages }}</span>
|
||||
</li>
|
||||
|
||||
<!-- right arrow -->
|
||||
{% if paginator.next_page %}
|
||||
<li class="page-item">
|
||||
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}{{ paginator.next_page_path }}">
|
||||
{% if paginator.next_page_path %}
|
||||
{% assign next_url = paginator.next_page_path | relative_url %}
|
||||
{% else %}
|
||||
{% assign next_url = "#" %}
|
||||
{% endif %}
|
||||
|
||||
<li class="page-item {% unless paginator.next_page_path %}disabled{% endunless %}">
|
||||
<a class="page-link btn-box-shadow" href="{{ next_url }}" aria-label="next-page">
|
||||
<i class="fas fa-angle-right"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link btn-box-shadow" href="#"><i class="fas fa-angle-right"></i></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
</ul> <!-- .pagination -->
|
||||
@@ -1,28 +1,26 @@
|
||||
<!--
|
||||
Post sharing snippet
|
||||
|
||||
v2.1
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
Published under the MIT License
|
||||
-->
|
||||
|
||||
<div class="share-wrapper">
|
||||
<span class="share-label ml-1 mr-1">{{ site.data.share.label }}</span>
|
||||
<span class="share-label text-muted mr-1">{{ site.data.locales[lang].post.share }}</span>
|
||||
<span class="share-icons">
|
||||
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
||||
{% assign url = page.url | relative_url | prepend: site.url %}
|
||||
{% assign url = page.url | absolute_url %}
|
||||
|
||||
{% for share in site.data.share.platforms %}
|
||||
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
||||
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
|
||||
title="{{ share.type }}" target="_blank">
|
||||
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
|
||||
<i class="fa-fw {{ share.icon }}"></i>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
<i class="fa-fw fas fa-link small" onclick="copyLink()"
|
||||
data-toggle="tooltip" data-placement="top" title="Copy link"></i>
|
||||
<i id="copy-link" class="fa-fw fas fa-link small"
|
||||
data-toggle="tooltip" data-placement="top"
|
||||
title="{{ site.data.locales[lang].post.button.share_link.title }}"
|
||||
title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
|
||||
</i>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
30
_includes/read-time.html
Normal file
30
_includes/read-time.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!--
|
||||
Calculate the post's reading time, and display the word count in tooltip
|
||||
-->
|
||||
|
||||
{% assign words = include.content | strip_html | number_of_words: "auto" %}
|
||||
|
||||
<!-- words per minute -->
|
||||
|
||||
{% assign wpm = 180 %}
|
||||
{% assign min_time = 1 %}
|
||||
|
||||
{% assign read_time = words | divided_by: wpm %}
|
||||
|
||||
{% unless read_time > 0 %}
|
||||
{% assign read_time = min_time %}
|
||||
{% endunless %}
|
||||
|
||||
{% capture read_prompt %}
|
||||
{{- site.data.locales[lang].post.read_time.prompt -}}
|
||||
{% endcapture %}
|
||||
|
||||
<!-- return element -->
|
||||
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
|
||||
title="{{ words }} {{ site.data.locales[lang].post.words }}">
|
||||
{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}
|
||||
{%- if include.prompt -%}
|
||||
{% assign _prompt_words = read_prompt | number_of_words: 'auto' %}
|
||||
{% unless _prompt_words > 1 %}{{" "}}{% endunless %}{{ read_prompt }}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
153
_includes/refactor-content.html
Normal file
153
_includes/refactor-content.html
Normal file
@@ -0,0 +1,153 @@
|
||||
<!--
|
||||
Refactor the HTML structure.
|
||||
-->
|
||||
|
||||
{% assign _content = include.content %}
|
||||
|
||||
<!--
|
||||
In order to allow a wide table to scroll horizontally,
|
||||
we suround the markdown table with `<div class="table-wrapper">` and `</div>`
|
||||
-->
|
||||
|
||||
{% if _content contains '<table>' %}
|
||||
{% assign _content = _content
|
||||
| replace: '<table>', '<div class="table-wrapper"><table>'
|
||||
| replace: '</table>', '</table></div>'
|
||||
| replace: '</table></div></code>', '</table></code>'
|
||||
%}
|
||||
{% endif %}
|
||||
|
||||
<!--
|
||||
Fixed kramdown code highlight rendering:
|
||||
https://github.com/penibelst/jekyll-compress-html/issues/101
|
||||
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
|
||||
-->
|
||||
|
||||
{% if _content contains '<pre class="highlight">' %}
|
||||
{% assign _content = _content
|
||||
| replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code'
|
||||
| replace: '</code></pre></div>', '</code></div>'
|
||||
%}
|
||||
{% endif %}
|
||||
|
||||
<!-- Add attribute 'hide-bullet' to the checkbox list -->
|
||||
|
||||
{% if _content contains '<li class="task-list-item"><' %}
|
||||
{% assign _content = _content
|
||||
| replace: '"task-list-item"><', '"task-list-item" hide-bullet><'
|
||||
%}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- images -->
|
||||
|
||||
{% if _content contains '<img src="' %}
|
||||
|
||||
<!-- 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 -->
|
||||
|
||||
{% assign _img_content = nil %}
|
||||
|
||||
{% assign _images = _content | split: '<img ' %}
|
||||
|
||||
{% for _img in _images %}
|
||||
{% if forloop.first %}
|
||||
{% assign _img_content = _img %}
|
||||
{% continue %}
|
||||
{% endif %}
|
||||
|
||||
{% assign _width = nil %}
|
||||
{% assign _height = nil %}
|
||||
{% assign _attrs = _img | split: '>' | first | split: ' ' %}
|
||||
|
||||
{% for _attr in _attrs %}
|
||||
{% capture _key %}{{ _attr | split: '=' | first }}{% endcapture %}
|
||||
{% capture _value %}{{ _attr | split: '=' | last | replace: '"', '' }}{% endcapture %}
|
||||
|
||||
{% case _key %}
|
||||
{% when 'width' %}
|
||||
{% assign _width = _value %}
|
||||
{% when 'height' %}
|
||||
{% assign _height = _value %}
|
||||
{% endcase %}
|
||||
|
||||
{% if _width and _height %}
|
||||
{% 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 %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% unless _width and _height %}
|
||||
{% assign _img_content = _img_content | append: '<img ' | append: _img %}
|
||||
{% endunless %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% assign _content = _img_content %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<!-- Add header for code snippets -->
|
||||
|
||||
{% if _content contains '<div class="highlight"><code>' %}
|
||||
{% assign _code_spippets = _content | split: '<div class="highlight"><code>' %}
|
||||
{% assign _new_content = '' %}
|
||||
|
||||
{% for _snippet in _code_spippets %}
|
||||
|
||||
{% if forloop.last %}
|
||||
{% assign _new_content = _new_content | append: _snippet %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% assign _left = _snippet | split: '><' | last%}
|
||||
|
||||
{% if _left contains 'file="' %}
|
||||
{% assign _text = _left | split: 'file="' | last | split: '"' | first %}
|
||||
{% assign _label_icon = 'far fa-file-code' %}
|
||||
{% else %}
|
||||
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
|
||||
{% capture _text %}{% include language-alias.html language=_lang %}{% endcapture %}
|
||||
{% assign _label_icon = 'fas fa-code small' %}
|
||||
{% endif %}
|
||||
|
||||
{% capture _label %}
|
||||
<span text-data="{{ _text }}"><i class="fa-fw {{ _label_icon }}"></i></span>
|
||||
{% endcapture %}
|
||||
|
||||
{% assign _new_content = _new_content | append: _snippet
|
||||
| append: '<div class="code-header">'
|
||||
| append: _label
|
||||
| append: '<button aria-label="copy" title-succeed="'
|
||||
| append: site.data.locales[lang].post.button.copy_code.succeed
|
||||
| append: '"><i class="far fa-clipboard"></i></button></div>'
|
||||
| append: '<div class="highlight"><code>'
|
||||
%}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% assign _content = _new_content %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- return -->
|
||||
|
||||
{{ _content }}
|
||||
@@ -1,21 +1,29 @@
|
||||
<!--
|
||||
The related posts of current post.
|
||||
Placed in the bottom of every single post.
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
Published under the MIT License
|
||||
Recommend the other 3 posts according to the tags and categories of the current post,
|
||||
if the number is not enough, use the other latest posts to supplement.
|
||||
-->
|
||||
|
||||
{% assign MAX_SIZE = 3 %}
|
||||
<!-- The total size of related posts -->
|
||||
{% assign TOTAL_SIZE = 3 %}
|
||||
|
||||
<!-- An random integer that bigger than 0 -->
|
||||
{% assign TAG_SCORE = 1 %}
|
||||
|
||||
<!-- Equals to TAG_SCORE / {max_categories_hierarchy} -->
|
||||
{% assign CATEGORY_SCORE = 0.5 %}
|
||||
|
||||
{% assign score_list = "" | split: "" %}
|
||||
{% assign post_index = 0 %}
|
||||
{% assign SEPARATOR = ":" %}
|
||||
|
||||
{% assign score_list = "" | split: "" %}
|
||||
{% assign last_index = site.posts.size | minus: 1 %}
|
||||
|
||||
{% for i in (0..last_index) %}
|
||||
{% assign post = site.posts[i] %}
|
||||
|
||||
{% if post.url == page.url %}
|
||||
{% continue %}
|
||||
{% endif %}
|
||||
|
||||
{% for post in site.posts %}
|
||||
{% if post.url != page.url %}
|
||||
{% assign score = 0 %}
|
||||
|
||||
{% for tag in post.tags %}
|
||||
@@ -31,43 +39,68 @@
|
||||
{% endfor %}
|
||||
|
||||
{% if score > 0 %}
|
||||
{% capture score_item %}{{ score }}:{{ post_index }}{% endcapture %}
|
||||
{% capture score_item %}{{ score }}{{ SEPARATOR }}{{ i }}{% endcapture %}
|
||||
{% assign score_list = score_list | push: score_item %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% assign post_index = post_index | plus: 1 %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% assign index_list = "" | split: "" %}
|
||||
|
||||
{% if score_list.size > 0 %}
|
||||
{% assign score_list = score_list | sort | reverse %}
|
||||
{% assign count = 0 %}
|
||||
<div id="related-posts" class="mt-4 mb-2 mb-sm-4 pb-2">
|
||||
<h3 class="pt-2 mt-1 mb-4 ml-1" data-toc-skip>{{ site.data.label.post.relate_posts }}</h3>
|
||||
{% for entry in score_list limit: TOTAL_SIZE %}
|
||||
{% assign index = entry | split: SEPARATOR | last %}
|
||||
{% assign index_list = index_list | push: index %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Fill with the other newlest posts -->
|
||||
{% assign less = TOTAL_SIZE | minus: index_list.size %}
|
||||
|
||||
{% if less > 0 %}
|
||||
|
||||
{% for i in (0..last_index) %}
|
||||
{% assign post = site.posts[i] %}
|
||||
{% if post.url != page.url %}
|
||||
{% capture cur_index %}{{ i }}{% endcapture %}
|
||||
{% unless index_list contains cur_index %}
|
||||
{% assign index_list = index_list | push: cur_index %}
|
||||
{% assign less = less | minus: 1 %}
|
||||
{% if less <= 0 %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if index_list.size > 0 %}
|
||||
<div id="related-posts" class="mt-5 mb-2 mb-sm-4">
|
||||
<h3 class="pt-2 mt-1 mb-4 ml-1"
|
||||
data-toc-skip>{{ site.data.locales[lang].post.relate_posts }}</h3>
|
||||
<div class="card-deck mb-4">
|
||||
{% for score_item in score_list %}
|
||||
{% assign data = score_item | split: ":" %}
|
||||
{% assign index = data[1] | plus: 0 %}
|
||||
{% for entry in index_list %}
|
||||
{% assign index = entry | plus: 0 %}
|
||||
{% assign post = site.posts[index] %}
|
||||
<div class="card">
|
||||
<a href="{{ post.url | relative_url }}">
|
||||
<div class="card-body">
|
||||
<span class="timeago small">
|
||||
{{ post.date | date: site.data.date_format.post }}
|
||||
<i class="unloaded">{{ post.date | date_to_xmlschema }}</i>
|
||||
</span>
|
||||
{% include timeago.html date=post.date class="small" %}
|
||||
<h3 class="pt-0 mt-1 mb-3" data-toc-skip>{{ post.title }}</h3>
|
||||
<div class="text-muted small">
|
||||
<p>{{ post.content | markdownify | strip_html | truncate: 200 | replace: '&', '&' }}</p>
|
||||
<p>
|
||||
{% include no-linenos.html content=post.content %}
|
||||
{{ content | markdownify | strip_html | truncate: 200 }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% assign count = count | plus: 1 %}
|
||||
{% if count >= MAX_SIZE %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div> <!-- .card-deck -->
|
||||
</div>
|
||||
</div> <!-- #related-posts -->
|
||||
{% endif %}
|
||||
@@ -1,31 +1,46 @@
|
||||
<!--
|
||||
Jekyll Simple Search loader
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
See: <https://github.com/christian-fei/Simple-Jekyll-Search>
|
||||
-->
|
||||
<script src="https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.7.3/dest/simple-jekyll-search.min.js" integrity="sha256-qcLR00zq6pJk4je3MLgAri8Nn+ZumUlXgTKR2H/xCY0=" crossorigin="anonymous"></script>
|
||||
|
||||
{% capture result_elem %}
|
||||
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
|
||||
<a href="{{ site.url }}{url}">{title}</a>
|
||||
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
||||
<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>{categories}</div>
|
||||
<div><i class="fa fa-tag fa-fw"></i>{tags}</div>
|
||||
{categories}
|
||||
{tags}
|
||||
</div>
|
||||
<p>{snippet}</p>
|
||||
</div>
|
||||
{% endcapture %}
|
||||
|
||||
{% capture not_found %}<p class="mt-5">Oops! No result founds.</p>{% endcapture %}
|
||||
{% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js"></script>
|
||||
|
||||
<script>
|
||||
SimpleJekyllSearch({
|
||||
searchInput: document.getElementById('search-input'),
|
||||
resultsContainer: document.getElementById('search-results'),
|
||||
json: '{{ site.baseurl }}/assets/data/search.json',
|
||||
json: '{{ '/assets/js/data/search.json' | relative_url }}',
|
||||
searchResultTemplate: '{{ result_elem | strip_newlines }}',
|
||||
noResultsText: '{{ not_found }}'
|
||||
noResultsText: '{{ not_found }}',
|
||||
templateMiddleware: function(prop, value, template) {
|
||||
if (prop === 'categories') {
|
||||
if (value === '') {
|
||||
return `${value}`;
|
||||
} else {
|
||||
return `<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
if (prop === 'tags') {
|
||||
if (value === '') {
|
||||
return `${value}`;
|
||||
} else {
|
||||
return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,15 +1,18 @@
|
||||
<!--
|
||||
The Search results
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded">
|
||||
<div class="col-12 col-xl-11 post-content">
|
||||
<div class="col-12 col-sm-11 post-content">
|
||||
<div id="search-hints">
|
||||
<h4 class="text-muted">{{ site.data.label.panel.trending_tags }}</h4>
|
||||
<h4 class="text-muted mb-4">{{ site.data.locales[lang].panel.trending_tags }}</h4>
|
||||
|
||||
{% 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 id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
|
||||
</div>
|
||||
|
||||
@@ -1,81 +1,94 @@
|
||||
<!--
|
||||
The Side Bar
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<div id="nav-wrapper">
|
||||
<div id="profile-wrapper" class="d-flex flex-column">
|
||||
<div id="avatar" class="d-flex justify-content-center">
|
||||
<a href="{{ site.baseurl }}/" alt="avatar">
|
||||
{% assign avatar_url = site.avatar %}
|
||||
{% capture start %}{{ site.avatar | slice: 0 }}{% endcapture %}
|
||||
{% if start == '/' %}
|
||||
{% assign avatar_url = avatar_url | prepend: site.baseurl %}
|
||||
<div id="sidebar" class="d-flex flex-column align-items-end" lang="{{lang}}">
|
||||
<div class="profile-wrapper text-center">
|
||||
<div id="avatar">
|
||||
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
|
||||
{% if site.avatar != '' and site.avatar %}
|
||||
{% capture avatar_url %}
|
||||
{%- if site.avatar contains '://' -%}
|
||||
{{ site.avatar }}
|
||||
{%- elsif site.img_cdn != '' and site.img_cdn -%}
|
||||
{{ site.avatar | prepend: site.img_cdn }}
|
||||
{%- else -%}
|
||||
{{ site.avatar | relative_url }}
|
||||
{%- endif -%}
|
||||
{% endcapture %}
|
||||
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
|
||||
{% endif %}
|
||||
<img src="{{ avatar_url }}" alt="avatar">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="profile-text mt-3">
|
||||
<div id="site-title">
|
||||
<a href="{{ site.baseurl }}/">{{- site.title -}}</a>
|
||||
</div>
|
||||
<div id="site-subtitle" class="font-italic">{{- site.tagline -}}</div>
|
||||
</div>
|
||||
<div class="site-title mt-3">
|
||||
<a href="{{ '/' | relative_url }}">{{ site.title }}</a>
|
||||
</div>
|
||||
<div class="site-subtitle font-italic">{{ site.tagline }}</div>
|
||||
|
||||
<ul class="nav flex-column">
|
||||
{% assign page_urls = page.url | split: "/" %}
|
||||
</div><!-- .profile-wrapper -->
|
||||
|
||||
{% for item in site.data.tabs %}
|
||||
{% assign ref = site.baseurl | append: "/" %}
|
||||
<ul class="w-100">
|
||||
|
||||
{% if item.path %}
|
||||
{% assign ref = ref | append: item.path | append: "/" %}
|
||||
{% if item.url %}
|
||||
{% assign ref = ref | append: item.url | append: "/" %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- home -->
|
||||
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
|
||||
<a href="{{ '/' | relative_url }}" class="nav-link">
|
||||
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
|
||||
<span>{{ site.data.locales[lang].tabs.home | upcase }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- the real tabs -->
|
||||
{% for tab in site.tabs %}
|
||||
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
|
||||
<a href="{{ tab.url | relative_url }}" class="nav-link">
|
||||
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
|
||||
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
|
||||
|
||||
<li class="nav-item d-flex justify-content-center
|
||||
{% if item.url == page_urls.last
|
||||
or item.name == page.tab_active
|
||||
or item.name == "Home" and page.layout == "home" %}active{% endif %}">
|
||||
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
|
||||
<i class="fa-fw {{ item.icon }} ml-3 mr-3 unloaded"></i>
|
||||
<span>{{ item.name | upcase }}</span>
|
||||
<span>{{ site.data.locales[lang].tabs.[tab_name] | default: tab.title | upcase }}</span>
|
||||
</a>
|
||||
</li> <!-- .nav-item -->
|
||||
{% endfor %}
|
||||
|
||||
</ul> <!-- ul.nav.flex-column -->
|
||||
|
||||
</div><!-- #nav-wrapper -->
|
||||
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
|
||||
|
||||
<div class="sidebar-bottom d-flex flex-wrap justify-content-around mt-4">
|
||||
{% for entry in site.data.contact %}
|
||||
{% capture url %}
|
||||
{%- if entry.type == 'github' -%}
|
||||
https://github.com/{{ site.github.username }}
|
||||
{%- elsif entry.type == 'twitter' -%}
|
||||
https://twitter.com/{{ site.twitter.username }}
|
||||
{%- elsif entry.type == 'email' -%}
|
||||
{% assign email = site.social.email | split: '@' %}
|
||||
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
|
||||
{%- elsif entry.type == 'rss' -%}
|
||||
{{ "/feed.xml" | relative_url }}
|
||||
{%- else -%}
|
||||
{{ entry.url }}
|
||||
{%- endif -%}
|
||||
{% endcapture %}
|
||||
|
||||
{% if site.theme_mode == "dual" %}
|
||||
<span id="mode-toggle-wrapper">
|
||||
{% include mode-toggle.html %}
|
||||
</span>
|
||||
<span class="icon-border"></span>
|
||||
{% if url %}
|
||||
<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 %}>
|
||||
<i class="{{ entry.icon }}"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<a href="https://github.com/{{ site.github.username }}" target="_blank">
|
||||
<i class="fab fa-github-alt"></i>
|
||||
</a>
|
||||
<a href="https://twitter.com/{{ site.twitter.username }}" target="_blank">
|
||||
<i class="fab fa-twitter"></i>
|
||||
</a>
|
||||
{% assign email = site.social.email | split: '@' %}
|
||||
<a href="javascript:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))">
|
||||
<i class="fas fa-envelope"></i>
|
||||
</a>
|
||||
<a href="{{ site.baseurl }}/feed.xml" target="_blank">
|
||||
<i class="fas fa-rss"></i>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
{% 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 -->
|
||||
|
||||
27
_includes/timeago.html
Normal file
27
_includes/timeago.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!--
|
||||
Date format snippet
|
||||
See: /assets/js/_utils/timeage.js
|
||||
-->
|
||||
|
||||
{% assign tooltip_df = site.data.locales[lang].date_format.tooltip %}
|
||||
{% assign post_long_df = site.data.locales[lang].date_format.post.long %}
|
||||
{% assign post_short_df = site.data.locales[lang].date_format.post.short %}
|
||||
|
||||
{% if include.preposition %}
|
||||
{{ include.preposition }}
|
||||
{% endif %}
|
||||
<span class="timeago {% if include.class %}{{ include.class }}{% endif %}"
|
||||
{% if include.tooltip %}
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
title="{{ include.date | date: tooltip_df }}"
|
||||
{% endif %}>
|
||||
{%- assign this_year = site.time | date: "%Y" -%}
|
||||
{%- assign post_year = include.date | date: "%Y" -%}
|
||||
{%- if post_year == this_year -%}
|
||||
{{ include.date | date: post_short_df }}
|
||||
{%- else -%}
|
||||
{{ include.date | date: post_long_df }}
|
||||
{%- endif -%}
|
||||
<i class="unloaded">{{ include.date | date_to_xmlschema }}</i>
|
||||
</span>
|
||||
@@ -1,50 +1,71 @@
|
||||
<!--
|
||||
The Top Bar
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2017-2019 Cotes Chung
|
||||
MIT License
|
||||
-->
|
||||
|
||||
<div id="topbar-wrapper" class="row justify-content-center topbar-down">
|
||||
<div id="topbar" class="col-11 d-flex h-100 align-items-center justify-content-between">
|
||||
<span id="breadcrumb">
|
||||
{% for item in page.breadcrumb %}
|
||||
{% if item.url %}
|
||||
|
||||
{% assign paths = page.url | split: '/' %}
|
||||
|
||||
{% if paths.size == 0 or page.layout == 'home' %}
|
||||
<!-- index page -->
|
||||
<span>{{ site.data.locales[lang].tabs.home | capitalize }}</span>
|
||||
|
||||
{% else %}
|
||||
|
||||
{% for item in paths %}
|
||||
|
||||
{% if forloop.first %}
|
||||
<span>
|
||||
<a href="{{ site.baseurl }}{{ item.url | remove: '.html'}}">
|
||||
{{ item.label }}
|
||||
<a href="{{ '/' | relative_url }}">
|
||||
{{ site.data.locales[lang].tabs.home | capitalize }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
{% elsif forloop.last %}
|
||||
|
||||
{% if page.collection == 'tabs' %}
|
||||
<span>{{ site.data.locales[lang].tabs[item] | default: page.title }}</span>
|
||||
{% else %}
|
||||
<span>{{ item.label }}</span>
|
||||
<span>{{ page.title }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
||||
<span>
|
||||
<a href="{{ item | relative_url }}">
|
||||
{{ site.data.locales[lang].tabs[item] | default: page.title }}
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% unless page.layout == "home" %}
|
||||
<span>{{ page.title }}</span>
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
|
||||
</span><!-- endof #breadcrumb -->
|
||||
|
||||
<i id="sidebar-trigger" class="fas fa-bars fa-fw"></i>
|
||||
|
||||
<div id="topbar-title">
|
||||
{% if page.location %}
|
||||
{{- page.location -}}
|
||||
{% elsif page.layout == "home" %}
|
||||
{{- site.title -}}
|
||||
{% if page.layout == 'home' %}
|
||||
{{- site.data.locales[lang].title | default: site.title -}}
|
||||
{% elsif page.collection == 'tabs' %}
|
||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
||||
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
||||
{% else %}
|
||||
{{- page.title -}}
|
||||
{{- site.data.locales[lang].layout[page.layout] | default: page.layout | capitalize -}}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<i id="search-trigger" class="fas fa-search fa-fw"></i>
|
||||
<span id="search-wrapper" class="align-items-center">
|
||||
<i class="fas fa-search fa-fw"></i>
|
||||
<input class="form-control" id="search-input" type="search" placeholder="{{ site.data.label.search_hint }}...">
|
||||
<input class="form-control" id="search-input" type="search"
|
||||
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[lang].search.hint | capitalize }}...">
|
||||
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
|
||||
</span>
|
||||
<span id="search-cancel" >Cancel</span>
|
||||
<span id="search-cancel" >{{ site.data.locales[lang].search.cancel }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -1,27 +1,36 @@
|
||||
<!--
|
||||
{% comment %}
|
||||
The trending tags list
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
MIT Licensed
|
||||
-->
|
||||
{% endcomment %}
|
||||
|
||||
{% assign MAX = 10 %}
|
||||
|
||||
{% capture tags_array %}
|
||||
{% for tag in site.tags %}
|
||||
{{ tag[1] | size }}:{{ tag[0] | replace: ' ', '-' }}
|
||||
{% endfor %}
|
||||
{% endcapture %}
|
||||
{% assign size_list = "" | split: "" %}
|
||||
{% assign tag_list = "" | split: "" %}
|
||||
|
||||
{% assign trends = tags_array | split: " " | sort | reverse %}
|
||||
{% assign count = 0 %}
|
||||
{% for tag in site.tags %}
|
||||
{% assign size = tag | last | size %}
|
||||
{% assign size_list = size_list | push: size %}
|
||||
|
||||
{% for trend in trends %}
|
||||
{% assign count = count | plus: 1 %}
|
||||
{% assign tag = trend | split: ":" | last %}
|
||||
<a class="post-tag" href="{{ site.baseurl }}/tags/{{ tag | downcase }}/">{{ tag | replace: '-', ' ' }}</a>
|
||||
{% if count >= MAX %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% assign tag_str = tag | first | append: "::" | append: size %}
|
||||
{% assign tag_list = tag_list | push: tag_str %}
|
||||
{% endfor %}
|
||||
|
||||
{% assign size_list = size_list | sort | reverse %}
|
||||
|
||||
{% assign tag_list = tag_list | sort_natural %}
|
||||
|
||||
{% assign trending_tags = "" | split: "" %}
|
||||
|
||||
{% for size in size_list limit: MAX %}
|
||||
{% for tag_str in tag_list %}
|
||||
{% assign tag = tag_str | split: "::" %}
|
||||
{% assign tag_name = tag | first %}
|
||||
{% assign tag_size = tag | last | plus: 0 %}
|
||||
{% if tag_size == size %}
|
||||
{% unless trending_tags contains tag_name %}
|
||||
{% assign trending_tags = trending_tags | push: tag_name %}
|
||||
{% break %}
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
24
_includes/update-list.html
Normal file
24
_includes/update-list.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% comment %}
|
||||
Get the last 5 posts from lastmod list.
|
||||
{% endcomment %}
|
||||
|
||||
{% assign MAX_SIZE = 5 %}
|
||||
|
||||
{% assign all_list = "" | split: "" %}
|
||||
|
||||
{% for post in site.posts %}
|
||||
{% if post.last_modified_at %}
|
||||
{% capture elem %}
|
||||
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
||||
{% endcapture %}
|
||||
{% assign all_list = all_list | push: elem %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% assign all_list = all_list | sort | reverse %}
|
||||
|
||||
{% assign update_list = "" | split: "" %}
|
||||
|
||||
{% for entry in all_list limit:MAX_SIZE %}
|
||||
{% assign update_list = update_list | push: entry %}
|
||||
{% endfor %}
|
||||
20
_javascript/commons/back-to-top.js
Normal file
20
_javascript/commons/back-to-top.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
|
||||
*/
|
||||
$(function() {
|
||||
$(window).scroll(() => {
|
||||
if ($(this).scrollTop() > 50 &&
|
||||
$("#sidebar-trigger").css("display") === "none") {
|
||||
$("#back-to-top").fadeIn();
|
||||
} else {
|
||||
$("#back-to-top").fadeOut();
|
||||
}
|
||||
});
|
||||
|
||||
$("#back-to-top").click(() => {
|
||||
$("body,html").animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
153
_javascript/commons/search-display.js
Normal file
153
_javascript/commons/search-display.js
Normal file
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* This script make #search-result-wrapper switch to unloaded or shown automatically.
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
const btnSbTrigger = $("#sidebar-trigger");
|
||||
const btnSearchTrigger = $("#search-trigger");
|
||||
const btnCancel = $("#search-cancel");
|
||||
const btnClear = $("#search-cleaner");
|
||||
|
||||
const main = $("#main");
|
||||
const topbarTitle = $("#topbar-title");
|
||||
const searchWrapper = $("#search-wrapper");
|
||||
const resultWrapper = $("#search-result-wrapper");
|
||||
const results = $("#search-results");
|
||||
const input = $("#search-input");
|
||||
const hints = $("#search-hints");
|
||||
|
||||
const scrollBlocker = (function () {
|
||||
let offset = 0;
|
||||
return {
|
||||
block() {
|
||||
offset = window.scrollY;
|
||||
$("html,body").scrollTop(0);
|
||||
},
|
||||
release() {
|
||||
$("html,body").scrollTop(offset);
|
||||
},
|
||||
getOffset() {
|
||||
return offset;
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
|
||||
/*--- Actions in small screens (Sidebar unloaded) ---*/
|
||||
|
||||
const mobileSearchBar = (function () {
|
||||
return {
|
||||
on() {
|
||||
btnSbTrigger.addClass("unloaded");
|
||||
topbarTitle.addClass("unloaded");
|
||||
btnSearchTrigger.addClass("unloaded");
|
||||
searchWrapper.addClass("d-flex");
|
||||
btnCancel.addClass("loaded");
|
||||
},
|
||||
off() {
|
||||
btnCancel.removeClass("loaded");
|
||||
searchWrapper.removeClass("d-flex");
|
||||
btnSbTrigger.removeClass("unloaded");
|
||||
topbarTitle.removeClass("unloaded");
|
||||
btnSearchTrigger.removeClass("unloaded");
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
const resultSwitch = (function () {
|
||||
let visible = false;
|
||||
|
||||
return {
|
||||
on() {
|
||||
if (!visible) {
|
||||
// the block method must be called before $(#main) unloaded.
|
||||
scrollBlocker.block();
|
||||
resultWrapper.removeClass("unloaded");
|
||||
main.addClass("unloaded");
|
||||
visible = true;
|
||||
}
|
||||
},
|
||||
off() {
|
||||
if (visible) {
|
||||
results.empty();
|
||||
if (hints.hasClass("unloaded")) {
|
||||
hints.removeClass("unloaded");
|
||||
}
|
||||
resultWrapper.addClass("unloaded");
|
||||
btnClear.removeClass("visible");
|
||||
main.removeClass("unloaded");
|
||||
|
||||
// now the release method must be called after $(#main) display
|
||||
scrollBlocker.release();
|
||||
|
||||
input.val("");
|
||||
visible = false;
|
||||
}
|
||||
},
|
||||
isVisible() {
|
||||
return visible;
|
||||
}
|
||||
};
|
||||
|
||||
}());
|
||||
|
||||
|
||||
function isMobileView() {
|
||||
return btnCancel.hasClass("loaded");
|
||||
}
|
||||
|
||||
btnSearchTrigger.click(function() {
|
||||
mobileSearchBar.on();
|
||||
resultSwitch.on();
|
||||
input.focus();
|
||||
});
|
||||
|
||||
btnCancel.click(function() {
|
||||
mobileSearchBar.off();
|
||||
resultSwitch.off();
|
||||
});
|
||||
|
||||
input.focus(function() {
|
||||
searchWrapper.addClass("input-focus");
|
||||
});
|
||||
|
||||
input.focusout(function() {
|
||||
searchWrapper.removeClass("input-focus");
|
||||
});
|
||||
|
||||
input.on("keyup", function(e) {
|
||||
if (e.keyCode === 8 && input.val() === "") {
|
||||
if (!isMobileView()) {
|
||||
resultSwitch.off();
|
||||
} else {
|
||||
hints.removeClass("unloaded");
|
||||
}
|
||||
} else {
|
||||
if (input.val() !== "") {
|
||||
resultSwitch.on();
|
||||
|
||||
if (!btnClear.hasClass("visible")) {
|
||||
btnClear.addClass("visible");
|
||||
}
|
||||
|
||||
if (isMobileView()) {
|
||||
hints.addClass("unloaded");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
btnClear.on("click", function() {
|
||||
input.val("");
|
||||
if (isMobileView()) {
|
||||
hints.removeClass("unloaded");
|
||||
results.empty();
|
||||
} else {
|
||||
resultSwitch.off();
|
||||
}
|
||||
input.focus();
|
||||
btnClear.removeClass("visible");
|
||||
});
|
||||
|
||||
});
|
||||
30
_javascript/commons/sidebar.js
Normal file
30
_javascript/commons/sidebar.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Expand or close the sidebar in mobile screens.
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
const sidebarUtil = (function () {
|
||||
const ATTR_DISPLAY = "sidebar-display";
|
||||
let isExpanded = false;
|
||||
const body = $("body");
|
||||
|
||||
return {
|
||||
toggle() {
|
||||
if (isExpanded === false) {
|
||||
body.attr(ATTR_DISPLAY, "");
|
||||
} else {
|
||||
body.removeAttr(ATTR_DISPLAY);
|
||||
}
|
||||
|
||||
isExpanded = !isExpanded;
|
||||
}
|
||||
};
|
||||
|
||||
}());
|
||||
|
||||
$("#sidebar-trigger").click(sidebarUtil.toggle);
|
||||
|
||||
$("#mask").click(sidebarUtil.toggle);
|
||||
|
||||
});
|
||||
6
_javascript/commons/tooltip-loader.js
Normal file
6
_javascript/commons/tooltip-loader.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Initial Bootstrap Tooltip.
|
||||
*/
|
||||
$(function () {
|
||||
$("[data-toggle=\"tooltip\"]").tooltip();
|
||||
});
|
||||
69
_javascript/commons/topbar-switch.js
Normal file
69
_javascript/commons/topbar-switch.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Hide Header on scroll down
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
const topbarWrapper = $("#topbar-wrapper");
|
||||
const toc = $("#toc-wrapper");
|
||||
const access = $(".access");
|
||||
const searchInput = $("#search-input");
|
||||
|
||||
let didScroll;
|
||||
let lastScrollTop = 0;
|
||||
|
||||
const delta = 5;
|
||||
const topbarHeight = topbarWrapper.outerHeight();
|
||||
|
||||
function hasScrolled() {
|
||||
var st = $(this).scrollTop();
|
||||
|
||||
/* Make sure they scroll more than delta */
|
||||
if (Math.abs(lastScrollTop - st) <= delta) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (st > lastScrollTop && st > topbarHeight) {
|
||||
/* Scroll Down */
|
||||
topbarWrapper.removeClass("topbar-down").addClass("topbar-up");
|
||||
|
||||
if (toc.length > 0) {
|
||||
toc.removeClass("topbar-down");
|
||||
}
|
||||
|
||||
if (access.length > 0) {
|
||||
access.removeClass("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");
|
||||
}
|
||||
}
|
||||
|
||||
lastScrollTop = st;
|
||||
}
|
||||
|
||||
$(window).scroll(function(event) {
|
||||
if ($("#topbar-title").is(":hidden")) { /* Not in small screens */
|
||||
didScroll = true;
|
||||
}
|
||||
});
|
||||
|
||||
setInterval(function() {
|
||||
if (didScroll) {
|
||||
hasScrolled();
|
||||
didScroll = false;
|
||||
}
|
||||
}, 250);
|
||||
|
||||
});
|
||||
47
_javascript/commons/topbar-title.js
Normal file
47
_javascript/commons/topbar-title.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Top bar title auto change while scrolling in mobile screens.
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
const topbarTitle = $("#topbar-title");
|
||||
const postTitle = $("div.post>h1");
|
||||
|
||||
const DEFAULT = topbarTitle.text().trim();
|
||||
|
||||
let title = (postTitle.length > 0) ?
|
||||
postTitle.text().trim() : $("h1").text().trim();
|
||||
|
||||
if ($("#page-category").length || $("#page-tag").length) {
|
||||
/* The title in Category or Tag page will be "<title> <count_of_posts>" */
|
||||
if (/\s/.test(title)) {
|
||||
title = title.replace(/[0-9]/g, "").trim();
|
||||
}
|
||||
}
|
||||
|
||||
/* Replace topbar title while scroll screens. */
|
||||
$(window).scroll(function () {
|
||||
if ($("#post-list").length /* in Home page */
|
||||
|| postTitle.is(":hidden") /* is tab pages */
|
||||
|| topbarTitle.is(":hidden") /* not mobile screens */
|
||||
|| $("#sidebar.sidebar-expand").length) { /* when the sidebar trigger is clicked */
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($(this).scrollTop() >= 95) {
|
||||
if (topbarTitle.text() !== title) {
|
||||
topbarTitle.text(title);
|
||||
}
|
||||
} else {
|
||||
if (topbarTitle.text() !== DEFAULT) {
|
||||
topbarTitle.text(DEFAULT);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/* Click title remove hover effect. */
|
||||
topbarTitle.click(function() {
|
||||
$("body,html").animate({scrollTop: 0}, 800);
|
||||
});
|
||||
|
||||
});
|
||||
5
_javascript/copyright
Normal file
5
_javascript/copyright
Normal file
@@ -0,0 +1,5 @@
|
||||
/*!
|
||||
* Chirpy v4.3.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
|
||||
* © 2019 Cotes Chung
|
||||
* MIT Licensed
|
||||
*/
|
||||
30
_javascript/utils/category-collapse.js
Normal file
30
_javascript/utils/category-collapse.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Tab 'Categories' expand/close effect.
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
const childPrefix = "l_";
|
||||
const parentPrefix = "h_";
|
||||
const collapse = $(".collapse");
|
||||
|
||||
/* close up top-category */
|
||||
collapse.on("hide.bs.collapse", function () { /* Bootstrap collapse events. */
|
||||
const parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
||||
if (parentId) {
|
||||
$(`#${parentId} .far.fa-folder-open`).attr("class", "far fa-folder fa-fw");
|
||||
$(`#${parentId} i.fas`).addClass("rotate");
|
||||
$(`#${parentId}`).removeClass("hide-border-bottom");
|
||||
}
|
||||
});
|
||||
|
||||
/* expand the top category */
|
||||
collapse.on("show.bs.collapse", function() {
|
||||
const parentId = parentPrefix + $(this).attr("id").substring(childPrefix.length);
|
||||
if (parentId) {
|
||||
$(`#${parentId} .far.fa-folder`).attr("class", "far fa-folder-open fa-fw");
|
||||
$(`#${parentId} i.fas`).removeClass("rotate");
|
||||
$(`#${parentId}`).addClass("hide-border-bottom");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
12
_javascript/utils/checkbox.js
Normal file
12
_javascript/utils/checkbox.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Create a more beautiful checkbox
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
/* hide browser default checkbox */
|
||||
$("input[type=checkbox]").addClass("unloaded");
|
||||
/* create checked checkbox */
|
||||
$("input[type=checkbox][checked]").before("<i class=\"fas fa-check-circle checked\"></i>");
|
||||
/* create normal checkbox */
|
||||
$("input[type=checkbox]:not([checked])").before("<i class=\"far fa-circle\"></i>");
|
||||
});
|
||||
131
_javascript/utils/clipboard.js
Normal file
131
_javascript/utils/clipboard.js
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Clipboard functions
|
||||
*
|
||||
* Dependencies:
|
||||
* - popper.js (https://github.com/popperjs/popper-core)
|
||||
* - clipboard.js (https://github.com/zenorocha/clipboard.js)
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
const btnSelector = '.code-header>button';
|
||||
const ICON_SUCCESS = 'fas fa-check';
|
||||
const ATTR_TIMEOUT = 'timeout';
|
||||
const TIMEOUT = 2000; // in milliseconds
|
||||
|
||||
function isLocked(node) {
|
||||
if ($(node)[0].hasAttribute(ATTR_TIMEOUT)) {
|
||||
let timeout = $(node).attr(ATTR_TIMEOUT);
|
||||
if (Number(timeout) > Date.now()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function lock(node) {
|
||||
$(node).attr(ATTR_TIMEOUT, Date.now() + TIMEOUT);
|
||||
}
|
||||
|
||||
function unlock(node) {
|
||||
$(node).removeAttr(ATTR_TIMEOUT);
|
||||
}
|
||||
|
||||
/* --- Copy code block --- */
|
||||
|
||||
// Initial the clipboard.js object
|
||||
const clipboard = new ClipboardJS(btnSelector, {
|
||||
target(trigger) {
|
||||
let codeBlock = trigger.parentNode.nextElementSibling;
|
||||
return codeBlock.querySelector('code .rouge-code');
|
||||
}
|
||||
});
|
||||
|
||||
$(btnSelector).tooltip({
|
||||
trigger: 'hover',
|
||||
placement: 'left'
|
||||
});
|
||||
|
||||
function getIcon(btn) {
|
||||
let iconNode = $(btn).children();
|
||||
return iconNode.attr('class');
|
||||
}
|
||||
|
||||
const ICON_DEFAULT = getIcon(btnSelector);
|
||||
|
||||
function showTooltip(btn) {
|
||||
const succeedTitle = $(btn).attr('title-succeed');
|
||||
$(btn).attr('data-original-title', succeedTitle).tooltip('show');
|
||||
}
|
||||
|
||||
function hideTooltip(btn) {
|
||||
$(btn).tooltip('hide').removeAttr('data-original-title');
|
||||
}
|
||||
|
||||
function setSuccessIcon(btn) {
|
||||
let btnNode = $(btn);
|
||||
let iconNode = btnNode.children();
|
||||
iconNode.attr('class', ICON_SUCCESS);
|
||||
}
|
||||
|
||||
function resumeIcon(btn) {
|
||||
let btnNode = $(btn);
|
||||
let iconNode = btnNode.children();
|
||||
iconNode.attr('class', ICON_DEFAULT);
|
||||
}
|
||||
|
||||
clipboard.on('success', (e) => {
|
||||
e.clearSelection();
|
||||
|
||||
const trigger = e.trigger;
|
||||
if (isLocked(trigger)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setSuccessIcon(trigger);
|
||||
showTooltip(trigger);
|
||||
lock(trigger);
|
||||
|
||||
setTimeout(() => {
|
||||
hideTooltip(trigger);
|
||||
resumeIcon(trigger);
|
||||
unlock(trigger);
|
||||
}, TIMEOUT);
|
||||
|
||||
});
|
||||
|
||||
/* --- Post link sharing --- */
|
||||
|
||||
$('#copy-link').click((e) => {
|
||||
|
||||
let target = $(e.target);
|
||||
|
||||
if (isLocked(target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy URL to clipboard
|
||||
|
||||
const url = window.location.href;
|
||||
const $temp = $("<input>");
|
||||
|
||||
$("body").append($temp);
|
||||
$temp.val(url).select();
|
||||
document.execCommand("copy");
|
||||
$temp.remove();
|
||||
|
||||
// Switch tooltip title
|
||||
|
||||
const defaultTitle = target.attr('data-original-title');
|
||||
const succeedTitle = target.attr('title-succeed');
|
||||
|
||||
target.attr('data-original-title', succeedTitle).tooltip('show');
|
||||
lock(target);
|
||||
|
||||
setTimeout(() => {
|
||||
target.attr('data-original-title', defaultTitle);
|
||||
unlock(target);
|
||||
}, TIMEOUT);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
47
_javascript/utils/img-extra.js
Normal file
47
_javascript/utils/img-extra.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
Lazy load images (https://github.com/ApoorvSaxena/lozad.js)
|
||||
and popup when clicked (https://github.com/dimsemenov/Magnific-Popup)
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
const IMG_SCOPE = '#main > div.row:first-child > div:first-child';
|
||||
|
||||
if ($(`${IMG_SCOPE} img`).length <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* lazy loading */
|
||||
|
||||
const imgList = document.querySelectorAll(`${IMG_SCOPE} img[data-src]`);
|
||||
const observer = lozad(imgList);
|
||||
observer.observe();
|
||||
|
||||
/* popup */
|
||||
|
||||
$(`${IMG_SCOPE} p > img[data-src],${IMG_SCOPE} img[data-src].preview-img`).each(
|
||||
function() {
|
||||
let nextTag = $(this).next();
|
||||
const title = nextTag.prop('tagName') === 'EM' ? nextTag.text() : '';
|
||||
const src = $(this).attr('data-src'); // created by lozad.js
|
||||
|
||||
$(this).wrap(`<a href="${src}" title="${title}" class="popup"></a>`);
|
||||
}
|
||||
);
|
||||
|
||||
$('.popup').magnificPopup({
|
||||
type: 'image',
|
||||
closeOnContentClick: true,
|
||||
showCloseBtn: false,
|
||||
zoom: {
|
||||
enabled: true,
|
||||
duration: 300,
|
||||
easing: 'ease-in-out'
|
||||
}
|
||||
});
|
||||
|
||||
/* markup the image links */
|
||||
|
||||
$(`${IMG_SCOPE} a`).has('img').addClass('img-link');
|
||||
|
||||
});
|
||||
250
_javascript/utils/pageviews.js
Normal file
250
_javascript/utils/pageviews.js
Normal file
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
* Count page views form GA or local cache file.
|
||||
*
|
||||
* Dependencies:
|
||||
* - jQuery
|
||||
* - countUp.js <https://github.com/inorganik/countUp.js>
|
||||
*/
|
||||
|
||||
const getInitStatus = (function () {
|
||||
let hasInit = false;
|
||||
return () => {
|
||||
let ret = hasInit;
|
||||
if (!hasInit) {
|
||||
hasInit = true;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
}());
|
||||
|
||||
const PvOpts = (function () {
|
||||
function getContent(selector) {
|
||||
return $(selector).attr("content");
|
||||
}
|
||||
|
||||
function hasContent(selector) {
|
||||
let content = getContent(selector);
|
||||
return (typeof content !== "undefined" && content !== false);
|
||||
}
|
||||
|
||||
return {
|
||||
getProxyMeta() {
|
||||
return getContent("meta[name=pv-proxy-endpoint]");
|
||||
},
|
||||
getLocalMeta() {
|
||||
return getContent("meta[name=pv-cache-path]");
|
||||
},
|
||||
hasProxyMeta() {
|
||||
return hasContent("meta[name=pv-proxy-endpoint]");
|
||||
},
|
||||
hasLocalMeta() {
|
||||
return hasContent("meta[name=pv-cache-path]");
|
||||
}
|
||||
};
|
||||
|
||||
}());
|
||||
|
||||
const PvStorage = (function () {
|
||||
const Keys = {
|
||||
KEY_PV: "pv",
|
||||
KEY_PV_SRC: "pv_src",
|
||||
KEY_CREATION: "pv_created_date"
|
||||
};
|
||||
|
||||
const Source = {
|
||||
LOCAL: "same-origin",
|
||||
PROXY: "cors"
|
||||
};
|
||||
|
||||
function get(key) {
|
||||
return localStorage.getItem(key);
|
||||
}
|
||||
|
||||
function set(key, val) {
|
||||
localStorage.setItem(key, val);
|
||||
}
|
||||
|
||||
function saveCache(pv, src) {
|
||||
set(Keys.KEY_PV, pv);
|
||||
set(Keys.KEY_PV_SRC, src);
|
||||
set(Keys.KEY_CREATION, new Date().toJSON());
|
||||
}
|
||||
|
||||
return {
|
||||
keysCount() {
|
||||
return Object.keys(Keys).length;
|
||||
},
|
||||
hasCache() {
|
||||
return (localStorage.getItem(Keys.KEY_PV) !== null);
|
||||
},
|
||||
getCache() {
|
||||
return JSON.parse(localStorage.getItem(Keys.KEY_PV));
|
||||
},
|
||||
saveLocalCache(pv) {
|
||||
saveCache(pv, Source.LOCAL);
|
||||
},
|
||||
saveProxyCache(pv) {
|
||||
saveCache(pv, Source.PROXY);
|
||||
},
|
||||
isExpired() {
|
||||
let date = new Date(get(Keys.KEY_CREATION));
|
||||
date.setHours(date.getHours() + 1); // per hour
|
||||
return Date.now() >= date.getTime();
|
||||
},
|
||||
isFromLocal() {
|
||||
return get(Keys.KEY_PV_SRC) === Source.LOCAL;
|
||||
},
|
||||
isFromProxy() {
|
||||
return get(Keys.KEY_PV_SRC) === Source.PROXY;
|
||||
},
|
||||
newerThan(pv) {
|
||||
return PvStorage.getCache().totalsForAllResults["ga:pageviews"] > pv.totalsForAllResults["ga:pageviews"];
|
||||
},
|
||||
inspectKeys() {
|
||||
if (localStorage.length !== PvStorage.keysCount()) {
|
||||
localStorage.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
for(let i = 0; i < localStorage.length; i++){
|
||||
const key = localStorage.key(i);
|
||||
switch (key) {
|
||||
case Keys.KEY_PV:
|
||||
case Keys.KEY_PV_SRC:
|
||||
case Keys.KEY_CREATION:
|
||||
break;
|
||||
default:
|
||||
localStorage.clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}()); /* PvStorage */
|
||||
|
||||
function countUp(min, max, destId) {
|
||||
if (min < max) {
|
||||
let numAnim = new CountUp(destId, min, max);
|
||||
if (!numAnim.error) {
|
||||
numAnim.start();
|
||||
} else {
|
||||
console.error(numAnim.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function countPV(path, rows) {
|
||||
let count = 0;
|
||||
|
||||
if (typeof rows !== "undefined" ) {
|
||||
for (let i = 0; i < rows.length; ++i) {
|
||||
const gaPath = rows[parseInt(i, 10)][0];
|
||||
if (gaPath === path) { /* path format see: site.permalink */
|
||||
count += parseInt(rows[parseInt(i, 10)][1], 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
function tacklePV(rows, path, elem, hasInit) {
|
||||
let count = countPV(path, rows);
|
||||
count = (count === 0 ? 1 : count);
|
||||
|
||||
if (!hasInit) {
|
||||
elem.text(new Intl.NumberFormat().format(count));
|
||||
} else {
|
||||
const initCount = parseInt(elem.text().replace(/,/g, ""), 10);
|
||||
if (count > initCount) {
|
||||
countUp(initCount, count, elem.attr("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function displayPageviews(data) {
|
||||
if (typeof data === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
let hasInit = getInitStatus();
|
||||
const rows = data.rows; /* could be undefined */
|
||||
|
||||
if ($("#post-list").length > 0) { /* the Home page */
|
||||
$(".post-preview").each(function() {
|
||||
const path = $(this).find("a").attr("href");
|
||||
tacklePV(rows, path, $(this).find(".pageviews"), hasInit);
|
||||
});
|
||||
|
||||
} else if ($(".post").length > 0) { /* the post */
|
||||
const path = window.location.pathname;
|
||||
tacklePV(rows, path, $("#pv"), hasInit);
|
||||
}
|
||||
}
|
||||
|
||||
function fetchProxyPageviews() {
|
||||
if (PvOpts.hasProxyMeta()) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: PvOpts.getProxyMeta(),
|
||||
dataType: "jsonp",
|
||||
jsonpCallback: "displayPageviews",
|
||||
success: (data) => {
|
||||
PvStorage.saveProxyCache(JSON.stringify(data));
|
||||
},
|
||||
error: (jqXHR, textStatus, errorThrown) => {
|
||||
console.log("Failed to load pageviews from proxy server: " + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function fetchLocalPageviews(hasCache = false) {
|
||||
return fetch(PvOpts.getLocalMeta())
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (hasCache) {
|
||||
// The cache from the proxy will sometimes be more recent than the local one
|
||||
if (PvStorage.isFromProxy() && PvStorage.newerThan(data)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
displayPageviews(data);
|
||||
PvStorage.saveLocalCache(JSON.stringify(data));
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
if ($(".pageviews").length <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
PvStorage.inspectKeys();
|
||||
|
||||
if (PvStorage.hasCache()) {
|
||||
displayPageviews(PvStorage.getCache());
|
||||
|
||||
if (PvStorage.isExpired()) {
|
||||
if (PvOpts.hasLocalMeta()) {
|
||||
fetchLocalPageviews(true).then(fetchProxyPageviews);
|
||||
} else {
|
||||
fetchProxyPageviews();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (PvStorage.isFromLocal()) {
|
||||
fetchProxyPageviews();
|
||||
}
|
||||
}
|
||||
|
||||
} else { // no cached
|
||||
|
||||
if (PvOpts.hasLocalMeta()) {
|
||||
fetchLocalPageviews().then(fetchProxyPageviews);
|
||||
} else {
|
||||
fetchProxyPageviews();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
81
_javascript/utils/smooth-scroll.js
Normal file
81
_javascript/utils/smooth-scroll.js
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
Safari doesn't support CSS `scroll-behavior: smooth`,
|
||||
so here is a compatible solution for all browser to smooth scrolling
|
||||
|
||||
See: <https://css-tricks.com/snippets/jquery/smooth-scrolling/>
|
||||
|
||||
Warning: It must be called after all `<a>` tags (e.g., the dynamic TOC) are ready.
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
$("a[href*='#']")
|
||||
.not("[href='#']")
|
||||
.not("[href='#0']")
|
||||
.click(function(event) {
|
||||
|
||||
if (this.pathname.replace(/^\//, "") === location.pathname.replace(/^\//, "")) {
|
||||
if (location.hostname === this.hostname) {
|
||||
|
||||
const REM = 16; /* 16px */
|
||||
|
||||
const hash = decodeURI(this.hash);
|
||||
let isFnRef = RegExp(/^#fnref:/).test(hash);
|
||||
let isFn = RegExp(/^#fn:/).test(hash);
|
||||
let selector = hash.includes(":") ? hash.replace(/\:/, "\\:") : hash;
|
||||
let target = $(selector);
|
||||
|
||||
if (target.length) {
|
||||
event.preventDefault();
|
||||
|
||||
if (history.pushState) { /* add hash to URL */
|
||||
history.pushState(null, null, hash);
|
||||
}
|
||||
|
||||
let curOffset = $(this).offset().top;
|
||||
let destOffset = target.offset().top;
|
||||
const scrollUp = (destOffset < curOffset);
|
||||
const topbarHeight = $("#topbar-wrapper").outerHeight();
|
||||
|
||||
if (scrollUp && isFnRef) {
|
||||
/* Avoid the top-bar covering `fnref` when scrolling up
|
||||
because `fnref` has no `%anchor`(see: module.scss) style. */
|
||||
destOffset -= (topbarHeight + REM / 2);
|
||||
}
|
||||
|
||||
$("html,body").animate({
|
||||
scrollTop: destOffset
|
||||
}, 800, () => {
|
||||
|
||||
const $target = $(target);
|
||||
$target.focus();
|
||||
|
||||
const SCROLL_MARK = "scroll-focus";
|
||||
|
||||
/* clean up old scroll mark */
|
||||
if ($(`[${SCROLL_MARK}=true]`).length) {
|
||||
$(`[${SCROLL_MARK}=true]`).attr(SCROLL_MARK, false);
|
||||
}
|
||||
|
||||
/* Clean :target links */
|
||||
if ($(":target").length) { /* element that visited by the URL with hash */
|
||||
$(":target").attr(SCROLL_MARK, false);
|
||||
}
|
||||
|
||||
/* set scroll mark to footnotes */
|
||||
if (isFn || isFnRef) {
|
||||
$target.attr(SCROLL_MARK, true);
|
||||
}
|
||||
|
||||
if ($target.is(":focus")) { /* Checking if the target was focused */
|
||||
return false;
|
||||
} else {
|
||||
$target.attr("tabindex", "-1"); /* Adding tabindex for elements not focusable */
|
||||
$target.focus(); /* Set focus again */
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}); /* click() */
|
||||
});
|
||||
73
_javascript/utils/timeago.js
Normal file
73
_javascript/utils/timeago.js
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Calculate the Timeago
|
||||
*/
|
||||
|
||||
$(function() {
|
||||
|
||||
const timeagoElem = $(".timeago");
|
||||
|
||||
let toRefresh = timeagoElem.length;
|
||||
|
||||
let intervalId = void 0;
|
||||
|
||||
const dPrompt = $("meta[name=day-prompt]").attr("content");
|
||||
const hrPrompt = $("meta[name=hour-prompt]").attr("content");
|
||||
const minPrompt = $("meta[name=minute-prompt]").attr("content");
|
||||
const justnowPrompt = $("meta[name=justnow-prompt]").attr("content");
|
||||
|
||||
function timeago(isoDate, dateStr) {
|
||||
let now = new Date();
|
||||
let past = new Date(isoDate);
|
||||
|
||||
if (past.getFullYear() !== now.getFullYear()
|
||||
|| past.getMonth() !== now.getMonth()) {
|
||||
return dateStr;
|
||||
}
|
||||
|
||||
let seconds = Math.floor((now - past) / 1000);
|
||||
|
||||
let day = Math.floor(seconds / 86400);
|
||||
if (day >= 1) {
|
||||
toRefresh -= 1;
|
||||
return ` ${day} ${dPrompt}`;
|
||||
}
|
||||
|
||||
let hour = Math.floor(seconds / 3600);
|
||||
if (hour >= 1) {
|
||||
return ` ${hour} ${hrPrompt}`;
|
||||
}
|
||||
|
||||
let minute = Math.floor(seconds / 60);
|
||||
if (minute >= 1) {
|
||||
return ` ${minute} ${minPrompt}`;
|
||||
}
|
||||
|
||||
return justnowPrompt;
|
||||
}
|
||||
|
||||
function updateTimeago() {
|
||||
$(".timeago").each(function() {
|
||||
if ($(this).children("i").length > 0) {
|
||||
let dateStr = $(this).clone().children().remove().end().text();
|
||||
let node = $(this).children("i");
|
||||
let iosDate = node.text(); /* ISO Date: "YYYY-MM-DDTHH:MM:SSZ" */
|
||||
$(this).text(timeago(iosDate, dateStr));
|
||||
$(this).append(node);
|
||||
}
|
||||
});
|
||||
|
||||
if (toRefresh === 0 && typeof intervalId !== "undefined") {
|
||||
clearInterval(intervalId); /* stop interval */
|
||||
}
|
||||
return toRefresh;
|
||||
}
|
||||
|
||||
if (toRefresh === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (updateTimeago() > 0) { /* run immediately */
|
||||
intervalId = setInterval(updateTimeago, 60000); /* run every minute */
|
||||
}
|
||||
|
||||
});
|
||||
@@ -1,14 +1,12 @@
|
||||
---
|
||||
title: Archives
|
||||
|
||||
layout: page
|
||||
# The Archives of posts.
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT License
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
<div id="archives" class="pl-xl-2">
|
||||
|
||||
{% for post in site.posts %}
|
||||
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
|
||||
{% capture pre_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
|
||||
@@ -21,10 +19,11 @@ title: Archives
|
||||
<li>
|
||||
<div>
|
||||
{% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %}
|
||||
{% capture this_month %}{{ post.date | date: "%b" }}{% endcapture %}
|
||||
{% capture _mth_df %}{{ site.data.locales[lang].date_format.post.archive_month }}{% endcapture %}
|
||||
{% capture this_month %}{{ post.date | date: _mth_df }}{% endcapture %}
|
||||
<span class="date day">{{ this_day }}</span>
|
||||
<span class="date month small text-muted">{{ this_month }}</span>
|
||||
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
|
||||
<span class="date month small text-muted">{% include no-zero-date.html date_str=this_month %}</span>
|
||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{% if forloop.last %}
|
||||
99
_layouts/categories.html
Normal file
99
_layouts/categories.html
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
layout: page
|
||||
# All the Categories of posts
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
{% assign HEAD_PREFIX = "h_" %}
|
||||
{% assign LIST_PREFIX = "l_" %}
|
||||
|
||||
{% assign group_index = 0 %}
|
||||
|
||||
{% assign sort_categories = site.categories | sort %}
|
||||
|
||||
{% for category in sort_categories %}
|
||||
{% assign category_name = category | first %}
|
||||
{% assign posts_of_category = category | last %}
|
||||
{% assign first_post = posts_of_category | first %}
|
||||
|
||||
{% if category_name == first_post.categories[0] %}
|
||||
{% assign sub_categories = "" | split: "" %}
|
||||
|
||||
{% for post in posts_of_category %}
|
||||
{% assign second_category = post.categories[1] %}
|
||||
{% if second_category %}
|
||||
{% unless sub_categories contains second_category %}
|
||||
{% assign sub_categories = sub_categories | push: second_category %}
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% assign sub_categories = sub_categories | sort %}
|
||||
{% assign sub_categories_size = sub_categories | size %}
|
||||
|
||||
<div class="card categories">
|
||||
<!-- top-category -->
|
||||
<div id="{{ HEAD_PREFIX }}{{ group_index }}"
|
||||
class="card-header d-flex justify-content-between hide-border-bottom">
|
||||
<span>
|
||||
<i class="far fa-folder{% if sub_categories_size > 0 %}-open{% endif %} fa-fw"></i>
|
||||
|
||||
{% capture _category_url %}/categories/{{ category_name | slugify | url_encode }}/{% endcapture %}
|
||||
<a href="{{ _category_url | relative_url }}" class="ml-1 mr-2">{{ category_name }}</a>
|
||||
|
||||
<!-- content count -->
|
||||
{% assign top_posts_size = site.categories[category_name] | size %}
|
||||
<span class="text-muted small font-weight-light">
|
||||
{% if sub_categories_size > 0 %}
|
||||
{{ sub_categories_size }}
|
||||
{{ site.data.locales[lang].categories.category_measure }},
|
||||
{% endif %}
|
||||
{{ top_posts_size }}
|
||||
{{ site.data.locales[lang].categories.post_measure }}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<!-- arrow -->
|
||||
{% if sub_categories_size > 0%}
|
||||
<a href="#{{ LIST_PREFIX }}{{ group_index }}" data-toggle="collapse"
|
||||
aria-expanded="true" aria-label="{{ HEAD_PREFIX }}{{ group_index }}-trigger"
|
||||
class="category-trigger hide-border-bottom">
|
||||
<i class="fas fa-fw fa-angle-down"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<span data-toggle="collapse" class="category-trigger hide-border-bottom disabled">
|
||||
<i class="fas fa-fw fa-angle-right"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- .card-header -->
|
||||
|
||||
<!-- Sub-categories -->
|
||||
{% if sub_categories_size > 0 %}
|
||||
<div id="{{ LIST_PREFIX }}{{ group_index }}" class="collapse show" aria-expanded="true">
|
||||
<ul class="list-group">
|
||||
{% for sub_category in sub_categories %}
|
||||
<li class="list-group-item">
|
||||
<i class="far fa-folder fa-fw"></i>
|
||||
|
||||
{% capture _sub_ctg_url %}/categories/{{ sub_category | slugify | url_encode }}/{% endcapture %}
|
||||
<a href="{{ _sub_ctg_url | relative_url }}" class="ml-1 mr-2">{{ sub_category }}</a>
|
||||
|
||||
{% assign posts_size = site.categories[sub_category] | size %}
|
||||
<span class="text-muted small font-weight-light">
|
||||
{{ posts_size }}
|
||||
{{ site.data.locales[lang].categories.post_measure }}
|
||||
</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- .card -->
|
||||
|
||||
{% assign group_index = group_index | plus: 1 %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -1,24 +1,25 @@
|
||||
---
|
||||
layout: page
|
||||
# The Category layout
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# MIT Licensed
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
<div id="page-category">
|
||||
<h1 class="pl-lg-2">
|
||||
<i class="far fa-folder-open fa-fw text-muted"></i>
|
||||
{{ page.title }}
|
||||
<span class="lead text-muted pl-2">{{ site.categories[page.category] | size }}</span>
|
||||
<span class="lead text-muted pl-2">{{ page.posts | size }}</span>
|
||||
</h1>
|
||||
|
||||
<ul class="post-content pl-0">
|
||||
{% for post in site.categories[page.category] %}
|
||||
{% assign post_df = site.data.locales[lang].date_format.post.long %}
|
||||
|
||||
{% for post in page.posts %}
|
||||
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
||||
<a href="{{ post.url | absolute_url }}">{{ post.title }}</a>
|
||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||
<span class="dash flex-grow-1"></span>
|
||||
<span class="text-muted small">{{ post.date | date: site.data.date_format.post }}</span>
|
||||
<span class="text-muted small">{{ post.date | date: post_df }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -1,56 +1,55 @@
|
||||
---
|
||||
layout: compress
|
||||
# Default layout
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT Licensed
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
{% capture prefer_mode %}
|
||||
{% if site.theme_mode != "dual" %}
|
||||
{% if site.theme_mode %}
|
||||
mode="{{ site.theme_mode }}"
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
<html lang="en" {{ prefer_mode }} >
|
||||
<html lang="{{ site.lang }}" {{ prefer_mode }}>
|
||||
|
||||
{% include head.html %}
|
||||
|
||||
<body data-spy="scroll" data-target="#toc">
|
||||
<div id="sidebar" class="d-flex flex-column">
|
||||
|
||||
{% include sidebar.html %}
|
||||
</div>
|
||||
<div id="main-wrapper">
|
||||
|
||||
{% include topbar.html %}
|
||||
|
||||
<div id="main-wrapper">
|
||||
<div id="main">
|
||||
|
||||
{% capture _content %}
|
||||
{{ content }}
|
||||
{% endcapture %}
|
||||
|
||||
{% include fixlinenos.html %}
|
||||
{{ _content }}
|
||||
{% include refactor-content.html content=content %}
|
||||
|
||||
{% include footer.html %}
|
||||
|
||||
</div>
|
||||
|
||||
{% include search-results.html %}
|
||||
</div>
|
||||
|
||||
</div> <!-- #main-wrapper -->
|
||||
|
||||
{% if page.mermaid %}
|
||||
{% include mermaid.html %}
|
||||
{% endif %}
|
||||
|
||||
<div id="mask"></div>
|
||||
|
||||
<a id="back-to-top" href="#" class="btn btn-lg btn-box-shadow" role="button">
|
||||
<a id="back-to-top" href="#" aria-label="back-to-top" class="btn btn-lg btn-box-shadow" role="button">
|
||||
<i class="fas fa-angle-up"></i>
|
||||
</a>
|
||||
|
||||
{% if jekyll.environment == 'production' %}
|
||||
{% include google-analytics.html %}
|
||||
{% endif %}
|
||||
|
||||
{% include search-loader.html %}
|
||||
|
||||
{% include js-selector.html %}
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,42 +1,95 @@
|
||||
---
|
||||
layout: page
|
||||
# The Home page layout
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT Licensed
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
{% assign pinned = site.posts | where: "pin", "true" %}
|
||||
{% assign default = site.posts | where_exp: "item", "item.pin != true" %}
|
||||
|
||||
{% assign posts = "" | split: "" %}
|
||||
|
||||
<!-- Get pinned posts -->
|
||||
|
||||
{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
|
||||
{% assign pinned_num = pinned.size | minus: offset %}
|
||||
|
||||
{% if pinned_num > 0 %}
|
||||
{% for i in (offset..pinned.size) limit: pinned_num %}
|
||||
{% assign posts = posts | push: pinned[i] %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% assign pinned_num = 0 %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- Get default posts -->
|
||||
|
||||
{% assign default_beg = offset | minus: pinned.size %}
|
||||
|
||||
{% if default_beg < 0 %}
|
||||
{% assign default_beg = 0 %}
|
||||
{% endif %}
|
||||
|
||||
{% assign default_num = paginator.posts | size | minus: pinned_num %}
|
||||
{% assign default_end = default_beg | plus: default_num | minus: 1 %}
|
||||
|
||||
{% if default_num > 0 %}
|
||||
{% for i in (default_beg..default_end) %}
|
||||
{% assign posts = posts | push: default[i] %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<div id="post-list">
|
||||
{% for post in paginator.posts %}
|
||||
|
||||
{% for post in posts %}
|
||||
|
||||
<div class="post-preview">
|
||||
<h1>
|
||||
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
|
||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||
</h1>
|
||||
|
||||
<div class="post-content">
|
||||
<p>
|
||||
{{ post.content | strip_html | truncate: 200 | replace: '&', '&' }}
|
||||
{% include no-linenos.html content=post.content %}
|
||||
{{ content | markdownify | strip_html | truncate: 200 }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="post-meta text-muted pt-1">
|
||||
<div class="post-meta text-muted d-flex justify-content-between">
|
||||
|
||||
<div>
|
||||
<!-- posted date -->
|
||||
<i class="far fa-calendar fa-fw"></i>
|
||||
{% include timeago.html date=post.date tooltip=true %}
|
||||
|
||||
<!-- time to read -->
|
||||
<i class="far fa-clock fa-fw"></i>
|
||||
<span class="timeago" data-toggle="tooltip" data-placement="bottom"
|
||||
title="{{ post.date | date: site.data.date_format.tooltip }}">
|
||||
{{ post.date | date: site.data.date_format.post }}
|
||||
<i class="unloaded">{{ post.date | date_to_xmlschema }}</i>
|
||||
</span>
|
||||
{% include read-time.html content=post.content %}
|
||||
|
||||
<!-- page views -->
|
||||
{% if site.google_analytics.pv.enabled %}
|
||||
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
|
||||
<i class="far fa-eye fa-fw"></i>
|
||||
<span id="pv_{{-post.title-}}" class="pageviews">
|
||||
<i class="fas fa-spinner fa-spin fa-fw"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if post.pin %}
|
||||
<div class="pin">
|
||||
<i class="fas fa-thumbtack fa-fw"></i>
|
||||
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- .post-meta -->
|
||||
|
||||
</div> <!-- .post-review -->
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div> <!-- #post-list -->
|
||||
|
||||
{% if paginator.total_pages > 0 %}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
---
|
||||
layout: default
|
||||
# The page layout
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT License
|
||||
---
|
||||
|
||||
<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 pl-xl-3 mb-md-4">
|
||||
<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">
|
||||
{% if page.dynamic_title %}
|
||||
<h1 class="dynamic-title">{{ page.title }}</h1>
|
||||
<h1 class="dynamic-title">
|
||||
{% if page.collection == 'tabs' %}
|
||||
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
|
||||
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
|
||||
{% else %}
|
||||
{{- page.title -}}
|
||||
{% endif %}
|
||||
</h1>
|
||||
<div class="post-content">
|
||||
{{ content }}
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
# The posts' layout
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT Licensed
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div id="post-wrapper" class="col-12 col-lg-11 col-xl-8">
|
||||
@@ -16,65 +14,73 @@ layout: default
|
||||
<h1 data-toc-skip>{{ page.title }}</h1>
|
||||
|
||||
<div class="post-meta text-muted d-flex flex-column">
|
||||
<!-- Published Date and Categoreis -->
|
||||
<!-- Published date and author -->
|
||||
<div>
|
||||
<span class="timeago" data-toggle="tooltip" data-placement="bottom"
|
||||
title="{{ page.date | date: site.data.date_format.tooltip }}">
|
||||
{{ page.date | date: site.data.date_format.post }}
|
||||
<i class="unloaded">{{ page.date | date_to_xmlschema }}</i>
|
||||
<span class="semi-bold">
|
||||
{{ page.author | default: site.social.name }}
|
||||
</span>
|
||||
{% if page.categories.size > 0 %}on{% endif %}
|
||||
{% for category in page.categories %}
|
||||
<a href='{{ site.baseurl }}/categories/{{ category | replace: ' ', '-' | downcase | url_encode }}/'>{{ category }}</a>
|
||||
{%- unless forloop.last -%}, {%- endunless -%}
|
||||
{% endfor %}
|
||||
{% capture _preposition %}{{ site.data.locales[lang].post.published }}{% endcapture %}
|
||||
{% include timeago.html date=page.date tooltip=true preposition=_preposition %}
|
||||
</div>
|
||||
|
||||
<!-- page views -->
|
||||
{% if site.google_analytics.pv.enabled %}
|
||||
<div>
|
||||
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin fa-fw"></i></span> views
|
||||
</div>
|
||||
<!-- lastmod -->
|
||||
{% if page.last_modified_at %}
|
||||
<span>
|
||||
{{ site.data.locales[lang].post.updated }}
|
||||
{% include timeago.html date=page.last_modified_at class="lastmod" 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 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 %}
|
||||
<img src="{{ page.image }}">
|
||||
|
||||
{% 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 %}
|
||||
<!-- Add lozad class into image tags. see: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||
{% if content contains '<img src=' %}
|
||||
{% capture loading %}
|
||||
{{ "/assets/img/commons/loading.png" | relative_url }}
|
||||
{% endcapture %}
|
||||
{% assign replacement = '<img class="lozad" src=' | append: loading | append: ' data-src=' %}
|
||||
{{ content | replace: '<img src=', replacement }}
|
||||
{% else %}
|
||||
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post-tail-wrapper text-muted">
|
||||
|
||||
<!-- lastmod -->
|
||||
{% if page.seo.date_modified > page.date %}
|
||||
<div>
|
||||
Updated
|
||||
<span class="timeago lastmod"
|
||||
data-toggle="tooltip" data-placement="top"
|
||||
title="{{ page.seo.date_modified | date: site.data.date_format.tooltip }}">
|
||||
{{ page.seo.date_modified | date: site.data.date_format.post }}
|
||||
<i class="unloaded">{{ page.seo.date_modified | date_to_xmlschema}}</i>
|
||||
</span>
|
||||
<!-- 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 -->
|
||||
<!-- tags -->
|
||||
{% if page.tags.size > 0 %}
|
||||
<div class="pt-3">
|
||||
<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 | replace: ' ', '-' | downcase | url_encode }}/"
|
||||
<a href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
|
||||
class="post-tag no-text-decoration" >
|
||||
{{- tag -}}
|
||||
</a>
|
||||
@@ -83,21 +89,17 @@ layout: default
|
||||
{% endif %}
|
||||
|
||||
<div class="post-tail-bottom
|
||||
d-flex justify-content-between align-items-center pt-5 pb-2">
|
||||
|
||||
{% if site.data.right.license %}
|
||||
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
|
||||
<div class="license-wrapper">
|
||||
<span class="license-text ml-1 mr-1">
|
||||
{{ site.data.right.license.prompt }}
|
||||
<a href="{{ site.data.right.license.link }}">
|
||||
{{ site.data.right.license.name }}
|
||||
{% for icon in site.data.right.license.icons %}
|
||||
<i class="{{ icon }}"></i>
|
||||
{% endfor %}
|
||||
{% 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>
|
||||
</span>
|
||||
</div>
|
||||
{% endcapture %}
|
||||
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include post-sharing.html %}
|
||||
|
||||
@@ -107,16 +109,26 @@ layout: default
|
||||
|
||||
</div> <!-- .post -->
|
||||
|
||||
|
||||
</div> <!-- #post-wrapper -->
|
||||
|
||||
{% include panel.html %}
|
||||
{% assign enable_toc = false %}
|
||||
|
||||
{% if site.toc and page.toc %}
|
||||
{% if content contains '<h2' or content contains '<h3' %}
|
||||
{% assign enable_toc = true %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% include panel.html toc=enable_toc %}
|
||||
|
||||
</div> <!-- .row -->
|
||||
|
||||
<div class="row">
|
||||
<div id="post-extend-wrapper" class="col-12 col-lg-11 col-xl-8">
|
||||
<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">
|
||||
|
||||
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
|
||||
{% include related-posts.html %}
|
||||
|
||||
{% include post-nav.html %}
|
||||
|
||||
@@ -124,12 +136,8 @@ layout: default
|
||||
{% include disqus.html %}
|
||||
{% endif %}
|
||||
|
||||
{% include related-posts.html %}
|
||||
|
||||
</div> <!-- .pl-1 pr-1 -->
|
||||
|
||||
</div> <!-- #post-extend-wrapper -->
|
||||
|
||||
</div> <!-- .row -->
|
||||
</div> <!-- .col-* -->
|
||||
|
||||
{% include lozad.html %}
|
||||
</div> <!-- .row -->
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
---
|
||||
layout: page
|
||||
# The layout for Tag page
|
||||
# v2.0
|
||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
# © 2017-2019 Cotes Chung
|
||||
# MIT Licensed
|
||||
---
|
||||
|
||||
{% include lang.html %}
|
||||
|
||||
<div id="page-tag">
|
||||
<h1 class="pl-lg-2">
|
||||
<i class="fa fa-tag fa-fw text-muted"></i>
|
||||
{{ page.title }}
|
||||
<span class="lead text-muted pl-2">{{ site.tags[page.tag] | size }}</span>
|
||||
<span class="lead text-muted pl-2">{{ page.posts | size }}</span>
|
||||
</h1>
|
||||
<ul class="post-content pl-0">
|
||||
{% for post in site.tags[page.tag] %}
|
||||
{% assign post_df = site.data.locales[lang].date_format.post.long %}
|
||||
|
||||
{% for post in page.posts %}
|
||||
<li class="d-flex justify-content-between pl-md-3 pr-md-3">
|
||||
<a href="{{ post.url | absolute_url }}">{{ post.title }}</a>
|
||||
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
|
||||
<span class="dash flex-grow-1"></span>
|
||||
<span class="text-muted small">{{ post.date | date: site.data.date_format.post }}</span>
|
||||
<span class="text-muted small">{{ post.date | date: post_df }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
21
_layouts/tags.html
Normal file
21
_layouts/tags.html
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
layout: page
|
||||
# All the Tags of posts.
|
||||
---
|
||||
|
||||
<div id="tags" class="d-flex flex-wrap ml-xl-2 mr-xl-2">
|
||||
|
||||
{% assign tags = "" | split: "" %}
|
||||
{% for t in site.tags %}
|
||||
{% assign tags = tags | push: t[0] %}
|
||||
{% endfor %}
|
||||
|
||||
{% assign sorted_tags = tags | sort_natural %}
|
||||
|
||||
{% for t in sorted_tags %}
|
||||
<div>
|
||||
<a class="tag" href="{{ site.baseurl }}/tags/{{ t | slugify | url_encode }}/">{{ t }}<span class="text-muted">{{ site.tags[t].size }}</span></a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
14
_plugins/posts-lastmod-hook.rb
Normal file
14
_plugins/posts-lastmod-hook.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Check for changed posts
|
||||
|
||||
Jekyll::Hooks.register :posts, :post_init do |post|
|
||||
|
||||
commit_num = `git rev-list --count HEAD "#{ post.path }"`
|
||||
|
||||
if commit_num.to_i > 1
|
||||
lastmod_date = `git log -1 --pretty="%ad" --date=iso "#{ post.path }"`
|
||||
post.data['last_modified_at'] = lastmod_date
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,24 +1,31 @@
|
||||
---
|
||||
title: "Text and Typography"
|
||||
title: Text and Typography
|
||||
author: Cotes Chung
|
||||
date: 2019-08-08 11:33:00 +0800
|
||||
categories: [Blogging, Demo]
|
||||
tags: [typography]
|
||||
math: true
|
||||
mermaid: true
|
||||
image:
|
||||
src: /commons/devices-mockup.png
|
||||
width: 800
|
||||
height: 500
|
||||
---
|
||||
|
||||
This Jekyll template totally compatible with Markdown syntax. Now, let's take a look for the text and typography in this theme.
|
||||
This post is to show Markdown syntax rendering on [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/fork), you can also use it as an example of writing. Now, let's start looking at text and typography.
|
||||
|
||||
|
||||
## Titles
|
||||
---
|
||||
# H1 - heading
|
||||
|
||||
***
|
||||
# H1
|
||||
<h2 data-toc-skip>H2 - heading</h2>
|
||||
|
||||
<h2 data-toc-skip>H2</h2>
|
||||
<h3 data-toc-skip>H3 - heading</h3>
|
||||
|
||||
<h3 data-toc-skip>H3</h3>
|
||||
|
||||
#### H4
|
||||
|
||||
***
|
||||
<h4>H4 - heading</h4>
|
||||
---
|
||||
<br>
|
||||
|
||||
## Paragraph
|
||||
|
||||
@@ -34,31 +41,116 @@ Beside the lake, beneath the trees,
|
||||
|
||||
Fluttering and dancing in the breeze.
|
||||
|
||||
## Lists
|
||||
|
||||
### Ordered list
|
||||
|
||||
1. Firstly
|
||||
2. Secondly
|
||||
3. Thirdly
|
||||
|
||||
### Unordered list
|
||||
|
||||
- Chapter
|
||||
- Section
|
||||
- Paragraph
|
||||
|
||||
### Task list
|
||||
|
||||
- [ ] TODO
|
||||
- [x] Completed
|
||||
- [ ] Defeat COVID-19
|
||||
- [x] Vaccine production
|
||||
- [ ] Economic recovery
|
||||
- [ ] People smile again
|
||||
|
||||
### Description list
|
||||
|
||||
Sun
|
||||
: the star around which the earth orbits
|
||||
|
||||
Moon
|
||||
: the natural satellite of the earth, visible by reflected light from the sun
|
||||
|
||||
|
||||
## Block Quote
|
||||
|
||||
> This line to shows the Block Quote.
|
||||
|
||||
## Tables
|
||||
|
||||
|Company|Contact|Country|
|
||||
|:---|:--|---:|
|
||||
|Alfreds Futterkiste | Maria Anders | Germany
|
||||
|Island Trading | Helen Bennett | UK
|
||||
|Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy
|
||||
| Company | Contact | Country |
|
||||
|:-----------------------------|:-----------------|--------:|
|
||||
| Alfreds Futterkiste | Maria Anders | Germany |
|
||||
| Island Trading | Helen Bennett | UK |
|
||||
| Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
|
||||
|
||||
## Link
|
||||
## Links
|
||||
|
||||
[http://127.0.0.1:4000](http://127.0.0.1:4000)
|
||||
<http://127.0.0.1:4000>
|
||||
|
||||
|
||||
## Footnote
|
||||
|
||||
Click the hook will locate the footnote[^footnote].
|
||||
Click the hook will locate the footnote[^footnote], and here is another footnote[^fn-nth-2].
|
||||
|
||||
|
||||
## Image
|
||||
## Images
|
||||
|
||||

|
||||
- Default (with caption)
|
||||
|
||||
{: width="972" height="589" }
|
||||
_Full screen width and center alignment_
|
||||
|
||||
<br>
|
||||
|
||||
- Shadow
|
||||
|
||||
{: .shadow width="1548" height="864" style="max-width: 90%" }
|
||||
_shadow effect (visible in light mode)_
|
||||
|
||||
<br>
|
||||
|
||||
- Left aligned
|
||||
|
||||
{: width="972" height="589" style="max-width: 70%" .normal}
|
||||
|
||||
<br>
|
||||
|
||||
- Float to left
|
||||
|
||||
{: width="972" height="589" style="max-width: 200px" .left}
|
||||
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
|
||||
|
||||
<br>
|
||||
|
||||
- Float to right
|
||||
|
||||
{: width="972" height="589" style="max-width: 200px" .right}
|
||||
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
|
||||
|
||||
<br>
|
||||
|
||||
## Mermaid SVG
|
||||
|
||||
```mermaid
|
||||
gantt
|
||||
title Adding GANTT diagram functionality to mermaid
|
||||
apple :a, 2017-07-20, 1w
|
||||
banana :crit, b, 2017-07-23, 1d
|
||||
cherry :active, c, after b a, 1d
|
||||
```
|
||||
|
||||
|
||||
## Mathematics
|
||||
|
||||
The mathematics powered by [**MathJax**](https://www.mathjax.org/):
|
||||
|
||||
$$ \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} $$
|
||||
|
||||
When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are
|
||||
|
||||
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
|
||||
|
||||
|
||||
## Inline code
|
||||
@@ -66,7 +158,7 @@ Click the hook will locate the footnote[^footnote].
|
||||
This is an example of `Inline Code`.
|
||||
|
||||
|
||||
## Code Snippet
|
||||
## Code block
|
||||
|
||||
### Common
|
||||
|
||||
@@ -79,79 +171,30 @@ This is a common code snippet, without syntax highlight and line number.
|
||||
#### Console
|
||||
|
||||
```console
|
||||
$ date
|
||||
Sun Nov 3 15:11:12 CST 2019
|
||||
```
|
||||
|
||||
|
||||
#### Terminal
|
||||
|
||||
```terminal
|
||||
$ env |grep SHELL
|
||||
SHELL=/usr/local/bin/bash
|
||||
PYENV_SHELL=bash
|
||||
```
|
||||
|
||||
#### Ruby
|
||||
|
||||
```ruby
|
||||
def sum_eq_n?(arr, n)
|
||||
return true if arr.empty? && n == 0
|
||||
arr.product(arr).reject { |a,b| a == b }.any? { |a,b| a + b == n }
|
||||
end
|
||||
```
|
||||
|
||||
#### Shell
|
||||
|
||||
```shell
|
||||
```bash
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "The command was not successful.";
|
||||
#do the needful / exit
|
||||
fi;
|
||||
```
|
||||
|
||||
#### Liquid
|
||||
### Specific filename
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% if product.title contains 'Pack' %}
|
||||
This product's title contains the word Pack.
|
||||
{% endif %}
|
||||
```sass
|
||||
@import
|
||||
"colors/light-typography",
|
||||
"colors/dark-typography"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
#### HTML
|
||||
|
||||
```html
|
||||
<div class="sidenav">
|
||||
<a href="#contact">Contact</a>
|
||||
<button class="dropdown-btn">Dropdown
|
||||
<i class="fa fa-caret-down"></i>
|
||||
</button>
|
||||
<div class="dropdown-container">
|
||||
<a href="#">Link 1</a>
|
||||
<a href="#">Link 2</a>
|
||||
<a href="#">Link 3</a>
|
||||
</div>
|
||||
<a href="#contact">Search</a>
|
||||
</div>
|
||||
```
|
||||
|
||||
**Horizontal Scrolling**
|
||||
|
||||
```html
|
||||
<div class="panel-group">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" id="{{ category_name }}">
|
||||
<i class="far fa-folder"></i>
|
||||
<p>This is a very long long long long long long long long long long long long long long long long long long long long long line.</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
{: file='_sass/jekyll-theme-chirpy.scss'}
|
||||
|
||||
## Reverse Footnote
|
||||
|
||||
[^footnote]: The footnote source.
|
||||
[^footnote]: The footnote source
|
||||
[^fn-nth-2]: The 2nd footnote source
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
---
|
||||
title: "Writing a New Post"
|
||||
title: Writing a New Post
|
||||
author: Cotes Chung
|
||||
date: 2019-08-08 14:10:00 +0800
|
||||
categories: [Blogging, Tutorial]
|
||||
tags: [writing]
|
||||
render_with_liquid: false
|
||||
---
|
||||
|
||||
## Naming and Path
|
||||
|
||||
Create a new file named with the format `YYYY-MM-DD-title.md` then put it into `_post` of the root directory.
|
||||
Create a new file named `YYYY-MM-DD-TITLE.EXTENSION` and put it in the `_posts/` of the root directory. Please note that the `EXTENSION` must be one of `md` and `markdown`.
|
||||
|
||||
## Front Matter
|
||||
|
||||
@@ -24,68 +26,22 @@ tags: [TAG] # TAG names should always be lowercase
|
||||
|
||||
> **Note**: The posts' ***layout*** has been set to `post` by default, so there is no need to add the variable ***layout*** in Front Matter block.
|
||||
|
||||
- **Timezone of date**
|
||||
### Timezone of date
|
||||
|
||||
In order to accurately record the release date of a post, you should not only setup the `timezone` of `_config.yml` but also provide the the post's timezone in field `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
|
||||
In order to accurately record the release date of a post, you should not only setup the `timezone` of `_config.yml` but also provide the the post's timezone in field `date` of its Front Matter block. Format: `+/-TTTT`, e.g. `+0800`.
|
||||
|
||||
- **Categories and Tags**
|
||||
### Categories and Tags
|
||||
|
||||
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity.
|
||||
The `categories` of each post is designed to contain up to two elements, and the number of elements in `tags` can be zero to infinity. For instance:
|
||||
|
||||
The list of posts belonging to the same category/tag is recorded on a separate page. The number of such *category*/*tag* type pages is equal to the number of `categories`/`tags` for all posts, they must match perfectly.
|
||||
|
||||
let's say there is a post with front matter:
|
||||
```yaml
|
||||
categories: [Animal, Insect]
|
||||
tags: bee
|
||||
tags: [bee]
|
||||
```
|
||||
|
||||
then we should have two *category* type pages placed in folder `categories` of root and one *tag* type page placed in folder `tags` of root:
|
||||
```terminal
|
||||
jekyll-theme-chirpy
|
||||
├── categories
|
||||
│ ├── animal.html
|
||||
│ └── tutorial.html
|
||||
└── tags
|
||||
└── bee.html
|
||||
```
|
||||
|
||||
and the content of a *category* type page is
|
||||
```yaml
|
||||
---
|
||||
layout: category
|
||||
title: CATEGORY_NAME # e.g. Insect
|
||||
category: CATEGORY_NAME # e.g. Insect
|
||||
---
|
||||
```
|
||||
|
||||
the content of a *tag* type page is
|
||||
```yaml
|
||||
---
|
||||
layout: tag
|
||||
title: TAG_NAME # e.g. bee
|
||||
tag: TAG_NAME # e.g. bee
|
||||
---
|
||||
```
|
||||
|
||||
With the increasing number of posts, the number of categories and tags will increase several times! If we still manually create these *category*/*tag* type files, it will obviously be a super time-consuming job, and it is very likely to miss some of them(i.e. when you click on the missing `category` or `tag` link from a post or somewhere, it will complain to you '404'). The good news is that we got a lovely script tool `_scripts/py/pages_generator.py` to finish the boring task. Basically we will use it via `tools/init.sh` instead of running it separately. Check out its use case [here]({{ "/posts/getting-started/#option-1-built-by-github-pages" | relative_url }}).
|
||||
|
||||
- **Last modified date**
|
||||
|
||||
The last modified date of the posts is recorded as `seo.date_modified`, for example:
|
||||
```yaml
|
||||
---
|
||||
seo:
|
||||
date_modified: 2020-01-04 17:05:41 +0800
|
||||
---
|
||||
```
|
||||
|
||||
This date is equal to the lastest git-commit date of the post file and can be automatically generated by the tool script `_scripts/py/update_posts_lastmod.py`. Similar to the other script `pages_generator.py` mentioned above, it is also be called from `tools/init.sh`, so it doesn't have to be used separately.
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
||||
By default, the **T**able **o**f **C**ontents (TOC) is displayed on the right panel of the post. If you want to turn it off globally, go to `_config.yml` and set the value of variable `toc` to `false`. If you want to turn off TOC for specific post, add the following to post's [Front Matter](https://jekyllrb.com/docs/front-matter/):
|
||||
|
||||
```yaml
|
||||
---
|
||||
@@ -93,7 +49,6 @@ toc: false
|
||||
---
|
||||
```
|
||||
|
||||
|
||||
## Comments
|
||||
|
||||
Similar to TOC, the [Disqus](https://disqus.com/) comments is loaded by default in each post, and the global switch is defined by variable `comments` in file `_config.yml` . If you want to close the comment for specific post, add the following to the **Front Matter** of the post:
|
||||
@@ -104,34 +59,186 @@ comments: false
|
||||
---
|
||||
```
|
||||
|
||||
## Mathematics
|
||||
|
||||
For website performance reasons, the mathematical feature won't be loaded by default. But it can be enabled by:
|
||||
|
||||
```yaml
|
||||
---
|
||||
math: true
|
||||
---
|
||||
```
|
||||
|
||||
## Mermaid
|
||||
|
||||
[**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagrams generation tool. To enable it on your post, add the following to the YAML block:
|
||||
|
||||
```yaml
|
||||
---
|
||||
mermaid: true
|
||||
---
|
||||
```
|
||||
|
||||
Then you can use it like other markdown language: surround the graph code with ```` ```mermaid ```` and ```` ``` ````.
|
||||
|
||||
## Images
|
||||
|
||||
### Preview image
|
||||
|
||||
If you want to add an image to the top of the post contents, specify the attribute `src`, `width`, `height` and `alt` for the image:
|
||||
|
||||
```yaml
|
||||
---
|
||||
image:
|
||||
src: /path/to/image/file
|
||||
width: 1000 # in pixels
|
||||
height: 400 # in pixels
|
||||
alt: image alternative text
|
||||
---
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
|
||||
### Image caption
|
||||
|
||||
Add italics to the next line of an image,then it will become the caption and appear at the bottom of the image:
|
||||
|
||||
```markdown
|
||||

|
||||
_Image Caption_
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
### Image size
|
||||
|
||||
In order to prevent the page content layout from shifting when the image is loaded, we should set the width and height for each image:
|
||||
|
||||
```markdown
|
||||
{: width="700" height="400" }
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
### Image position
|
||||
|
||||
By default, the image is centered, but you can specify the position by using one of class `normal` , `left` and `right`. For example:
|
||||
|
||||
- **Normal position**
|
||||
|
||||
Image will be left aligned in below sample:
|
||||
|
||||
```markdown
|
||||
{: .normal }
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
- **Float to the left**
|
||||
|
||||
```markdown
|
||||
{: .left }
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
- **Float to the right**
|
||||
|
||||
```markdown
|
||||
{: .right }
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
> **Limitation**: Once the position of the image is specified, the image caption should not be added.
|
||||
|
||||
### Image shadow
|
||||
|
||||
The screenshots of the program window can be considered to show the shadow effect, and the shadow will be visible in the `light` mode:
|
||||
|
||||
```markdown
|
||||
{: .shadow }
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
### CDN URL
|
||||
|
||||
If you host the images on the CDN, you can save the time of repeatedly writing the CDN url by assigning the variable `img_cdn` of `_config.yml` file:
|
||||
|
||||
```yaml
|
||||
img_cdn: https://cdn.com
|
||||
```
|
||||
{: file='_config.yml' .nolineno}
|
||||
|
||||
Once `img_cdn` is assigned, the CDN url will be added to the path of all images (images of site avatar and posts) starting with `/`.
|
||||
|
||||
For instance, when using images:
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
||||
|
||||
```html
|
||||
<img src="https://cdn.com/path/to/flower.png" alt="The flower">
|
||||
```
|
||||
{: .nolineno}
|
||||
|
||||
## 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:
|
||||
|
||||
```yaml
|
||||
---
|
||||
pin: true
|
||||
---
|
||||
```
|
||||
|
||||
## Code Block
|
||||
|
||||
Markdown symbols <code class="highlighter-rouge">```</code> can easily create a code block as following examples.
|
||||
Markdown symbols ```` ``` ```` can easily create a code block as follows:
|
||||
|
||||
```
|
||||
This is a common code snippet, without syntax highlight and line number.
|
||||
This is a plaintext code snippet.
|
||||
```
|
||||
|
||||
## Specific Language
|
||||
### Specifying Language
|
||||
|
||||
Using <code class="highlighter-rouge">```Language</code> you will get code snippets with line Numbers and syntax highlight.
|
||||
|
||||
> **Note**: The Jekyll style `{% raw %}{%{% endraw %} highlight LANGUAGE {% raw %}%}{% endraw %}` or `{% raw %}{%{% endraw %} highlight LANGUAGE linenos {% raw %}%}{% endraw %}` are not allowed to be used in this theme !
|
||||
Using ```` ```{language} ```` you will get a code block with syntax highlight:
|
||||
|
||||
````markdown
|
||||
```yaml
|
||||
# Yaml code snippet
|
||||
items:
|
||||
- part_no: A4786
|
||||
descrip: Water Bucket (Filled)
|
||||
price: 1.47
|
||||
quantity: 4
|
||||
key: value
|
||||
```
|
||||
````
|
||||
|
||||
#### Liquid codes
|
||||
> **Limination**: The Jekyll style `highlight` tag ais not compatible with this theme.
|
||||
|
||||
If you want to display the **Liquid** snippet, surround the liquid code with `{% raw %}{%{% endraw %} raw {%raw%}%}{%endraw%}` and `{% raw %}{%{% endraw %} endraw {%raw%}%}{%endraw%}` .
|
||||
### Line Number
|
||||
|
||||
By default, all languages except `plaintext`, `console` and `terminal` will display line numbers. When you want to hide the line number of the code block, you can append `{: .nolineno}` at the next line:
|
||||
|
||||
````markdown
|
||||
```shell
|
||||
echo 'No more line numbers!'
|
||||
```
|
||||
{: .nolineno}
|
||||
````
|
||||
|
||||
### Specifying the Filename
|
||||
|
||||
You may have noticed that the code language will be displayed on the left side of the header of the code block. If you want to replace it with the file name, you can add the attribute `file` to achieve this:
|
||||
|
||||
````markdown
|
||||
```shell
|
||||
# content
|
||||
```
|
||||
{: file="path/to/file" }
|
||||
````
|
||||
|
||||
### Liquid Codes
|
||||
|
||||
If you want to display the **Liquid** snippet, surround the liquid code with `{% raw %}` and `{% endraw %}`:
|
||||
|
||||
````markdown
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% if product.title contains 'Pack' %}
|
||||
@@ -139,7 +246,11 @@ If you want to display the **Liquid** snippet, surround the liquid code with `{%
|
||||
{% endif %}
|
||||
```
|
||||
{% endraw %}
|
||||
````
|
||||
|
||||
Or adding `render_with_liquid: false` (Requires Jekyll 4.0 or higher) to the post's YAML block.
|
||||
|
||||
## Learn More
|
||||
|
||||
For more knowledge about Jekyll posts, visit the [Jekyll Docs: Posts](https://jekyllrb.com/docs/posts/).
|
||||
|
||||
|
||||
@@ -1,192 +1,181 @@
|
||||
---
|
||||
title: Getting Started
|
||||
author: Cotes Chung
|
||||
date: 2019-08-09 20:55:00 +0800
|
||||
categories: [Blogging, Tutorial]
|
||||
tags: [getting started]
|
||||
pin: true
|
||||
---
|
||||
|
||||
## Preparation
|
||||
## Prerequisites
|
||||
|
||||
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (Ruby, RubyGem, Bundler and Jekyll). In order to use the script tools to save time, we also need to install [Python](https://www.python.org/downloads/)(version 3.5 or abover) and [ruamel.yaml](https://pypi.org/project/ruamel.yaml/).
|
||||
Follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll` and `Bundler`.
|
||||
|
||||
In addition, if your machine is running Debian or macOS, make sure you have the [GNU coreutils](https://www.gnu.org/software/coreutils/) installed. Otherwise, get it by:
|
||||
## Installation
|
||||
|
||||
* Debian
|
||||
### Creating a New Site
|
||||
|
||||
```console
|
||||
$ sudo apt-get install coreutils
|
||||
```
|
||||
There are two ways to create a new repository for this theme:
|
||||
|
||||
* macOS
|
||||
- **[Using the Chirpy Starter](#option-1-using-the-chirpy-starter)** - Easy to upgrade, isolates irrelevant project files so you can focus on writing.
|
||||
|
||||
```console
|
||||
$ brew install coreutils
|
||||
```
|
||||
- **[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.
|
||||
|
||||
#### Option 1. Using the Chirpy Starter
|
||||
|
||||
## Install Jekyll Plugins
|
||||
Create a new repository from the [**Chirpy Starter**][use-starter] and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
|
||||
|
||||
Go to the root of repo and run:
|
||||
#### Option 2. Forking on GitHub
|
||||
|
||||
```terminal
|
||||
$ bundle install
|
||||
```
|
||||
[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.
|
||||
|
||||
`bundle` will install all the dependent Jekyll Plugins listed in file `Gemfile` automatically.
|
||||
|
||||
|
||||
## File Structure
|
||||
|
||||
The main files and related brief introductions are listed below.
|
||||
|
||||
```sh
|
||||
jekyll-theme-chirpy/
|
||||
├── _data
|
||||
├── _includes
|
||||
├── _layouts
|
||||
├── _posts # posts stay here
|
||||
├── _scripts
|
||||
├── .travis.yml # remove it
|
||||
├── .github # remove this, too
|
||||
├── assets
|
||||
├── tabs
|
||||
│ └── about.md # the ABOUT page
|
||||
├── .gitignore
|
||||
├── 404.html
|
||||
├── Gemfile
|
||||
├── LICENSE
|
||||
├── README.md
|
||||
├── _config.yml # configuration file
|
||||
├── tools # script tools
|
||||
├── feed.xml
|
||||
├── index.html
|
||||
├── robots.txt
|
||||
└── sitemap.xml
|
||||
```
|
||||
|
||||
|
||||
As mentioned above, some files or directories should be removed from your repo:
|
||||
|
||||
- .travis.yml
|
||||
- .github
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
Basically, go to `_config.yml` and customize the variables as needed, some of them are typical options:
|
||||
|
||||
* `url`
|
||||
|
||||
Set to your website url and there should be no slash symbol at the tail. Format: `<protocol>://<domain>`.
|
||||
|
||||
|
||||
* `avatar`
|
||||
|
||||
It defines the image file location of avatar. The sample image is `/assets/img/sample/avatar.jpg`, and should be replaced by your own one(a square image). Notice that a huge image file will increase the load time of your site, so keep your avatar image size as samll as possible(may be *<https://tinypng.com/>* will help).
|
||||
|
||||
* `timezone`
|
||||
|
||||
To ensure that the posts' release date matches the city you live in, please modify the field `timezone` correctly. A list of all available values can be found on [TimezoneConverter](http://www.timezoneconverter.com/cgi-bin/findzone/findzone) or [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
||||
|
||||
* `theme_mode`
|
||||
|
||||
There are three options for the theme color scheme:
|
||||
|
||||
- **dual** - The default color scheme will follow the system settings, but if the system does not support dark mode, or the browser does not support `Media Queries Level 5`, the theme will be displayed as `light` mode by default. Anyway, the bottom left corner of the Sidebar will provide a button for users to switch color schemes.
|
||||
|
||||
- **dark** - Always show dark mode.
|
||||
- **light** - Always show light mode.
|
||||
|
||||
|
||||
## Run Locally
|
||||
|
||||
You may want to preview the site before publishing, so just run the script tool:
|
||||
|
||||
```terminal
|
||||
$ bash tools/run.sh
|
||||
```
|
||||
|
||||
Open a brower and visit <http://localhost:4000>.
|
||||
|
||||
Few days later, you may find that the file changes does not refresh in real time by using `run.sh`. Don't worry, the advanced option `-r` (or `--realtime`) will solve this problem, but it requires [**fswatch**](http://emcrisostomo.github.io/fswatch/) to be installed on your machine.
|
||||
|
||||
## Deploying to GitHub Pages
|
||||
|
||||
Before the deployment begins, ensure the `url` in file `_config.yml` has been set to `https://<username>.github.io`(or the custom domain, if you have. e.g. `https://yourdomain.com`). What's more, if you prefer to the [Project site](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites), change `baseurl` of file `_config.yml` to your project name, starting with a slash. e.g. `/project`.
|
||||
|
||||
|
||||
### Option 1: Built by GitHub Pages
|
||||
|
||||
By deploying the site in this way, you're allowed to push the source code directly to the remote.
|
||||
|
||||
> **Note**: If you want to use any third-party Jekyll plugins that not in [this list](https://pages.github.com/versions/), stop reading the current approach and go to [*Option 2: Build locally*](#option-2-build-locally).
|
||||
|
||||
**1**. Rename the repository to:
|
||||
|
||||
|Site Type | Repo's Name|
|
||||
|:---|:---|
|
||||
|User or Organization | `<username>.github.io`|
|
||||
|Project| any one except `<username>.github.io`, let's say `project`|
|
||||
|
||||
**2**. Commit the changes of the repo first, then run the initialization script:
|
||||
And then execute:
|
||||
|
||||
```console
|
||||
$ bash tools/init.sh
|
||||
```
|
||||
|
||||
> Please note that the *Recent Update* list requires the latest git-log date of posts, thus make sure the changes in `_posts` have been committed before running this command.
|
||||
> **Note**: If you don't want to deploy your site on GitHub Pages, append option `--no-gh` at the end of the above command.
|
||||
|
||||
it will automatically generates the *Latest Modified Date* and *Categories / Tags* page for the posts and submit a commit. Its output is similar to the following log:
|
||||
The above command will:
|
||||
|
||||
```terminal
|
||||
[INFO] Success to update lastmod for 4 post(s).
|
||||
[INFO] Succeed! 3 category-pages created.
|
||||
[INFO] Succeed! 4 tag-pages created.
|
||||
[Automation] Updated the Categories, Tags, Lastmod for post(s).
|
||||
11 files changed, 46 insertions(+), 3 deletions(-)
|
||||
...
|
||||
Updated the Categories, Tags, Lastmod for post(s).
|
||||
```
|
||||
1. Removes some files or directories from your repository:
|
||||
- `.travis.yml`
|
||||
- files under `_posts`
|
||||
- folder `docs`
|
||||
|
||||
2. If the option `--no-gh` is provided, the directory `.github` will be deleted. Otherwise, setup the GitHub Action workflow by removing the extension `.hook` of `.github/workflows/pages-deploy.yml.hook`, and then remove the other files and directories in the folder `.github`.
|
||||
|
||||
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repo.
|
||||
3. Removes item `Gemfile.lock` from `.gitignore`.
|
||||
|
||||
**4**. Check it out:
|
||||
4. Creates a new commit to save the changes automatically.
|
||||
|
||||
|Site Type | Site URL |
|
||||
|:---|:---|
|
||||
|User or Organization | `https://<username>.github.io/`|
|
||||
|Project| `https://<username>.github.io/project/`|
|
||||
### Installing Dependencies
|
||||
|
||||
|
||||
### Option 2: Build Locally
|
||||
|
||||
For security reasons, GitHub Pages runs on `safe` mode, which means the third-party Jekyll plugins or custom scripts won't work. If you want to use any another plugins that not in the [whitelist](https://pages.github.com/versions/), **you have to generate the site locally rather than on GitHub Pages**.
|
||||
|
||||
**1**. Browse to GitHub website, create a brand new repo named:
|
||||
|
||||
|Site Type | Repo's Name|
|
||||
|:---|:---|
|
||||
|User or Organization | `<username>.github.io`|
|
||||
|Project| any one except `<username>.github.io`, let's say `project`|
|
||||
|
||||
and clone it.
|
||||
|
||||
**2**. In the root of the source project, build your site by:
|
||||
Before running for the first time, go the root directory of your site, and install dependencies as follows:
|
||||
|
||||
```console
|
||||
$ bash tools/build.sh -d /path/to/local/project/
|
||||
$ bundle
|
||||
```
|
||||
|
||||
The generated static files will be placed in the root of `/path/to/local/project`. Commit and push the changes to the `master` branch on GitHub.
|
||||
## Usage
|
||||
|
||||
**3**. Go to GitHub website and enable Pages service for the new repository.
|
||||
### Configuration
|
||||
|
||||
**4**. Visit at:
|
||||
Update the variables of `_config.yml` as needed. Some of them are typical options:
|
||||
|
||||
|Site Type | Site URL |
|
||||
|:---|:---|
|
||||
|User or Organization | `https://<username>.github.io/`|
|
||||
|Project| `https://<username>.github.io/project/`|
|
||||
- `url`
|
||||
- `avatar`
|
||||
- `timezone`
|
||||
- `lang`
|
||||
|
||||
and enjoy!
|
||||
### Customing Stylesheet
|
||||
|
||||
If you need to customize stylesheet, copy the theme's `assets/css/style.scss` to the same path on your Jekyll site, and then add the custom style at the end of the style file.
|
||||
|
||||
Starting from [`v4.1.0`][chirpy-4.1.0], if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`, create a new file `_sass/variables-hook.scss` and assign new values to the target variable in it.
|
||||
|
||||
### Running Local Server
|
||||
|
||||
You may want to preview the site contents before publishing, so just run it by:
|
||||
|
||||
```console
|
||||
$ bundle exec jekyll s
|
||||
```
|
||||
|
||||
Or run the site on Docker with the following command:
|
||||
|
||||
```console
|
||||
$ docker run -it --rm \
|
||||
--volume="$PWD:/srv/jekyll" \
|
||||
-p 4000:4000 jekyll/jekyll \
|
||||
jekyll serve
|
||||
```
|
||||
|
||||
After a while, the local service will be published at _<http://127.0.0.1:4000>_.
|
||||
|
||||
### Deployment
|
||||
|
||||
Before the deployment begins, checkout the file `_config.yml` and make sure the `url` is configured correctly. Furthermore, if you prefer the [**project site**](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and don't use a custom domain, or you want to visit your website with a base URL on a web server other than **GitHub Pages**, remember to change the `baseurl` to your project name that starting with a slash, e.g, `/project-name`.
|
||||
|
||||
Now you can choose ONE of the following methods to deploy your Jekyll site.
|
||||
|
||||
#### Deploy by Using Github Actions
|
||||
|
||||
For security reasons, GitHub Pages build runs on `safe` mode, which restricts us from using plugins to generate additional page files. Therefore, we can use **GitHub Actions** to build the site, store the built site files on a new branch, and use that branch as the source of the GitHub Pages service.
|
||||
|
||||
Quickly check the files needed for GitHub Actions build:
|
||||
|
||||
- Ensure your Jekyll site has the file `.github/workflows/pages-deploy.yml`. Otherwise, create a new one and fill in the contents of the [sample file][workflow], and the value of the `on.push.branches` should be the same as your repo's default branch name.
|
||||
|
||||
- Ensure your Jekyll site has file `tools/deploy.sh`. Otherwise, copy it from here to your Jekyll site.
|
||||
|
||||
- Furthermore, if you have committed `Gemfile.lock` to the repo, and your runtime system is not Linux, don't forget to update the platform list in the lockfile:
|
||||
|
||||
```console
|
||||
$ bundle lock --add-platform x86_64-linux
|
||||
```
|
||||
|
||||
After the above steps, rename your repository to `<GH_USERNAME>.github.io` on GitHub.
|
||||
|
||||
Now publish your Jekyll site by:
|
||||
|
||||
1. Push any commit to remote to trigger the GitHub Actions workflow. Once the build is complete and successful, a new remote branch named `gh-pages` will appear to store the built site files.
|
||||
|
||||
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
|
||||
|
||||
{: width="850" height="153" }
|
||||
|
||||
3. Visit your website at the address indicated by GitHub.
|
||||
|
||||
#### Manually Build and Deploy
|
||||
|
||||
On self-hosted servers, you cannot enjoy the convenience of **GitHub Actions**. Therefore, you should build the site on your local machine and then upload the site files to the server.
|
||||
|
||||
Go to the root of the source project, and build your site as follows:
|
||||
|
||||
```console
|
||||
$ JEKYLL_ENV=production bundle exec jekyll b
|
||||
```
|
||||
|
||||
Or build the site on Docker:
|
||||
|
||||
```console
|
||||
$ docker run -it --rm \
|
||||
--env JEKYLL_ENV=production \
|
||||
--volume="$PWD:/srv/jekyll" \
|
||||
jekyll/jekyll \
|
||||
jekyll build
|
||||
```
|
||||
|
||||
Unless you specified the output path, the generated site files will be placed in folder `_site` of the project's root directory. Now you should upload those files to the target server.
|
||||
|
||||
### Upgrading
|
||||
|
||||
It depends on how you use the theme:
|
||||
|
||||
- If you are using the theme gem (there will be `gem "jekyll-theme-chirpy"` in the `Gemfile`), editing the `Gemfile` and update the version number of the them gem, for example:
|
||||
|
||||
```diff
|
||||
- gem "jekyll-theme-chirpy", "~> 3.2", ">= 3.2.1"
|
||||
+ gem "jekyll-theme-chirpy", "~> 3.3", ">= 3.3.0"
|
||||
```
|
||||
{: .nolineno file="Gemfile" }
|
||||
|
||||
And then execute the following command:
|
||||
|
||||
```console
|
||||
$ bundle update jekyll-theme-chirpy
|
||||
```
|
||||
|
||||
As the version upgrades, the critical files (for details, see the [Startup Template][starter]) and configuration options will change. Please refer to the [Upgrade Guide](https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Upgrade-Guide) to keep your repo's files in sync with the latest version of the theme.
|
||||
|
||||
- If you forked from the source project (there will be `gemspec` in the `Gemfile` of your site), then merge the [latest upstream tags][latest-tag] into your Jekyll site to complete the upgrade.
|
||||
The merge is likely to conflict with your local modifications. Please be patient and careful to resolve these conflicts.
|
||||
|
||||
[starter]: https://github.com/cotes2020/chirpy-starter
|
||||
[use-starter]: https://github.com/cotes2020/chirpy-starter/generate
|
||||
[workflow]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/workflows/pages-deploy.yml.hook
|
||||
[chirpy-4.1.0]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/tag/v4.1.0
|
||||
[pages-src]: https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
|
||||
[latest-tag]: https://github.com/cotes2020/jekyll-theme-chirpy/tags
|
||||
|
||||
@@ -1,26 +1,37 @@
|
||||
---
|
||||
title: "Customize the Favicon"
|
||||
title: Customize the Favicon
|
||||
author: Cotes Chung
|
||||
date: 2019-08-11 00:34:00 +0800
|
||||
categories: [Blogging, Tutorial]
|
||||
tags: [favicon]
|
||||
toc: false
|
||||
---
|
||||
|
||||
In [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/), the image files of [Favicons](https://www.favicon-generator.org/about/) are placed in `assets/img/favicons/`. You may need to replace them with your own. So let's see how to customize these Favicons.
|
||||
The [favicons](https://www.favicon-generator.org/about/) of [**Chirpy**](https://github.com/cotes2020/jekyll-theme-chirpy/) are placed in the directory `assets/img/favicons/`. You may want to replace them with your own. The following sections will guide you how to create and replace the default favicons.
|
||||
|
||||
Whit a square image (PNG, JPG or GIF) in hand, open the site [*Favicon & App Icon Generator*](https://www.favicon-generator.org/) and upload your original image.
|
||||
## Generate the favicon
|
||||
|
||||

|
||||
Prepare a square image (PNG, JPG, or SVG) with a size of 512x512 or more, and then go to the online tool [**Real Favicon Generator**](https://realfavicongenerator.net/) and click button <kbd>Select your Favicon image</kbd> to upload your image file.
|
||||
|
||||
Click button <kbd>Create Favicon</kbd> and wait a moment for the website to generate the icons of various sizes automatically.
|
||||
In the next step, the webpage will show all usage scenarios. You can keep the default options, scroll to the bottom of the page, and click the button <kbd>Generate your Favicons and HTML code</kbd> to generate the favicon.
|
||||
|
||||

|
||||
## Download & Replace
|
||||
|
||||
Download the generated package, unzip and delete the following two from the extracted files:
|
||||
|
||||
- browserconfig.xml
|
||||
- manifest.json
|
||||
- `browserconfig.xml`
|
||||
- `site.webmanifest`
|
||||
|
||||
Now, copy the rest image files (`.PNG` and `.ICO`) to cover the original one in folder `assets/img/favicons/`.
|
||||
Now, copy the remaining image files (`PNG` and `ICO`) 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.
|
||||
|
||||
Lastly, don't forget to rebuild your site so that the icon becomes your custom edition.
|
||||
The following table will helps you understand the changes to the favicon files:
|
||||
|
||||
| File(s) | From Online Tool | From Chirpy |
|
||||
|---------------------|:---------------------------------:|:-----------:|
|
||||
| `*.PNG` | ✓ | ✗ |
|
||||
| `*.ICO` | ✓ | ✗ |
|
||||
| `browserconfig.xml` | ✗ | ✓ |
|
||||
| `site.webmanifest` | ✗ | ✓ |
|
||||
|
||||
> Note: ✓ means keep, ✗ means delete.
|
||||
|
||||
The next time you build the site, the favicon will be replaced with a customized edition.
|
||||
|
||||
239
_posts/2021-01-03-enable-google-pv.md
Normal file
239
_posts/2021-01-03-enable-google-pv.md
Normal file
@@ -0,0 +1,239 @@
|
||||
---
|
||||
title: Enable Google Page Views
|
||||
author: Dinesh Prasanth Moluguwan Krishnamoorthy
|
||||
date: 2021-01-03 18:32:00 -0500
|
||||
categories: [Blogging, Tutorial]
|
||||
tags: [google analytics, pageviews]
|
||||
---
|
||||
|
||||
|
||||
This post is to enable Page Views on the [**Chirpy**][chirpy-homepage] theme based blog that you just built. This requires technical knowledge and it's recommended to keep the `google_analytics.pv.*` empty unless you have a good reason. If your website has low traffic, the page views count would discourage you to write more blogs. With that said, let's start with the setup.
|
||||
|
||||
## Set up Google Analytics
|
||||
|
||||
### Create GA account and property
|
||||
|
||||
First, you need to setup your account on Google analytics. While your create your account, you must create your first **Property** as well.
|
||||
|
||||
1. Head to <https://analytics.google.com/> and click on **Start Measuring**
|
||||
2. Enter your desired _Account Name_ and choose the desired checkboxes
|
||||
3. Enter your desired _Property Name_. This is the name of the tracker project that appears on your Google Analytics dashboard
|
||||
4. Enter the required information _About your business_
|
||||
5. Hit _Create_ and accept any license popup to setup your Google Analytics account and create your property
|
||||
|
||||
### Create Data Stream
|
||||
|
||||
With your property created, you now need to set up Data Stream to track your blog traffic. After you signup, the prompt should automatically take you to creating your first **Data Stream**. If not, follow these steps:
|
||||
|
||||
1. Go to **Admin** on the left column
|
||||
2. Select the desired property from the drop down on the second column
|
||||
3. Click on **Data Streams**
|
||||
4. Add a stream and click on **Web**
|
||||
5. Enter your blog's URL
|
||||
|
||||
It should look like this:
|
||||
|
||||
{: width="1086" height="542"}
|
||||
|
||||
Now, click on the new data stream and grab the **Measurement ID**. It should look something like `G-V6XXXXXXXX`. Copy this to your `_config.yml` file
|
||||
|
||||
```yaml
|
||||
google_analytics:
|
||||
id: 'G-V6XXXXXXX' # fill in your Google Analytics ID
|
||||
# Google Analytics pageviews report settings
|
||||
pv:
|
||||
proxy_endpoint: # fill in the Google Analytics superProxy endpoint of Google App Engine
|
||||
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
||||
```
|
||||
{: file="_config.yml"}
|
||||
|
||||
When you push these changes to your blog, you should start seeing the traffic on your Google Analytics. Play around with Google Analytics dashboard to get familiar with the options available as it takes like 5 mins to pickup your changes. You should now be able to monitor your traffic in realtime.
|
||||
|
||||
{: width="616" height="557"}
|
||||
|
||||
## Setup Page Views
|
||||
|
||||
There is a detailed [tutorial](https://developers.google.com/analytics/solutions/google-analytics-super-proxy) available to set up Google Analytics superProxy. But, if you are interested to just quickly get your Chirpy-based blog display page views, follow along. These steps were tested on a Linux machine. If you are running Windows, you can use Git bash terminal to run Unix-like commands.
|
||||
|
||||
### Setup Google App Engine
|
||||
|
||||
1. Visit <https://console.cloud.google.com/appengine>
|
||||
|
||||
2. Click on **Create Application**
|
||||
|
||||
3. Click on **Create Project**
|
||||
|
||||
4. Enter the name and choose the data center close to you
|
||||
|
||||
5. Select **Python** language and **Standard** environment
|
||||
|
||||
6. Enable billing account. Yeah, you have to link your credit card. But, you won't be billed unless you exceed your free quota. For a simple blog, free quota is more than sufficient.
|
||||
|
||||
7. Go to your App Engine dashboard on your browser and select **API & Services** from the left navigation menu
|
||||
|
||||
8. Click on **Enable APIs and Services** button on the top
|
||||
|
||||
9. Enable the following APIs: _Google Analytics API_
|
||||
|
||||
10. On the left, Click on _OAuth Consent Screen_ and accept **Configure Consent Screen**. Select **External** since your blog is probably hosted for the public. Click on **Publish** under _Publishing Status_
|
||||
|
||||
11. Click on **Credentials** on the left and create a new **OAuth Client IDs** credential. Make sure to add a entry under `Authorized redirect URIs` that matches: `https://<project-id>.<region>.r.appspot.com/admin/auth`
|
||||
|
||||
12. Note down the **Your Client ID** and **Your Client Secret**. You'll need this in the next section.
|
||||
|
||||
13. Download and install the cloud SDK for your platform: <https://cloud.google.com/sdk/docs/quickstart>
|
||||
|
||||
14. Run the following commands:
|
||||
|
||||
```console
|
||||
[root@bc96abf71ef8 /]# gcloud init
|
||||
|
||||
~snip~
|
||||
|
||||
Go to the following link in your browser:
|
||||
|
||||
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=XYZ.apps.googleusercontent.com&redirect_uri=ABCDEFG
|
||||
|
||||
Enter verification code: <VERIFICATION CODE THAT YOU GET AFTER YOU VISIT AND AUTHENTICATE FROM THE ABOVE LINK>
|
||||
|
||||
You are logged in as: [blah_blah@gmail.com].
|
||||
|
||||
Pick cloud project to use:
|
||||
[1] chirpy-test-300716
|
||||
[2] Create a new project
|
||||
Please enter numeric choice or text value (must exactly match list
|
||||
item): 1
|
||||
|
||||
|
||||
[root@bc96abf71ef8 /]# gcloud info
|
||||
# Your selected project info should be displayed here
|
||||
```
|
||||
|
||||
### Setup Google Analytics superProxy
|
||||
|
||||
1. Clone the **Google Analytics superProxy** project on Github: <https://github.com/googleanalytics/google-analytics-super-proxy> to your local.
|
||||
|
||||
2. Remove the first 2 lines in the [`src/app.yaml`](https://github.com/googleanalytics/google-analytics-super-proxy/blob/master/src/app.yaml#L1-L2) file:
|
||||
```diff
|
||||
- application: your-project-id
|
||||
- version: 1
|
||||
```
|
||||
|
||||
3. In `src/config.py`, add the `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` that you gathered from you App Engine Dashboard.
|
||||
|
||||
4. Enter any random key for `XSRF_KEY`, your `config.py` should look similar to this
|
||||
|
||||
```python
|
||||
#!/usr/bin/python2.7
|
||||
|
||||
__author__ = 'pete.frisella@gmail.com (Pete Frisella)'
|
||||
|
||||
# OAuth 2.0 Client Settings
|
||||
AUTH_CONFIG = {
|
||||
'OAUTH_CLIENT_ID': 'YOUR_CLIENT_ID',
|
||||
'OAUTH_CLIENT_SECRET': 'YOUR_CLIENT_SECRET',
|
||||
'OAUTH_REDIRECT_URI': '%s%s' % (
|
||||
'https://chirpy-test-XXXXXX.ue.r.appspot.com',
|
||||
'/admin/auth'
|
||||
)
|
||||
}
|
||||
|
||||
# XSRF Settings
|
||||
XSRF_KEY = 'OnceUponATimeThereLivedALegend'
|
||||
```
|
||||
{: file="src/config.py"}
|
||||
|
||||
**Tip:** You can configure a custom domain instead of `https://PROJECT_ID.REGION_ID.r.appspot.com`. But, for the sake of keeping it simple, we will be using the Google provided default URL.
|
||||
|
||||
5. From inside the src/ directory, deploy the app
|
||||
|
||||
```console
|
||||
[root@bc96abf71ef8 src]# gcloud app deploy
|
||||
Services to deploy:
|
||||
|
||||
descriptor: [/tmp/google-analytics-super-proxy/src/app.yaml]
|
||||
source: [/tmp/google-analytics-super-proxy/src]
|
||||
target project: [chirpy-test-XXXX]
|
||||
target service: [default]
|
||||
target version: [VESRION_NUM]
|
||||
target url: [https://chirpy-test-XXXX.ue.r.appspot.com]
|
||||
|
||||
|
||||
Do you want to continue (Y/n)? Y
|
||||
|
||||
Beginning deployment of service [default]...
|
||||
╔════════════════════════════════════════════════════════════╗
|
||||
╠═ Uploading 1 file to Google Cloud Storage ═╣
|
||||
╚════════════════════════════════════════════════════════════╝
|
||||
File upload done.
|
||||
Updating service [default]...done.
|
||||
Setting traffic split for service [default]...done.
|
||||
Deployed service [default] to [https://chirpy-test-XXXX.ue.r.appspot.com]
|
||||
|
||||
You can stream logs from the command line by running:
|
||||
$ gcloud app logs tail -s default
|
||||
|
||||
To view your application in the web browser run:
|
||||
$ gcloud app browse
|
||||
```
|
||||
|
||||
6. Visit the deployed service. Add a `/admin` to the end of the URL.
|
||||
|
||||
7. Click on **Authorize Users** and make sure to add yourself as a managed user.
|
||||
|
||||
8. If you get any errors, please Google it. The errors are self-explanatory and should be easy to fix.
|
||||
|
||||
If everything went good, you'll get this screen:
|
||||
|
||||
{: width="1366" height="354"}
|
||||
|
||||
### Create Google Analytics Query
|
||||
|
||||
Head to `https://PROJECT_ID.REGION_ID.r.appspot.com/admin` and create a query after verifying the account. **GA Core Reporting API** query request can be created in [Query Explorer](https://ga-dev-tools.appspot.com/query-explorer/).
|
||||
|
||||
The query parameters are as follows:
|
||||
|
||||
- **start-date**: fill in the first day of blog posting
|
||||
- **end-date**: fill in `today` (this is a parameter supported by GA Report, which means that it will always end according to the current query date)
|
||||
- **metrics**: select `ga:pageviews`
|
||||
- **dimensions**: select `ga:pagePath`
|
||||
|
||||
In order to reduce the returned results and reduce the network bandwidth, we add custom filtering rules [^ga-filters]:
|
||||
|
||||
- **filters**: fill in `ga:pagePath=~^/posts/.*/$;ga:pagePath!@=`.
|
||||
|
||||
Among them, `;` means using _logical AND_ to concatenate two rules.
|
||||
|
||||
If the `site.baseurl` is specified, change the first filtering rule to `ga:pagePath=~^/BASE_URL/posts/.*/$`, where `BASE_URL` is the value of `site.baseurl`.
|
||||
|
||||
After <kbd>Run Query</kbd>, copy the generated contents of **API Query URI** at the bottom of the page, and fill in the **Encoded URI for the query** of SuperProxy on GAE.
|
||||
|
||||
After the query is saved on GAE, a **Public Endpoint** (public access address) will be generated, and we will get the query result in JSON format when accessing it. Finally, click <kbd>Enable Endpoint</kbd> in **Public Request Endpoint** to make the query effective, and click <kbd>Start Scheduling</kbd> in **Scheduling** to start the scheduled task.
|
||||
|
||||
{: width="1100" height="126"}
|
||||
|
||||
|
||||
## Configure Chirpy to Display Page View
|
||||
|
||||
Once all the hard part is done, it is very easy to enable the Page View on Chirpy theme. Your superProxy dashboard should look something like below and you can grab the required values.
|
||||
|
||||
{: width="1210" height="694"}
|
||||
|
||||
Update the `_config.yml` file of [**Chirpy**][chirpy-homepage] project with the values from your dashboard, to look similar to the following:
|
||||
|
||||
```yaml
|
||||
google_analytics:
|
||||
id: 'G-V6XXXXXXX' # fill in your Google Analytics ID
|
||||
pv:
|
||||
proxy_endpoint: 'https://PROJECT_ID.REGION_ID.r.appspot.com/query?id=<ID FROM SUPER PROXY>'
|
||||
cache_path: # the local PV cache data, friendly to visitors from GFW region
|
||||
```
|
||||
{: file="_config.yml"}
|
||||
|
||||
Now, you should see the Page View enabled on your blog.
|
||||
|
||||
## Reference
|
||||
|
||||
[^ga-filters]: [Google Analytics Core Reporting API: Filters](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters)
|
||||
|
||||
[chirpy-homepage]: https://github.com/cotes2020/jekyll-theme-chirpy/
|
||||
1733
_sass/addon/commons.scss
Normal file
1733
_sass/addon/commons.scss
Normal file
File diff suppressed because it is too large
Load Diff
115
_sass/addon/module.scss
Normal file
115
_sass/addon/module.scss
Normal file
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Mainly scss modules, only imported to `assets/css/main.scss`
|
||||
*/
|
||||
|
||||
/* ---------- scss placeholder --------- */
|
||||
|
||||
%heading {
|
||||
color: var(--heading-color);
|
||||
font-weight: 400;
|
||||
font-family: 'Lato', 'Microsoft Yahei', sans-serif;
|
||||
}
|
||||
|
||||
%tag-hover {
|
||||
background: var(--tag-hover);
|
||||
transition: background 0.35s ease-in-out;
|
||||
}
|
||||
|
||||
%table-cell {
|
||||
padding: 0.4rem 1rem;
|
||||
font-size: 95%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
%link-hover {
|
||||
color: #d2603a !important;
|
||||
border-bottom: 1px solid #d2603a;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
%link-color {
|
||||
color: var(--link-color);
|
||||
}
|
||||
|
||||
%link-underline {
|
||||
border-bottom: 1px solid var(--link-underline-color);
|
||||
}
|
||||
|
||||
%clickable-transition {
|
||||
transition: color 0.35s ease-in-out;
|
||||
}
|
||||
|
||||
%no-bottom-border {
|
||||
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;
|
||||
}
|
||||
|
||||
/* ---------- scss mixin --------- */
|
||||
|
||||
@mixin no-text-decoration {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
%sidebar-links {
|
||||
color: rgba(117, 117, 117, 0.9);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@mixin ml-mr($value) {
|
||||
margin-left: $value;
|
||||
margin-right: $value;
|
||||
}
|
||||
|
||||
@mixin pl-pr($val) {
|
||||
padding-left: $val;
|
||||
padding-right: $val;
|
||||
}
|
||||
|
||||
@mixin input-placeholder {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@mixin semi-bold {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@mixin label($font-size: 1rem, $font-weight: 600, $color: var(--label-color)) {
|
||||
color: $color;
|
||||
font-size: $font-size;
|
||||
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 {
|
||||
position: relative;
|
||||
left: 50%;
|
||||
-webkit-transform: translateX(-50%);
|
||||
-ms-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
262
_sass/addon/syntax.scss
Normal file
262
_sass/addon/syntax.scss
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* The syntax highlight.
|
||||
*/
|
||||
|
||||
@import "colors/light-syntax";
|
||||
@import "colors/dark-syntax";
|
||||
|
||||
html:not([mode]),
|
||||
html[mode=light] {
|
||||
@include light-syntax;
|
||||
}
|
||||
|
||||
html[mode=dark] {
|
||||
@include dark-syntax;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html:not([mode]),
|
||||
html[mode=dark] {
|
||||
@include dark-syntax;
|
||||
}
|
||||
|
||||
html[mode=light] {
|
||||
@include light-syntax;
|
||||
}
|
||||
}
|
||||
|
||||
/* -- Codes Snippet -- */
|
||||
|
||||
$code-radius: 6px;
|
||||
|
||||
%code-snippet-bg {
|
||||
background: var(--highlight-bg-color);
|
||||
}
|
||||
|
||||
%code-snippet-radius {
|
||||
border-radius: $code-radius;
|
||||
}
|
||||
|
||||
%code-snippet-padding {
|
||||
padding: 1.2rem;
|
||||
}
|
||||
|
||||
div > pre {
|
||||
@extend %code-snippet-bg;
|
||||
@extend %code-snippet-radius;
|
||||
@extend %code-snippet-padding;
|
||||
}
|
||||
|
||||
.highlighter-rouge {
|
||||
@extend %code-snippet-bg;
|
||||
@extend %code-snippet-radius;
|
||||
|
||||
color: var(--highlighter-rouge-color);
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 1.2em; /* Override BS Inline-code style */
|
||||
}
|
||||
|
||||
.highlight {
|
||||
@extend %code-snippet-radius;
|
||||
@extend %code-snippet-bg;
|
||||
|
||||
@at-root figure#{&} {
|
||||
@extend %code-snippet-bg;
|
||||
}
|
||||
|
||||
overflow: auto;
|
||||
|
||||
pre {
|
||||
margin-bottom: 0;
|
||||
font-size: $code-font-size;
|
||||
line-height: 1.4rem;
|
||||
word-wrap: normal; /* Fixed Safari overflow-x */
|
||||
}
|
||||
|
||||
table {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
td pre {
|
||||
overflow: visible; /* Fixed iOS safari overflow-x */
|
||||
word-break: normal; /* Fixed iOS safari linenos code break */
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.lineno {
|
||||
padding-right: 0.5rem;
|
||||
min-width: 2.2rem;
|
||||
text-align: right;
|
||||
color: var(--highlight-lineno-color);
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* set the dollar sign to non-selectable */
|
||||
.gp {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
} //.highlight
|
||||
|
||||
code {
|
||||
-webkit-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
hyphens: none;
|
||||
|
||||
&.highlighter-rouge {
|
||||
font-size: $code-font-size;
|
||||
padding: 3px 5px;
|
||||
border-radius: 4px;
|
||||
background-color: var(--inline-code-bg);
|
||||
}
|
||||
|
||||
@at-root a > &.highlighter-rouge {
|
||||
padding-bottom: 0; // show link's underlinke
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
@at-root a:hover > &.highlighter-rouge {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
blockquote &.highlighter-rouge {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
td.rouge-code {
|
||||
padding: 1.2rem 1.5rem 1.2rem 1rem;
|
||||
|
||||
// Prevent some browser extends from
|
||||
// changing the URL string of code block.
|
||||
a {
|
||||
color: inherit !important;
|
||||
border-bottom: none !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Hide line numbers for default, console, and terminal code snippets */
|
||||
div {
|
||||
&[class^='highlighter-rouge'],
|
||||
&.language-plaintext.highlighter-rouge,
|
||||
&.language-console.highlighter-rouge,
|
||||
&.language-terminal.highlighter-rouge,
|
||||
&.nolineno {
|
||||
pre.lineno {
|
||||
display: none;
|
||||
}
|
||||
td.rouge-code {
|
||||
@extend %code-snippet-padding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.code-header {
|
||||
background: var(--code-header-bg);
|
||||
border-top-left-radius: $code-radius;
|
||||
border-top-right-radius: $code-radius;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
line-height: 1.85rem;
|
||||
|
||||
// icons
|
||||
i {
|
||||
font-size: 1rem;
|
||||
color: var(--lang-badge-muted-color);
|
||||
|
||||
&.small {
|
||||
font-size: 70%;
|
||||
}
|
||||
}
|
||||
|
||||
// the label block
|
||||
span {
|
||||
padding-left: 0.35rem;
|
||||
|
||||
&::after {
|
||||
content: attr(text-data);
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
color: var(--lang-badge-color);
|
||||
}
|
||||
|
||||
i {
|
||||
margin: 0 0.5rem;
|
||||
}
|
||||
|
||||
@at-root [file] #{&} > i {
|
||||
position: relative;
|
||||
top: 1px; // center the file icon
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// clipboard
|
||||
button {
|
||||
border: 1px solid var(--code-header-bg);
|
||||
border-radius: $code-radius;
|
||||
padding: 0;
|
||||
width: 1.95rem;
|
||||
background-color: inherit;
|
||||
|
||||
@extend %cursor-pointer;
|
||||
|
||||
&[timeout] {
|
||||
&:hover {
|
||||
border-color: var(--clipboard-checked-color);
|
||||
}
|
||||
|
||||
i {
|
||||
color: var(--clipboard-checked-color);
|
||||
}
|
||||
}
|
||||
|
||||
&:not([timeout]):hover {
|
||||
background-color: rgba(128, 128, 128, 0.37);
|
||||
|
||||
i {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media all and (max-width: 576px) {
|
||||
.post-content {
|
||||
> div[class^='language-'] {
|
||||
@include ml-mr(-1.25rem);
|
||||
|
||||
border-radius: 0;
|
||||
|
||||
.highlight {
|
||||
padding-left: 0.25rem;
|
||||
}
|
||||
|
||||
.code-header {
|
||||
border-radius: 0;
|
||||
padding-left: 0.4rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
_sass/addon/variables.scss
Normal file
34
_sass/addon/variables.scss
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* The SCSS variables
|
||||
*/
|
||||
|
||||
/* sidebar */
|
||||
|
||||
$sidebar-width: 260px !default; // the basic width
|
||||
$sidebar-width-small: 210px !default; // screen width: >= 850px, <= 1199px (iPad landscape)
|
||||
$sidebar-width-large: 350px !default; // screen width: >= 1650px
|
||||
|
||||
/* tabs of sidebar */
|
||||
|
||||
$tab-count: 5 !default; // backward compatible (version <= 4.0.2)
|
||||
$tab-height: 3rem !default;
|
||||
$tab-cursor-height: 1.6rem !default;
|
||||
|
||||
$cursor-width: 2px !default; // the cursor width of the selected tab
|
||||
|
||||
/* other framework sizes */
|
||||
|
||||
$topbar-height: 3rem !default;
|
||||
|
||||
$footer-height: 5rem !default;
|
||||
$footer-height-mobile: 6rem !default; // screen width: <= 576px
|
||||
|
||||
$main-content-max-width: 1150px !default;
|
||||
|
||||
$panel-max-width: 300px !default;
|
||||
|
||||
$post-extend-min-height: 35rem !default;
|
||||
|
||||
/* syntax highlight */
|
||||
|
||||
$code-font-size: 0.85rem !default;
|
||||
88
_sass/colors/dark-syntax.scss
Normal file
88
_sass/colors/dark-syntax.scss
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* The syntax dark mode styles.
|
||||
*/
|
||||
|
||||
@mixin dark-syntax {
|
||||
/* syntax highlight colors from https://raw.githubusercontent.com/jwarby/pygments-css/master/monokai.css */
|
||||
.highlight pre { background-color: var(--highlight-bg-color); }
|
||||
.highlight .hll { background-color: var(--highlight-bg-color); }
|
||||
.highlight .c { color: #75715e; } /* Comment */
|
||||
.highlight .err { color: #960050; background-color: #1e0010; } /* Error */
|
||||
.highlight .k { color: #66d9ef; } /* Keyword */
|
||||
.highlight .l { color: #ae81ff; } /* Literal */
|
||||
.highlight .n { color: #f8f8f2; } /* Name */
|
||||
.highlight .o { color: #f92672; } /* Operator */
|
||||
.highlight .p { color: #f8f8f2; } /* Punctuation */
|
||||
.highlight .cm { color: #75715e; } /* Comment.Multiline */
|
||||
.highlight .cp { color: #75715e; } /* Comment.Preproc */
|
||||
.highlight .c1 { color: #75715e; } /* Comment.Single */
|
||||
.highlight .cs { color: #75715e; } /* Comment.Special */
|
||||
.highlight .ge { color: inherit; font-style: italic; } /* Generic.Emph */
|
||||
.highlight .gs { font-weight: bold; } /* Generic.Strong */
|
||||
.highlight .kc { color: #66d9ef; } /* Keyword.Constant */
|
||||
.highlight .kd { color: #66d9ef; } /* Keyword.Declaration */
|
||||
.highlight .kn { color: #f92672; } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #66d9ef; } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: #66d9ef; } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #66d9ef; } /* Keyword.Type */
|
||||
.highlight .ld { color: #e6db74; } /* Literal.Date */
|
||||
.highlight .m { color: #ae81ff; } /* Literal.Number */
|
||||
.highlight .s { color: #e6db74; } /* Literal.String */
|
||||
.highlight .na { color: #a6e22e; } /* Name.Attribute */
|
||||
.highlight .nb { color: #f8f8f2; } /* Name.Builtin */
|
||||
.highlight .nc { color: #a6e22e; } /* Name.Class */
|
||||
.highlight .no { color: #66d9ef; } /* Name.Constant */
|
||||
.highlight .nd { color: #a6e22e; } /* Name.Decorator */
|
||||
.highlight .ni { color: #f8f8f2; } /* Name.Entity */
|
||||
.highlight .ne { color: #a6e22e; } /* Name.Exception */
|
||||
.highlight .nf { color: #a6e22e; } /* Name.Function */
|
||||
.highlight .nl { color: #f8f8f2; } /* Name.Label */
|
||||
.highlight .nn { color: #f8f8f2; } /* Name.Namespace */
|
||||
.highlight .nx { color: #a6e22e; } /* Name.Other */
|
||||
.highlight .py { color: #f8f8f2; } /* Name.Property */
|
||||
.highlight .nt { color: #f92672; } /* Name.Tag */
|
||||
.highlight .nv { color: #f8f8f2; } /* Name.Variable */
|
||||
.highlight .ow { color: #f92672; } /* Operator.Word */
|
||||
.highlight .w { color: #f8f8f2; } /* Text.Whitespace */
|
||||
.highlight .mf { color: #ae81ff; } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #ae81ff; } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #ae81ff; } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #ae81ff; } /* Literal.Number.Oct */
|
||||
.highlight .sb { color: #e6db74; } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #e6db74; } /* Literal.String.Char */
|
||||
.highlight .sd { color: #e6db74; } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #e6db74; } /* Literal.String.Double */
|
||||
.highlight .se { color: #ae81ff; } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #e6db74; } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #e6db74; } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #e6db74; } /* Literal.String.Other */
|
||||
.highlight .sr { color: #e6db74; } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #e6db74; } /* Literal.String.Single */
|
||||
.highlight .ss { color: #e6db74; } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #f8f8f2; } /* Name.Builtin.Pseudo */
|
||||
.highlight .vc { color: #f8f8f2; } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #f8f8f2; } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #f8f8f2; } /* Name.Variable.Instance */
|
||||
.highlight .il { color: #ae81ff; } /* Literal.Number.Integer.Long */
|
||||
.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
|
||||
.highlight .gd { color: #f92672; background-color: #561c08; } /* Generic.Deleted & Diff Deleted */
|
||||
.highlight .gi { color: #a6e22e; background-color: #0b5858; } /* Generic.Inserted & Diff Inserted */
|
||||
|
||||
/* ----- custom styles ------ */
|
||||
|
||||
--highlight-bg-color: #252525;
|
||||
--highlighter-rouge-color: #de6b18;
|
||||
--highlight-lineno-color: #6c6c6d;
|
||||
--inline-code-bg: #272822;
|
||||
--code-header-bg: #353535;
|
||||
--lang-badge-color: #858586;
|
||||
--lang-badge-muted-color: #6c6c6d;
|
||||
--clipboard-checked-color: #2bcc2b;
|
||||
|
||||
.highlight {
|
||||
.gp { color: #818c96; }
|
||||
}
|
||||
|
||||
pre { color: #bfbfbf; } /* override Bootstrap */
|
||||
kbd { background-color: black; }
|
||||
}
|
||||
@@ -1,82 +1,83 @@
|
||||
/*!
|
||||
* The main dark mode styles
|
||||
* v2.0
|
||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
* © 2018-2019 Cotes Chung
|
||||
* MIT Licensed
|
||||
*/
|
||||
/*
|
||||
* The main dark mode styles
|
||||
*/
|
||||
|
||||
@mixin dark-scheme {
|
||||
/* framework */
|
||||
--main-wrapper-bg: rgb(27, 27, 30);
|
||||
/* Framework color */
|
||||
--body-bg: var(--main-wrapper-bg);
|
||||
--topbar-wrapper-bg: rgb(39, 40, 43);
|
||||
--search-wrapper-bg: rgb(34, 34, 39);
|
||||
--search-icon-color: rgb(100, 102, 105);
|
||||
--input-focus-border-color: rgb(112, 114, 115);
|
||||
--mask-bg: rgb(68, 69, 70);
|
||||
--footer-bg-color: var(--main-wrapper-bg);
|
||||
--main-wrapper-bg: rgb(27, 27, 30);
|
||||
--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-muted-color: rgb(107, 116, 124);
|
||||
--link-color: rgb(138, 180, 248);
|
||||
--link-underline-color: rgb(82, 108, 150);
|
||||
--main-border-color: rgb(44, 45, 45);
|
||||
--button-bg: rgb(39, 40, 33);
|
||||
--heading-color: #cccccc;
|
||||
--blockquote-border-color: rgb(66, 66, 66);
|
||||
--blockquote-text-color: rgb(117, 117, 117);
|
||||
|
||||
--link-color: rgb(138, 180, 248);
|
||||
--link-underline-color: rgb(82, 108, 150);
|
||||
--button-bg: rgb(39, 40, 43);
|
||||
--btn-border-color: rgb(63, 65, 68);
|
||||
--btn-backtotop-color: var(--text-color);
|
||||
--btn-backtotop-border-color: var(--btn-border-color);
|
||||
--btn-box-shadow: var(--main-wrapper-bg);
|
||||
|
||||
--card-bg: rgb(39, 40, 33);
|
||||
--card-header-bg: rgb(51, 50, 50);
|
||||
--label-relate-post: rgb(164, 175, 181);
|
||||
--label-color: rgb(108, 117, 125);
|
||||
--checkbox-color: rgb(118 120 121);
|
||||
--checkbox-checked-color: var(--link-color);
|
||||
|
||||
/* Sidebar */
|
||||
--nav-cursor-color: rgb(183, 182, 182);
|
||||
--sidebar-bg: radial-gradient(circle, #242424 0%, #1d1f27 100%);
|
||||
--sidebar-muted-color: #6d6c6b;
|
||||
--sidebar-active-color: rgb(255 255 255 / 80%);
|
||||
--nav-cursor-color: rgb(183, 182, 182);
|
||||
--sidebar-btn-bg: rgb(117 116 116 / 20%);
|
||||
|
||||
/* Top Bar */
|
||||
/* Topbar */
|
||||
--topbar-text-color: var(--text-color);
|
||||
--topbar-wrapper-bg: rgb(39, 40, 43);
|
||||
--search-wrapper-bg: rgb(34, 34, 39);
|
||||
--search-wrapper-border-color: rgb(34, 34, 39);
|
||||
--search-icon-color: rgb(100, 102, 105);
|
||||
--input-focus-border-color: rgb(112, 114, 115);
|
||||
|
||||
/* Home page */
|
||||
--post-list-text-color: rgb(175, 176, 177);
|
||||
--btn-patinator-text-color: var(--text-color);
|
||||
--btn-active-bg: rgba(28, 52, 94, 1);
|
||||
--btn-active-border-color: rgb(66, 94, 138);
|
||||
--btn-text-color: var(--text-color);
|
||||
--btn-paginator-hover-color: rgb(64, 65, 66);
|
||||
--btn-paginator-border-color: var(--btn-border-color);
|
||||
--btn-paginator-shadow: var(--main-wrapper-bg);
|
||||
--btn-text-color: var(--text-color);
|
||||
--pin-bg: rgb(34 35 37);
|
||||
--pin-color: inherit;
|
||||
|
||||
/* Posts */
|
||||
--toc-highlight: rgb(116, 178, 243);
|
||||
--tag-bg: rgb(41, 40, 40);
|
||||
--tag-hover: rgb(43, 56, 62);
|
||||
--tb-odd-bg: rgba(52, 53, 42, 0.52); /* odd rows of the posts' table */
|
||||
--tb-odd-bg: rgba(42, 47, 53, 0.52); /* odd rows of the posts' table */
|
||||
--tb-even-bg: rgb(31, 31, 34); /* even rows of the posts' table */
|
||||
--tb-even-border-color: var(--tb-odd-bg);
|
||||
--tb-even-border-color: var(--tb-odd-bg);
|
||||
--tb-border-color: var(--tb-odd-bg);
|
||||
--footnote-target-bg: rgb(63, 81, 181);
|
||||
--btn-share-color: #6c757d;
|
||||
--btn-share-hover-color: #bfc1ca;
|
||||
--relate-post-date: var(--text-muted-color);
|
||||
--card-border-color: var(--main-wrapper-bg);
|
||||
--card-bg: rgb(39, 40, 43);
|
||||
--card-border-color: rgb(53, 53, 60);
|
||||
--card-box-shadow: var(--main-wrapper-bg);
|
||||
|
||||
/* tags */
|
||||
--tag-border: rgb(59, 79, 88);
|
||||
--tag-shadow: rgb(32, 33, 33);
|
||||
--search-tag-bg: var(--tag-bg);
|
||||
|
||||
--dash-color: rgb(63, 65, 68);
|
||||
|
||||
/* categories */
|
||||
--categories-border: rgb(64, 66, 69);
|
||||
--categories-hover-bg: rgb(73, 75, 76);
|
||||
--categories-icon-hover-color: white;
|
||||
|
||||
/* archives */
|
||||
--timeline-node-bg: rgb(150, 152, 156);
|
||||
@@ -84,8 +85,12 @@
|
||||
--timeline-year-dot-color: var(--timeline-color);
|
||||
|
||||
/* Footer */
|
||||
---footer-link: rgb(146, 146, 146);
|
||||
--footer-bg-color: var(--main-wrapper-bg);
|
||||
--footer-link: rgb(171, 171, 171);
|
||||
|
||||
.post-content img {
|
||||
filter: brightness(90%);
|
||||
}
|
||||
|
||||
hr {
|
||||
border-color: var(--main-border-color);
|
||||
@@ -95,10 +100,10 @@
|
||||
nav[data-toggle=toc] .nav-link.active,
|
||||
nav[data-toggle=toc] .nav-link.active:focus,
|
||||
nav[data-toggle=toc] .nav-link.active:hover,
|
||||
nav[data-toggle=toc] .nav>li>a:focus,
|
||||
nav[data-toggle=toc] .nav>li>a:hover {
|
||||
color: var(--toc-highlight)!important;
|
||||
border-left-color: var(--toc-highlight)!important;
|
||||
nav[data-toggle=toc] .nav > li > a:focus,
|
||||
nav[data-toggle=toc] .nav > li > a:hover {
|
||||
color: var(--toc-highlight) !important;
|
||||
border-left-color: var(--toc-highlight) !important;
|
||||
}
|
||||
|
||||
/* categories */
|
||||
@@ -123,8 +128,13 @@
|
||||
}
|
||||
|
||||
#archives li:nth-child(odd) {
|
||||
background-image: linear-gradient(to left,
|
||||
rgb(26, 26, 30), rgb(39, 39, 45), rgb(39, 39, 45), rgb(39, 39, 45), rgb(26, 26, 30));
|
||||
background-image: linear-gradient(
|
||||
to left,
|
||||
rgb(26, 26, 30),
|
||||
rgb(39, 39, 45),
|
||||
rgb(39, 39, 45),
|
||||
rgb(39, 39, 45),
|
||||
rgb(26, 26, 30));
|
||||
}
|
||||
|
||||
} // dark-scheme
|
||||
79
_sass/colors/light-syntax.scss
Normal file
79
_sass/colors/light-syntax.scss
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* The syntax light mode code snippet colors.
|
||||
*/
|
||||
|
||||
@mixin light-syntax {
|
||||
/* see: <https://raw.githubusercontent.com/jwarby/pygments-css/master/github.css> */
|
||||
.highlight .hll { background-color: #ffffcc; }
|
||||
.highlight .c { color: #999988; font-style: italic; } /* Comment */
|
||||
.highlight .err { color: #a61717; background-color: #e3d2d2; } /* Error */
|
||||
.highlight .k { color: #000000; font-weight: bold; } /* Keyword */
|
||||
.highlight .o { color: #000000; font-weight: bold; } /* Operator */
|
||||
.highlight .cm { color: #999988; font-style: italic; } /* Comment.Multiline */
|
||||
.highlight .cp { color: #999999; font-weight: bold; font-style: italic; } /* Comment.Preproc */
|
||||
.highlight .c1 { color: #999988; font-style: italic; } /* Comment.Single */
|
||||
.highlight .cs { color: #999999; font-weight: bold; font-style: italic; } /* Comment.Special */
|
||||
.highlight .gd { color: #d01040; background-color: #ffdddd; } /* Generic.Deleted */
|
||||
.highlight .ge { color: #000000; font-style: italic; } /* Generic.Emph */
|
||||
.highlight .gr { color: #aa0000; } /* Generic.Error */
|
||||
.highlight .gh { color: #999999; } /* Generic.Heading */
|
||||
.highlight .gi { color: #008080; background-color: #ddffdd; } /* Generic.Inserted */
|
||||
.highlight .go { color: #888888; } /* Generic.Output */
|
||||
.highlight .gp { color: #555555; } /* Generic.Prompt */
|
||||
.highlight .gs { font-weight: bold; } /* Generic.Strong */
|
||||
.highlight .gu { color: #aaaaaa; } /* Generic.Subheading */
|
||||
.highlight .gt { color: #aa0000; } /* Generic.Traceback */
|
||||
.highlight .kc { color: #000000; font-weight: bold; } /* Keyword.Constant */
|
||||
.highlight .kd { color: #000000; font-weight: bold; } /* Keyword.Declaration */
|
||||
.highlight .kn { color: #000000; font-weight: bold; } /* Keyword.Namespace */
|
||||
.highlight .kp { color: #000000; font-weight: bold; } /* Keyword.Pseudo */
|
||||
.highlight .kr { color: #000000; font-weight: bold; } /* Keyword.Reserved */
|
||||
.highlight .kt { color: #445588; font-weight: bold; } /* Keyword.Type */
|
||||
.highlight .m { color: #009999; } /* Literal.Number */
|
||||
.highlight .s { color: #d01040; } /* Literal.String */
|
||||
.highlight .na { color: #008080; } /* Name.Attribute */
|
||||
.highlight .nb { color: #0086b3; } /* Name.Builtin */
|
||||
.highlight .nc { color: #445588; font-weight: bold; } /* Name.Class */
|
||||
.highlight .no { color: #008080; } /* Name.Constant */
|
||||
.highlight .nd { color: #3c5d5d; font-weight: bold; } /* Name.Decorator */
|
||||
.highlight .ni { color: #800080; } /* Name.Entity */
|
||||
.highlight .ne { color: #990000; font-weight: bold; } /* Name.Exception */
|
||||
.highlight .nf { color: #990000; font-weight: bold; } /* Name.Function */
|
||||
.highlight .nl { color: #990000; font-weight: bold; } /* Name.Label */
|
||||
.highlight .nn { color: #555555; } /* Name.Namespace */
|
||||
.highlight .nt { color: #000080; } /* Name.Tag */
|
||||
.highlight .nv { color: #008080; } /* Name.Variable */
|
||||
.highlight .ow { color: #000000; font-weight: bold; } /* Operator.Word */
|
||||
.highlight .w { color: #bbbbbb; } /* Text.Whitespace */
|
||||
.highlight .mf { color: #009999; } /* Literal.Number.Float */
|
||||
.highlight .mh { color: #009999; } /* Literal.Number.Hex */
|
||||
.highlight .mi { color: #009999; } /* Literal.Number.Integer */
|
||||
.highlight .mo { color: #009999; } /* Literal.Number.Oct */
|
||||
.highlight .sb { color: #d01040; } /* Literal.String.Backtick */
|
||||
.highlight .sc { color: #d01040; } /* Literal.String.Char */
|
||||
.highlight .sd { color: #d01040; } /* Literal.String.Doc */
|
||||
.highlight .s2 { color: #d01040; } /* Literal.String.Double */
|
||||
.highlight .se { color: #d01040; } /* Literal.String.Escape */
|
||||
.highlight .sh { color: #d01040; } /* Literal.String.Heredoc */
|
||||
.highlight .si { color: #d01040; } /* Literal.String.Interpol */
|
||||
.highlight .sx { color: #d01040; } /* Literal.String.Other */
|
||||
.highlight .sr { color: #009926; } /* Literal.String.Regex */
|
||||
.highlight .s1 { color: #d01040; } /* Literal.String.Single */
|
||||
.highlight .ss { color: #990073; } /* Literal.String.Symbol */
|
||||
.highlight .bp { color: #999999; } /* Name.Builtin.Pseudo */
|
||||
.highlight .vc { color: #008080; } /* Name.Variable.Class */
|
||||
.highlight .vg { color: #008080; } /* Name.Variable.Global */
|
||||
.highlight .vi { color: #008080; } /* Name.Variable.Instance */
|
||||
.highlight .il { color: #009999; } /* Literal.Number.Integer.Long */
|
||||
|
||||
/* --- custom light colors --- */
|
||||
--highlight-bg-color: #f7f7f7;
|
||||
--highlighter-rouge-color: #2f2f2f;
|
||||
--highlight-lineno-color: #c2c6cc;
|
||||
--inline-code-bg: #f3f3f3;
|
||||
--code-header-bg: #eaeaea;
|
||||
--lang-badge-color: rgb(128 128 128 / 87%);
|
||||
--lang-badge-muted-color: rgb(128 128 128 / 36%);
|
||||
--clipboard-checked-color: #43c743;
|
||||
|
||||
} // light-syntax
|
||||
@@ -1,124 +1,82 @@
|
||||
/*!
|
||||
* The syntax light mode typography colors
|
||||
* v2.1
|
||||
* https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
* © 2020 Cotes Chung
|
||||
* MIT Licensed
|
||||
*/
|
||||
/*
|
||||
* The syntax light mode typography colors
|
||||
*/
|
||||
|
||||
@mixin light-scheme {
|
||||
|
||||
/* Framework color */
|
||||
--body-bg: #fafafa;
|
||||
|
||||
--mask-bg: #c1c3c5;
|
||||
|
||||
--main-wrapper-bg: white;
|
||||
|
||||
--main-border-color: #f3f3f3;
|
||||
--scrollbar-track-bg: rgba(0, 0, 0, 0.3);
|
||||
--scrollbar-thumb-bg: rgba(0, 0, 0, 0.3);
|
||||
|
||||
--btn-border-color: #e9ecef;
|
||||
|
||||
--text-color: #343a40;
|
||||
|
||||
--blockquote-border-color: #eee;
|
||||
|
||||
--blockquote-text-color: #9a9a9a;
|
||||
|
||||
--link-color: #2a408e;
|
||||
|
||||
--link-underline-color: #dee2e6;
|
||||
|
||||
/* Common color */
|
||||
--text-color: #34343c;
|
||||
--text-muted-color: gray;
|
||||
|
||||
--tb-odd-bg: #f8f9fa;
|
||||
|
||||
--tb-even-border-color: rgba(210, 215, 217, 0.75);
|
||||
|
||||
--heading-color: black;
|
||||
--blockquote-border-color: #eee;
|
||||
--blockquote-text-color: #9a9a9a;
|
||||
--link-color: #2a408e;
|
||||
--link-underline-color: #dee2e6;
|
||||
--button-bg: #fff;
|
||||
|
||||
--btn-border-color: #e9ecef;
|
||||
--btn-backtotop-color: #686868;
|
||||
|
||||
--btn-backtotop-border-color: #f1f1f1; //--main-border-color,
|
||||
|
||||
--btn-backtotop-border-color: #f1f1f1;
|
||||
--btn-box-shadow: #eaeaea;
|
||||
--checkbox-color: #c5c5c5;
|
||||
--checkbox-checked-color: #07a8f7;
|
||||
|
||||
/* Sidebar */
|
||||
|
||||
--sidebar-bg: radial-gradient(
|
||||
circle, rgba(42, 30, 107, 1) 0%, rgba(35, 37, 46, 1) 100%);
|
||||
|
||||
--nav-cursor-color: #fcfcfc;
|
||||
--sidebar-bg: #eeeeee;
|
||||
--sidebar-muted-color: #a2a19f;
|
||||
--sidebar-active-color: #424242;
|
||||
--nav-cursor-color: #757575;
|
||||
--sidebar-btn-bg: white;
|
||||
|
||||
/* Topbar */
|
||||
|
||||
--topbar-wrapper-bg: white;
|
||||
|
||||
--topbar-text-color: rgb(78, 78, 78);
|
||||
|
||||
--search-wrapper-bg: #fff;
|
||||
|
||||
--search-wrapper-bg: #f5f5f5;
|
||||
|
||||
--topbar-wrapper-bg: white;
|
||||
--search-wrapper-bg: rgb(245 245 245 / 50%);
|
||||
--search-wrapper-border-color: rgb(245 245 245);
|
||||
--search-tag-bg: #f8f9fa;
|
||||
|
||||
--search-icon-color: #c2c6cc;
|
||||
|
||||
--input-focus-border-color: var(--btn-border-color);
|
||||
|
||||
/* Home */
|
||||
|
||||
/* Home page */
|
||||
--post-list-text-color: dimgray;
|
||||
|
||||
--btn-patinator-text-color: #555555;
|
||||
|
||||
--btn-active-bg: #2a408e;
|
||||
|
||||
--btn-active-border-color: #007bff;
|
||||
|
||||
--btn-text-color: #f8f8f8;
|
||||
|
||||
--btn-paginator-border-color: #f1f1f1;
|
||||
|
||||
--btn-paginator-shadow: #4b92d2;
|
||||
--btn-paginator-hover-color: var(--sidebar-bg);
|
||||
--btn-paginator-border-color: var(--sidebar-bg);
|
||||
--btn-text-color: #676666;
|
||||
--pin-bg: #f5f5f5;
|
||||
--pin-color: #999fa4;
|
||||
|
||||
/* Posts */
|
||||
|
||||
--btn-share-hover-color: var(--link-color);
|
||||
|
||||
--card-border-color: #f1f1f1;
|
||||
|
||||
--card-box-shadow: rgba(234, 234, 234, 0.7686274509803922);
|
||||
|
||||
--label-relate-post: #353a3d;
|
||||
|
||||
--relate-post-date: rgba(30, 55, 70, .4);
|
||||
|
||||
--label-color: #616161;
|
||||
--relate-post-date: rgba(30, 55, 70, 0.4);
|
||||
--footnote-target-bg: lightcyan;
|
||||
--tag-bg: rgba(0, 0, 0, 0.075);
|
||||
|
||||
--tag-border: #dee2e6;
|
||||
|
||||
--tag-shadow: var(--btn-border-color);
|
||||
|
||||
--tag-hover: rgb(222, 226, 230);
|
||||
|
||||
--categories-hover-bg: var(--btn-border-color);
|
||||
|
||||
--tb-odd-bg: #fbfcfd;
|
||||
--tb-border-color: #eaeaea;
|
||||
--dash-color: silver;
|
||||
|
||||
/* Categories */
|
||||
--categories-hover-bg: var(--btn-border-color);
|
||||
--categories-icon-hover-color: darkslategray;
|
||||
|
||||
/* Archive */
|
||||
|
||||
--timeline-color: rgba(0, 0, 0, 0.075);
|
||||
|
||||
--timeline-node-bg: #c2c6cc;
|
||||
|
||||
--timeline-year-dot-color: #ffffff;
|
||||
|
||||
/* Footer */
|
||||
|
||||
--footer-bg-color: #ffffff;
|
||||
|
||||
--footnote-target-bg: lightcyan;
|
||||
|
||||
---footer-link: inherit;
|
||||
}
|
||||
--footer-link: #424242;
|
||||
} // light-scheme
|
||||
24
_sass/jekyll-theme-chirpy.scss
Normal file
24
_sass/jekyll-theme-chirpy.scss
Normal file
@@ -0,0 +1,24 @@
|
||||
/*!
|
||||
* The styles for Jekyll theme Chirpy
|
||||
*
|
||||
* Chirpy v4.3.1 (https://github.com/cotes2020/jekyll-theme-chirpy)
|
||||
* © 2019 Cotes Chung
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
@import
|
||||
"colors/light-typography",
|
||||
"colors/dark-typography",
|
||||
|
||||
"addon/module",
|
||||
"addon/variables",
|
||||
"variables-hook",
|
||||
"addon/syntax",
|
||||
"addon/commons",
|
||||
|
||||
"layout/home",
|
||||
"layout/post",
|
||||
"layout/tags",
|
||||
"layout/archives",
|
||||
"layout/categories",
|
||||
"layout/category-tag";
|
||||
@@ -1,11 +1,5 @@
|
||||
---
|
||||
---
|
||||
/*!
|
||||
/*
|
||||
Style for Archives
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
MIT License
|
||||
*/
|
||||
|
||||
%date-timeline {
|
||||
@@ -20,37 +14,13 @@
|
||||
|
||||
#archives {
|
||||
letter-spacing: 0.03rem;
|
||||
li {
|
||||
font-size: 1.1rem;
|
||||
line-height: 3rem;
|
||||
&:nth-child(odd) {
|
||||
background-color: var(--main-wrapper-bg, #fff);
|
||||
background-image: linear-gradient(
|
||||
to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
||||
}
|
||||
>div {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
span.lead {
|
||||
font-size: 1.5rem;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
position: relative;
|
||||
left: 8px;
|
||||
|
||||
&:not(:first-child) {
|
||||
position: relative;
|
||||
left: 4px;
|
||||
&::after {
|
||||
left: 67px;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
/* Year dot */
|
||||
&::after { /* Year dot */
|
||||
content: "";
|
||||
display: block;
|
||||
position: relative;
|
||||
@@ -67,16 +37,72 @@
|
||||
box-shadow: 0 0 2px 0 #c2c6cc;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&:not(:first-child) {
|
||||
position: relative;
|
||||
left: 4px;
|
||||
&::after {
|
||||
left: 67px;
|
||||
}
|
||||
}
|
||||
|
||||
} // #archives span.lead
|
||||
|
||||
ul {
|
||||
li {
|
||||
font-size: 1.1rem;
|
||||
line-height: 3rem;
|
||||
|
||||
div {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
a {
|
||||
/* post title in Archvies */
|
||||
margin-left: 2.5rem;
|
||||
position: relative;
|
||||
top: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(odd) {
|
||||
background-color: var(--main-wrapper-bg, #fff);
|
||||
background-image: linear-gradient(to left, #fff, #fbfbfb, #fbfbfb, #fbfbfb, #fff);
|
||||
}
|
||||
|
||||
&::after {
|
||||
@extend %date-timeline;
|
||||
|
||||
height: 2.8rem;
|
||||
top: -1.3rem;
|
||||
}
|
||||
|
||||
&:first-child::before {
|
||||
@extend %date-timeline;
|
||||
|
||||
height: 3.06rem;
|
||||
top: -1.61rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(:last-child) > li:last-child::after {
|
||||
height: 3.4rem;
|
||||
}
|
||||
|
||||
&:last-child > li:last-child::after {
|
||||
display: none;
|
||||
}
|
||||
} // #archives ul
|
||||
|
||||
.date {
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
&.month {
|
||||
width: 1.4rem;
|
||||
text-align: center;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
~a::before {
|
||||
|
||||
~ a::before {
|
||||
/* A dot for Month and Day */
|
||||
content: "";
|
||||
display: inline-block;
|
||||
@@ -96,7 +122,7 @@
|
||||
}
|
||||
&.day {
|
||||
font-size: 85%;
|
||||
font-family: sans-serif;
|
||||
font-family: 'Lato', sans-serif;
|
||||
text-align: center;
|
||||
margin-right: -2px;
|
||||
width: 1.2rem;
|
||||
@@ -105,36 +131,8 @@
|
||||
}
|
||||
} // #archives .date
|
||||
|
||||
ul {
|
||||
>li {
|
||||
>div>a {
|
||||
/* post title in Archvies */
|
||||
margin-left: 2.5rem;
|
||||
position: relative;
|
||||
top: .1rem;
|
||||
}
|
||||
&::after {
|
||||
@extend %date-timeline;
|
||||
height: 2.8rem;
|
||||
top: -1.3rem;
|
||||
}
|
||||
&:first-child::before {
|
||||
@extend %date-timeline;
|
||||
height: 3.06rem;
|
||||
top: -1.61rem;
|
||||
}
|
||||
}
|
||||
&:not(:last-child)>li:last-child::after {
|
||||
height: 3.4rem;
|
||||
}
|
||||
&:last-child>li:last-child::after {
|
||||
display: none;
|
||||
}
|
||||
} // #archives ul
|
||||
|
||||
} // #archives
|
||||
|
||||
|
||||
@media all and (max-width: 576px) {
|
||||
#archives {
|
||||
margin-top: -1rem;
|
||||
@@ -1,11 +1,5 @@
|
||||
---
|
||||
---
|
||||
/*!
|
||||
/*
|
||||
Style for Tab Categories
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
MIT License
|
||||
*/
|
||||
|
||||
%category-icon-color {
|
||||
@@ -14,16 +8,22 @@
|
||||
|
||||
.categories {
|
||||
margin-bottom: 2rem;
|
||||
|
||||
.card-header {
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
i {
|
||||
@extend %category-icon-color;
|
||||
|
||||
font-size: 86%; // fontawesome icons
|
||||
}
|
||||
|
||||
.list-group-item {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
padding-left: 2rem;
|
||||
>i {
|
||||
@extend %category-icon-color;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
@@ -31,16 +31,6 @@
|
||||
|
||||
}
|
||||
|
||||
.card-header>span>i:first-child {
|
||||
@extend %category-icon-color;
|
||||
}
|
||||
|
||||
i {
|
||||
&.far, &.fas {
|
||||
font-size: 86%; // fontawesome icons
|
||||
}
|
||||
}
|
||||
|
||||
} // .categories
|
||||
|
||||
.category-trigger {
|
||||
@@ -48,12 +38,19 @@
|
||||
height: 1.7rem;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
color: #6c757d!important;
|
||||
>i.fas {
|
||||
color: #6c757d !important;
|
||||
|
||||
&:hover {
|
||||
i {
|
||||
color: var(--categories-icon-hover-color);
|
||||
}
|
||||
}
|
||||
|
||||
i {
|
||||
position: relative;
|
||||
height: .7rem;
|
||||
height: 0.7rem;
|
||||
width: 1rem;
|
||||
transition: 300ms ease all;
|
||||
transition: transform 300ms ease;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
---
|
||||
---
|
||||
/*!
|
||||
/*
|
||||
Style for page Category and Tag
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
MIT License
|
||||
*/
|
||||
@import "_addon/module";
|
||||
|
||||
#page-category, #page-tag {
|
||||
ul>li {
|
||||
.dash {
|
||||
margin: 0 .5rem .6rem .5rem;
|
||||
border-bottom: 2px dotted var(--dash-color);
|
||||
}
|
||||
|
||||
#page-category,
|
||||
#page-tag {
|
||||
ul > li {
|
||||
line-height: 1.5rem;
|
||||
padding: .6rem 0;
|
||||
padding: 0.6rem 0;
|
||||
|
||||
&::before { // dot
|
||||
background: #999;
|
||||
width: 5px;
|
||||
@@ -21,49 +21,48 @@
|
||||
display: block;
|
||||
content: "";
|
||||
position: relative;
|
||||
top: .6rem;
|
||||
margin-right: .5rem;
|
||||
top: 0.6rem;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
>a { /* post's title */
|
||||
font-size: 1.1rem;
|
||||
|
||||
> a { /* post's title */
|
||||
@extend %no-bottom-border;
|
||||
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
>span:last-child {
|
||||
|
||||
> span:last-child {
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* post's date */
|
||||
} /* post's date */
|
||||
}
|
||||
}
|
||||
|
||||
#page-tag h1>i { // tag icon
|
||||
#page-tag h1 > i { // tag icon
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
#page-category h1>i {
|
||||
#page-category h1 > i {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
#page-category &,
|
||||
#page-tag &,
|
||||
#access-lastmod & {
|
||||
#page-category,
|
||||
#page-tag,
|
||||
#access-lastmod {
|
||||
a:hover {
|
||||
@extend %link-hover;
|
||||
|
||||
margin-bottom: -1px; // Avoid jumping
|
||||
}
|
||||
}
|
||||
|
||||
.dash {
|
||||
margin: 0 .5rem .6rem .5rem;
|
||||
border-bottom: 2px dotted var(--dash-color);
|
||||
}
|
||||
|
||||
@media all and (max-width: 576px) {
|
||||
#page-category, #page-tag {
|
||||
ul>li {
|
||||
#page-category,
|
||||
#page-tag {
|
||||
ul > li {
|
||||
&::before {
|
||||
margin: 0 .5rem;
|
||||
}
|
||||
>a {
|
||||
> a {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
173
_sass/layout/home.scss
Normal file
173
_sass/layout/home.scss
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
Style for Homepage
|
||||
*/
|
||||
|
||||
.pagination {
|
||||
color: var(--btn-patinator-text-color);
|
||||
font-family: 'Lato', sans-serif;
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page-item {
|
||||
.page-link {
|
||||
color: inherit;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
padding: 0;
|
||||
display: -webkit-box;
|
||||
-webkit-box-pack: center;
|
||||
-webkit-box-align: center;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--btn-paginator-border-color);
|
||||
background-color: var(--button-bg);
|
||||
&:hover {
|
||||
background-color: var(--btn-paginator-hover-color);
|
||||
}
|
||||
}
|
||||
&.active {
|
||||
.page-link {
|
||||
background-color: var(--btn-paginator-hover-color);
|
||||
color: var(--btn-text-color);
|
||||
}
|
||||
}
|
||||
&.disabled {
|
||||
cursor: not-allowed;
|
||||
.page-link {
|
||||
color: rgba(108, 117, 125, 0.57);
|
||||
border-color: var(--btn-paginator-border-color);
|
||||
background-color: var(--button-bg);
|
||||
}
|
||||
}
|
||||
&:first-child .page-link,
|
||||
&:last-child .page-link {
|
||||
border-radius: 50%;
|
||||
}
|
||||
} // .page-item
|
||||
|
||||
} // .pagination
|
||||
|
||||
#post-list {
|
||||
margin-top: 1rem;
|
||||
padding-right: 0.5rem;
|
||||
|
||||
.post-preview {
|
||||
padding-top: 1.5rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--main-border-color);
|
||||
|
||||
a:hover {
|
||||
@extend %link-hover;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.4rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
i {
|
||||
font-size: 0.73rem;
|
||||
}
|
||||
span:not(:last-child) {
|
||||
margin-right: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.post-content {
|
||||
margin-top: 0.6rem;
|
||||
margin-bottom: 0.6rem;
|
||||
color: var(--post-list-text-color);
|
||||
> p {
|
||||
/* Make preview shorter on the homepage */
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
|
||||
.pin {
|
||||
> i {
|
||||
transform: rotate(45deg);
|
||||
padding-left: 3px;
|
||||
color: var(--pin-color);
|
||||
}
|
||||
> span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
} // .post-preview
|
||||
|
||||
} // #post-list
|
||||
|
||||
/* Hide SideBar and TOC */
|
||||
@media all and (max-width: 830px) {
|
||||
.pagination {
|
||||
justify-content: space-evenly;
|
||||
|
||||
.page-item {
|
||||
&:not(:first-child):not(:last-child) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Sidebar is visible */
|
||||
@media all and (min-width: 831px) {
|
||||
|
||||
#post-list {
|
||||
margin-top: 1.5rem;
|
||||
.post-preview .post-meta {
|
||||
.pin {
|
||||
background: var(--pin-bg);
|
||||
border-radius: 5px;
|
||||
line-height: 1.4rem;
|
||||
height: 1.3rem;
|
||||
margin-top: 3px;
|
||||
padding-left: 1px;
|
||||
padding-right: 6px;
|
||||
|
||||
> span {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
font-size: 0.85rem;
|
||||
|
||||
.page-item {
|
||||
&:not(:last-child) {
|
||||
margin-right: 0.7rem;
|
||||
}
|
||||
|
||||
.page-link {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.page-index {
|
||||
display: none;
|
||||
}
|
||||
|
||||
} // .pagination
|
||||
|
||||
}
|
||||
|
||||
/* Pannel hidden */
|
||||
@media all and (max-width: 1200px) {
|
||||
#post-list {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,10 @@
|
||||
---
|
||||
---
|
||||
/*!
|
||||
/*
|
||||
Post-specific style
|
||||
v2.0
|
||||
https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
© 2019 Cotes Chung
|
||||
MIT License
|
||||
*/
|
||||
@import "_addon/variables";
|
||||
|
||||
$prompt-older: "{{ site.data.label.post.button.previous }}";
|
||||
$prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
|
||||
@mixin btn-sharing-color($light-color, $important: false) {
|
||||
@if $important {
|
||||
color: var(--btn-share-color, $light-color)!important;
|
||||
color: var(--btn-share-color, $light-color) !important;
|
||||
} @else {
|
||||
color: var(--btn-share-color, $light-color);
|
||||
}
|
||||
@@ -26,82 +16,99 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
border-color: var(--btn-border-color);
|
||||
}
|
||||
|
||||
.post img {
|
||||
margin-top: .5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
// filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.08));
|
||||
position: relative;
|
||||
left: 50%;
|
||||
-webkit-transform: translateX(-50%);
|
||||
-ms-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
@mixin dot($pl: 0.2rem, $pr: 0.4rem) {
|
||||
content: "\2022";
|
||||
color: rgba(158, 158, 158, 0.8);
|
||||
padding-left: $pl;
|
||||
padding-right: $pr;
|
||||
}
|
||||
|
||||
#post-wrapper .post-meta {
|
||||
> div:nth-child(2) {
|
||||
> span:not(:first-child)::before {
|
||||
@include dot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.post-content {
|
||||
.preview-img {
|
||||
@include align-center;
|
||||
|
||||
margin-top: 0;
|
||||
margin-bottom: 2.5rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
.post-tail-wrapper {
|
||||
margin-top: 5rem;
|
||||
margin-top: 6rem;
|
||||
border-bottom: 1px double var(--main-border-color);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.post-navigation {
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 2rem;
|
||||
padding-bottom: 4rem;
|
||||
|
||||
.btn {
|
||||
@include btn-post-nav;
|
||||
|
||||
color: var(--link-color);
|
||||
|
||||
&:hover {
|
||||
background: #2a408e;
|
||||
color: #fff;
|
||||
border-color: #2a408e;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
@include btn-post-nav;
|
||||
|
||||
pointer-events: auto;
|
||||
cursor: not-allowed;
|
||||
background: none;
|
||||
color: gray;
|
||||
|
||||
&:hover {
|
||||
border-color: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-outline-primary.disabled:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
&::before {
|
||||
color: var(--text-muted-color);
|
||||
font-size: 0.65rem;
|
||||
text-transform: uppercase;
|
||||
content: attr(prompt);
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
left: 0.5px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
right: 0.5px;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.5rem;
|
||||
margin-top: .3rem;
|
||||
margin-top: 0.3rem;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
a, span {
|
||||
&::before {
|
||||
color: var(--text-muted-color);
|
||||
font-size: .65rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
&:first-child {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
left: .5px;
|
||||
&::before {
|
||||
content: $prompt-older
|
||||
}
|
||||
}
|
||||
&:last-child {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
right: .5px;
|
||||
&::before {
|
||||
content: $prompt-newer
|
||||
}
|
||||
}
|
||||
}
|
||||
} // .post-navigation
|
||||
|
||||
@keyframes fade-up {
|
||||
@@ -123,46 +130,52 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
position: sticky;
|
||||
top: 4rem;
|
||||
transition: top 0.2s ease-in-out;
|
||||
animation: fade-up .8s;
|
||||
animation: fade-up 0.8s;
|
||||
&.topbar-down {
|
||||
top: 6rem;
|
||||
}
|
||||
>h3 {
|
||||
font-size: 1rem;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
color: gray;
|
||||
> span {
|
||||
@include panel-label;
|
||||
}
|
||||
}
|
||||
|
||||
#toc li>a {
|
||||
line-height: 1rem;
|
||||
padding-top: .5rem;
|
||||
padding-bottom: .5rem;
|
||||
#toc li a {
|
||||
font-size: 0.8rem;
|
||||
|
||||
&.nav-link:not(.active) {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
nav[data-toggle=toc] {
|
||||
.nav {
|
||||
.nav > li > a.active {
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--- Related Posts ---*/
|
||||
/* --- Related Posts --- */
|
||||
|
||||
#related-posts {
|
||||
>h3 {
|
||||
color: gray;
|
||||
font-size: 1.1rem;
|
||||
font-family: 'Oswald', sans-serif;
|
||||
> h3 {
|
||||
@include label(1.1rem, 600);
|
||||
}
|
||||
.card {
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-color: var(--card-border-color);
|
||||
background-color: var(--card-bg);
|
||||
box-shadow: 0 0 5px 0 var(--card-box-shadow);
|
||||
-webkit-transition: all .3s ease-in-out;
|
||||
-moz-transition: all .3s ease-in-out;
|
||||
transition: all .3s ease-in-out;
|
||||
-webkit-transition: all 0.3s ease-in-out;
|
||||
-moz-transition: all 0.3s ease-in-out;
|
||||
transition: all 0.3s ease-in-out;
|
||||
h3 {
|
||||
color: var(--label-relate-post);
|
||||
color: var(--text-color);
|
||||
}
|
||||
&:hover {
|
||||
-webkit-transform: translate3d(0, -3px, 0);
|
||||
transform: translate3d(0, -3px, 0);
|
||||
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
|
||||
box-shadow: 0 10px 15px -4px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +184,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: .9rem;
|
||||
margin-bottom: .5rem;
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 0.5rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
@@ -187,7 +200,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding-inline-start: 1.5rem;
|
||||
>li::before {
|
||||
> li::before {
|
||||
background: #c2c9d4;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
@@ -203,6 +216,12 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
|
||||
#post-extend-wrapper {
|
||||
min-height: 2rem;
|
||||
|
||||
#disqus_thread {
|
||||
min-height: 7.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.post-tail-bottom a {
|
||||
@@ -210,34 +229,39 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
}
|
||||
|
||||
%btn-share-hovor {
|
||||
color: var(--btn-share-hover-color)!important;
|
||||
color: var(--btn-share-hover-color) !important;
|
||||
}
|
||||
|
||||
.share-wrapper {
|
||||
vertical-align: middle;
|
||||
user-select: none;
|
||||
|
||||
.share-icons {
|
||||
font-size: 1.2rem;
|
||||
a {
|
||||
&:not(:last-child) {
|
||||
margin-right: .25rem;
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
>i {
|
||||
> i {
|
||||
@extend %btn-share-hovor;
|
||||
}
|
||||
}
|
||||
}
|
||||
>i {
|
||||
padding-top: .35rem;
|
||||
> i {
|
||||
position: relative;
|
||||
bottom: 1px;
|
||||
|
||||
@extend %cursor-pointer;
|
||||
|
||||
&:hover {
|
||||
@extend %btn-share-hovor;
|
||||
}
|
||||
}
|
||||
.fab {
|
||||
&.fa-twitter {
|
||||
@include btn-sharing-color(rgba(29, 161, 242, 1.00));
|
||||
@include btn-sharing-color(rgba(29, 161, 242, 1));
|
||||
}
|
||||
&.fa-facebook-square {
|
||||
@include btn-sharing-color(rgb(66, 95, 156));
|
||||
@@ -258,9 +282,9 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
|
||||
} // .share-wrapper
|
||||
|
||||
|
||||
.share-label {
|
||||
font-family: 'Oswald', sans-serif;
|
||||
@include label(inherit, 400, inherit);
|
||||
|
||||
&::after {
|
||||
content: ":";
|
||||
}
|
||||
@@ -268,103 +292,57 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
|
||||
|
||||
.license-wrapper {
|
||||
line-height: 1.2rem;
|
||||
.license-text>a {
|
||||
> a {
|
||||
font-weight: 600;
|
||||
&:hover {
|
||||
@extend %link-hover;
|
||||
}
|
||||
i {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
span:last-child {
|
||||
font-size: .85rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
} // .license-wrapper
|
||||
|
||||
|
||||
@media all and (max-width: 576px) {
|
||||
.post-tail-bottom {
|
||||
-ms-flex-wrap: wrap!important;
|
||||
flex-wrap: wrap!important;
|
||||
-ms-flex-wrap: wrap-reverse !important;
|
||||
flex-wrap: wrap-reverse !important;
|
||||
>div:first-child {
|
||||
margin-bottom: 1rem;
|
||||
width: 100%;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
.post img {
|
||||
.post-content > p > img {
|
||||
max-width: calc(100% + 1rem);
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) {
|
||||
.post {
|
||||
#post-wrapper {
|
||||
.post-meta {
|
||||
>div:not(:first-child)::before {
|
||||
content: "\2022";
|
||||
color: rgba(158, 158, 158, 0.8);
|
||||
font-weight: bold;
|
||||
padding-left: .5rem;
|
||||
padding-right: .3rem;
|
||||
@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;
|
||||
-webkit-box-orient: horizontal !important;
|
||||
-webkit-box-direction: normal !important;
|
||||
-ms-flex-direction: row !important;
|
||||
flex-direction: row !important;
|
||||
}
|
||||
}
|
||||
} // .post
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 830px) {
|
||||
.post img {
|
||||
max-width: calc(100% + 2rem);
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide SideBar and TOC */
|
||||
@media all and (max-width: 830px) {
|
||||
.post img {
|
||||
position: relative;
|
||||
left: 50%;
|
||||
-webkit-transform: translateX(-50%);
|
||||
-ms-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.post-navigation {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
margin-left: -.5rem;
|
||||
margin-right: -.5rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
The following resposive design aim to
|
||||
make #post-extend-wrapper margin-right same as pannel's width
|
||||
*/
|
||||
@media all and (min-width: 1200px) {
|
||||
#post-extend-wrapper {
|
||||
margin-right: 25%;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 1460px) {
|
||||
#post-extend-wrapper {
|
||||
margin-right: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 1650px) {
|
||||
#post-extend-wrapper {
|
||||
margin-right: calc((100% - 1150px) / 10 + 300px);
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 1700px) {
|
||||
#post-extend-wrapper {
|
||||
margin-right: calc((100% - 1150px) / 8 + 300px);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user