1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 21:53:26 +00:00

Compare commits

..

660 Commits
v2.2 ... v5.1.0

Author SHA1 Message Date
Cotes Chung
3969b28743 Bump version to 5.1.0 2022-02-14 23:59:48 +08:00
Cotes Chung
5f31fbcf72 Enhance versioning tools 2022-02-14 23:59:17 +08:00
Cotes Chung
4986db1204 Improve SCSS comment symbols: change // to /* */ 2022-02-14 23:39:50 +08:00
Cotes Chung
508d3c5c6a Update docs 2022-02-14 22:15:38 +08:00
Cotes Chung
35e013f7fd Adapt the search input to Bootstrap 4.6 2022-02-14 22:15:38 +08:00
Cotes Chung
e52dc9551c Beautify heading style (margin, anchor) 2022-02-14 22:15:38 +08:00
Cotes Chung
5753118d8b Keep the original image shadow of the theme
Bootstrap 4.6.x has its own class `.shadow`
2022-02-14 21:41:50 +08:00
Cotes Chung
5295bbf4f9 Merge branch 'feature/expand-prompt' 2022-02-14 21:39:10 +08:00
Cotes Chung
cfd05d1aa5 Update prompt related docs 2022-02-14 20:14:39 +08:00
Cotes Chung
6c4d0e0def Rename prompt type note to info 2022-02-14 20:14:39 +08:00
Cotes Chung
15cfa84ddb Add tip type prompt 2022-02-13 03:08:57 +08:00
Cotes Chung
08a993be90 Bypass hidden posts in home page pagination (fix #504) 2022-02-12 06:10:21 +08:00
Cotes Chung
2b66ad0441 Update readme 2022-02-12 06:06:42 +08:00
Cotes Chung
0f6b170e24 Use constants to define resources for utterances
Self-host the JS for `utterances` is not necessary, because the list of comments cannot be loaded if the network is offline.
2022-02-12 05:47:48 +08:00
Cotes Chung
4df4f7f8db Add Giscus comments support (resolve #501) 2022-02-12 05:47:48 +08:00
Cotes Chung
09f1ded60c Merge branch 'feature/configurable-assets-cdn' 2022-02-10 04:14:03 +08:00
Cotes Chung
70e089c392 Add introduction to new features 2022-02-10 04:12:35 +08:00
Cotes Chung
dc42b6f800 Add assets submodule 2022-02-10 04:12:35 +08:00
Cotes Chung
3685685b28 Make the source of the static assets configurable
- Easy to switch between different CDN
- Allow self-host static assets
2022-02-10 04:12:35 +08:00
Cotes Chung
51688ccc9f Correct the branches that triggers gh-action 2022-02-04 06:47:03 +08:00
Cotes Chung
3db6de0abb Update project description 2022-02-04 06:23:09 +08:00
Cotes Chung
b27258899b Clear references to deleted folder docs 2022-02-04 06:23:09 +08:00
Cotes Chung
cfe9029cd1 Remove unused HTML attribute from sidebar 2022-02-04 06:23:09 +08:00
Cotes Chung
2c5e67f02b Improve the SW cache list 2022-02-04 06:23:09 +08:00
Cotes Chung
7a392510e6 Remove unused include from layouts 2022-02-03 01:04:42 +08:00
Cotes Chung
85fe258b20 Migrate the images from jsDelivr CDN to GitHub
jsDelivr does not allow caching of website images to their CDN!

see: <https://www.jsdelivr.com/terms/acceptable-use-policy-jsdelivr-net#2-hard-limits-and-restrictions>
2022-01-29 01:08:52 +08:00
Cotes Chung
55fd119d35 Fix hover color for links at the tail of posts 2022-01-28 23:48:46 +08:00
Cotes Chung
fc36f8b66d Improve the color of prompts 2022-01-28 23:48:46 +08:00
Cotes Chung
a5d38e7fbc Improve local datetime display
- Protect author's location privacy
- Reduce locale configuration parameters
2022-01-28 23:45:29 +08:00
Cotes Chung
a24545ed60 Prevent relative time conversion failure on Safari 2022-01-25 01:18:25 +08:00
Cotes Chung
66e655f09b Escape the post sharing URL (fix #496) 2022-01-23 05:11:14 +08:00
Cotes Chung
c3b2151ca0 Simplify the wiki 2022-01-23 04:30:54 +08:00
Cotes Chung
3d8184602b Merge branch 'feature/filepath-code' 2022-01-23 04:04:38 +08:00
Cotes Chung
c344926886 Show the filepath style in docs 2022-01-23 03:57:20 +08:00
Cotes Chung
756465d621 Add filepath style for code 2022-01-23 03:49:28 +08:00
Cotes Chung
7b0e9a6803 Merge branch 'feature/prompt-blockquote' 2022-01-23 02:00:48 +08:00
Cotes Chung
f043123f23 Introduce the prompts in docs 2022-01-23 01:59:36 +08:00
Cotes Chung
ca181422a6 Add blockquote prompts (resolve #489) 2022-01-23 01:59:36 +08:00
Cotes Chung
4845f6ef14 Fix attribute name of share URL button 2022-01-19 17:54:50 +08:00
Cotes Chung
031e878620 Travis: using the minimal environment when updating starter 2022-01-19 17:22:29 +08:00
Oaker Min
166c05bcd1 Update the telegram share URL of the post (#490)
Telegram API update
2022-01-19 01:36:00 +08:00
Cotes Chung
0890147423 Merge branch 'feature/docs' 2022-01-19 01:27:33 +08:00
Cotes Chung
323a888160 Update docs in real time 2022-01-19 00:30:55 +08:00
Cotes Chung
7788a140f2 Update prerequisites in tutorial (resolve #484) 2022-01-19 00:23:16 +08:00
Cotes Chung
1b379e3870 Improve chapter levels of guide 2022-01-19 00:23:16 +08:00
Cotes Chung
640bde95c4 Fix tutorial on writing posts 2022-01-19 00:23:16 +08:00
Roman Kvasnytskyi
1a93d5e557 Added russian and ukrainian translation and locales (#485) 2022-01-16 00:13:09 +08:00
Oaker Min
b8c3ea221e Added Burmese translation and locales (#483) 2022-01-15 17:59:39 +08:00
Tamme Schichler
4a2016a9e3 Don't include Google Analytics scripts without analytics id (#482) 2022-01-14 19:03:16 +08:00
Cotes Chung
a6c73e8f4f Avoid image caption shifting on load 2022-01-13 01:07:47 +08:00
Cotes Chung
f8f4dd889e Normalized attribute name in HTML
Add prefix `data-` for following attributes:
- `topbar-visible`
- `mode`
- `label-text`
- `title-succeed`
2022-01-13 00:23:08 +08:00
Cotes Chung
96e7cd79af Avoid whitespace before anchors when wrapping 2022-01-12 22:51:38 +08:00
Cotes Chung
22c12a4d34 Merge branch 'feature/improve-topabar-ux-on-mobile' 2022-01-09 19:12:50 +08:00
Cotes Chung
2cef631385 Hide topbar when mobile orientation in landscape mode (resolve #459) 2022-01-09 19:09:29 +08:00
Cotes Chung
9620eddd12 Simplify the top-bar title detect process 2022-01-08 02:57:16 +08:00
Cotes Chung
dbf86a2309 Merge branch 'hotfix/5.0.2' 2022-01-08 02:44:36 +08:00
Cotes Chung
2d02a6415d Bump version to 5.0.2 2022-01-08 02:44:19 +08:00
Cotes Chung
67bd6679b9 Update travis: deploy only when tagging
The bundler cache is also disabled because the tag name is always changing
2022-01-08 02:43:06 +08:00
Cotes Chung
f2a2792405 Fix responsive design of search hints 2022-01-08 02:28:10 +08:00
Cotes Chung
837d0778b6 Avoid preview-image delaying the switching of the top bar title (mobile views)
Use Intersection Observer API to optimize the performance of title switching
2022-01-08 02:28:10 +08:00
Cotes Chung
97ae2bf6c0 Update ReadMe 2022-01-08 01:19:49 +08:00
Cotes Chung
e7b377cf63 Prevent the top bar from covering the heading when scrolling down (in mobile views) 2022-01-06 21:46:08 +08:00
Cotes Chung
b0815b53c0 Enable smooth scrolling for layout page 2022-01-06 21:46:00 +08:00
Josh Johanning
4dd0c6d16f improve english locales for recently updated posts 2022-01-05 16:35:07 +08:00
Cotes Chung
57a76097d6 Merge branch 'hotfix/5.0.1' 2022-01-05 03:14:38 +08:00
Cotes Chung
22e2367b45 Bump version to 5.0.1 2022-01-05 03:11:24 +08:00
Cotes Chung
b44bf78f10 Improve the creation of header anchors (fix #474) 2022-01-05 02:36:07 +08:00
Cotes Chung
948356d7d6 Fix <img> HTML element refactoring issue (resolve #476, close #477) 2022-01-05 02:36:07 +08:00
Cotes Chung
7337fa5f20 Merge branch 'feature/docs' 2022-01-04 06:49:45 +08:00
Cotes Chung
44acea2f5d Add content to the contributing guidelines 2022-01-04 06:48:41 +08:00
Cotes Chung
65a38c8f22 Simplify the README 2022-01-04 05:20:31 +08:00
Cotes Chung
b91b6711b0 Update the tutorial on comments and image attributes 2022-01-04 02:20:58 +08:00
Cotes Chung
aeb2d57b60 Bump version to 5.0.0 2022-01-03 00:44:23 +08:00
Cotes Chung
2406ce1dc8 Merge branch 'feature/docs' 2022-01-03 00:42:16 +08:00
Cotes Chung
bec9246823 Fix preview image brightness in dark mode 2022-01-03 00:32:57 +08:00
Cotes Chung
adaefc02e9 Update docs 2022-01-03 00:17:30 +08:00
Cotes Chung
ee7266ff0d Update mockup image 2022-01-03 00:17:30 +08:00
Cotes Chung
cad62feb91 Beautify the style of <kbd> (resolve #471) 2022-01-02 16:28:42 +08:00
Cotes Chung
b85cb39388 Replace the demo website URL with a permalink 2022-01-02 16:17:32 +08:00
Cotes Chung
4360e2938c Avoid Disqus jitter 2021-12-31 20:49:00 +08:00
Cotes Chung
ecf31ff308 Fix the code style of SASS 2021-12-31 00:33:04 +08:00
Cotes Chung
37344ef0df Merge branch 'feature/post-img-path' 2021-12-31 00:09:58 +08:00
Cotes Chung
9e2a4fc8c9 Merge branch 'feature/simplify-html-struct' 2021-12-31 00:09:53 +08:00
Cotes Chung
fc71289dc8 Bypass Jekyll build on the gh-pages branch 2021-12-31 00:09:13 +08:00
Cotes Chung
c8fd0d728d Clean up the JS log when the post is scrolled(mobile views) 2021-12-31 00:09:09 +08:00
Cotes Chung
ef2aa525d5 Add intro for img_path 2021-12-31 00:00:28 +08:00
Cotes Chung
1fe0b2958b Add new variable img_path for posts 2021-12-31 00:00:28 +08:00
Cotes Chung
e466a643d5 Merge branch 'feature/multi-comments' 2021-12-30 23:08:09 +08:00
iwasaki501
f7ec9cd24a Bug Fix: Link in a heading is rendered as an anchor and becomes invisible unless it is hovered. (#469)
`<a>` tags in headings are set to apply the style of `%anchor` in `module.scss` and `common.scss`.
Therefore, if I put a link in a heading, the link will have the same style as the anchor,
which means that the font size becomes smaller and the link will not be displayed unless I hover the mouse over it.
My suggestion is to set an `anchor` class for the `<a>` tag of the anchor and apply style settings to the `anchor` class, not to the `a` tag.
2021-12-30 15:57:02 +08:00
Cotes Chung
3342abc9e6 Refactor the page layout 2021-12-30 00:38:32 +08:00
mirusu400
d47ec035d3 Add Korean locales (#467)
Add Korean translation
2021-12-26 14:53:32 +08:00
Cotes Chung
a403ffee42 Reduce style class for page layout 2021-12-13 21:09:32 +08:00
Cotes Chung
d315bf57e7 Integrate utterances comments 2021-12-13 04:40:05 +08:00
Cotes Chung
75176522e3 Prepare for multiple comment systems 2021-12-13 03:34:46 +08:00
Cotes Chung
ebb3dc940c Merge branch 'feature/refactor-theme-mode-switch' 2021-12-13 03:33:32 +08:00
Cotes Chung
c02c9c6a04 Decouple theme-mode toggle & mermaid 2021-12-13 03:33:01 +08:00
Cotes Chung
3a4316b29b Merge branch 'feature/fix-img-param-abbr' 2021-12-13 02:39:44 +08:00
Cotes Chung
f4b2dfe8b4 Fix the conversion of image width/height abbreviation 2021-12-12 00:38:49 +08:00
Cotes Chung
09e8eb4274 Make the preview image full screen width on mobile 2021-12-10 21:54:24 +08:00
Cotes Chung
5ca0966c41 Merge branch 'feature/improve-heading-ux' 2021-12-10 21:54:11 +08:00
Cotes Chung
d919f833f1 Show heading anchor on touch devices 2021-12-10 00:28:50 +08:00
Cotes Chung
df81012e28 Always close the top bar when smooth scrolling 2021-12-10 00:28:50 +08:00
Cotes Chung
09742d40dd Prevent the anchor of the heading from being awakened early 2021-12-09 18:52:02 +08:00
Cotes Chung
259d0deabc Merge branch 'feature/improve-audits' 2021-12-07 23:21:47 +08:00
Cotes Chung
cf6c8e9b3a Improve accessibility of panel heading elements 2021-12-07 23:09:00 +08:00
Cotes Chung
c64e587335 Improve SEO & accessibility on mode toggle element 2021-12-07 23:09:00 +08:00
Cotes Chung
415f11ecb8 Escape characters of post list (homepage and related posts)
To pass the html-proofer test
2021-12-07 16:40:19 +08:00
Cotes Chung
5dc830d11e Merge branch 'feature/add-heading-anchors' 2021-12-07 16:28:19 +08:00
Cotes Chung
7579644e8d Make the anchor scroll position more precise 2021-12-07 16:26:26 +08:00
Cotes Chung
4cff83268b Reduce refactor scope 2021-12-07 16:26:26 +08:00
Cotes Chung
1487ae5284 Add style for heading anchor 2021-12-07 16:26:26 +08:00
Cotes Chung
697c584b48 Merge branch 'feature/fix-pannel-toc' 2021-12-07 15:00:07 +08:00
Cotes Chung
089a19bc9e Merge branch 'feature/support-image-parameter-abbreviation' 2021-12-07 14:59:11 +08:00
Cotes Chung
007d242e87 Fix ToC incorrectly display the contents of the panel
Bug introduced in the commit `b518c9d`
2021-12-07 14:53:48 +08:00
Cotes Chung
6447ffaf59 Add new feature intro to docs 2021-12-07 01:04:13 +08:00
Cotes Chung
790cf30376 Add abbreviation support for image width/height 2021-12-07 01:04:13 +08:00
Cotes Chung
45adf4aac2 Create anchor for headings 2021-12-06 03:04:50 +08:00
Cotes Chung
b1377ac694 Improve heading font-size & layout 2021-12-05 23:44:04 +08:00
Cotes Chung
cf8dae9454 Merge branch 'feature/improve-meta-display'
# Conflicts:
#	_sass/addon/commons.scss
2021-12-05 17:46:14 +08:00
Cotes Chung
9f5e579596 Merge branch 'feature/use-default-scrollbar' 2021-12-05 16:42:43 +08:00
Cotes Chung
99e468cae5 Merge branch 'feature/improve-post-design' 2021-12-05 16:42:38 +08:00
Cotes Chung
4fde37e879 Merge branch 'feature/switch-funding' 2021-12-05 16:35:00 +08:00
Cotes Chung
19debc4add Switch donation method from BMC to Kofi 2021-12-05 16:29:46 +08:00
Cotes Chung
afcf0bde22 Refactor footer style 2021-12-05 04:42:53 +08:00
Cotes Chung
36f55f091d Add content to the tutorial 2021-12-05 04:42:53 +08:00
Cotes Chung
e2003f2b03 Add a link to the author of the post 2021-12-05 04:42:53 +08:00
Cotes Chung
563e8085e8 Redesign the post meta layout
- posted date
- updated date
- read time
- license statement of post bottom
- also refactor the `timeago.js`
2021-12-05 04:42:53 +08:00
Cotes Chung
902546cf4d Remove unused style for mode-toggle 2021-12-03 21:23:37 +08:00
Cotes Chung
e06d237eae Use the default scroll bar
And make the Chrome scroll bar on Windows support dark mode
2021-12-03 21:23:37 +08:00
Cotes Chung
6220d09ffb Replace the pageviews with categories on home page 2021-12-03 21:03:31 +08:00
Cotes Chung
3c91dc1f6f Move the preview image of the post to the top 2021-12-03 16:36:40 +08:00
Cotes Chung
6a65f3a7f7 New design for code snippet header 2021-12-03 16:34:26 +08:00
Cotes Chung
57feaa660e Upgrade uglify-js to v3.14.3 2021-12-02 23:33:39 +08:00
Cotes Chung
db9cfc270b Fix code style issue 2021-12-02 21:32:26 +08:00
Cotes Chung
3caacbee61 Improve mobile title display
Also fixed the 404 page title on mobile screens
2021-12-02 21:18:18 +08:00
Cotes Chung
b518c9d3bc Merge branch 'feature/refactor-layouts' 2021-12-02 05:54:56 +08:00
Cotes Chung
1c758cf4a2 Update related styles 2021-12-02 05:54:43 +08:00
Cotes Chung
df3a703988 Refactor HTML structure 2021-12-02 05:54:43 +08:00
Cotes Chung
12407bbfc0 Merge branch 'feature/hide-mouse-cursor' 2021-12-02 05:53:13 +08:00
Cotes Chung
55fce7574c Refactor theme mode toggle
- Improve mode switching JS execution priority
- Drop deprecated Web API
2021-12-02 05:51:30 +08:00
Cotes Chung
833b6c9d5c Hide the cursor of icons, images, and code snippets
Found on Windows with mouse
2021-12-02 05:51:30 +08:00
Cotes Chung
a34b77969f Simplify the style of <a> 2021-12-02 05:51:30 +08:00
Bhavy Khatri
707466b1df Accessibility Bug Fix: Tab focus doesn't reach Dark mode toggle button (#453) 2021-12-01 00:23:22 +08:00
Cotes Chung
602e98448d Merge branch 'hotfix/4.3.4' 2021-11-29 21:05:44 +08:00
Cotes Chung
0bf7a8f1d9 Bump version to 4.3.4 2021-11-29 21:03:53 +08:00
Cotes Chung
a7361717a6 Exclude NPM lock-file from output 2021-11-29 21:03:53 +08:00
Cotes Chung
e880448ba5 Fix code-language conversion (json, plaintext) 2021-11-29 21:03:53 +08:00
Cotes Chung
c28b6ce7d1 Fix markdown indentation 2021-11-29 21:03:53 +08:00
Cotes Chung
b7cc22983f Prevent multiple reserse-footnote from overlapping (fix #439) 2021-10-31 22:56:22 +08:00
Cotes Chung
a1551cd740 Merge branch 'feature/code-style' into develop 2021-10-26 04:31:31 +08:00
Cotes Chung
35c4d480ed Update Codacy badge of README 2021-10-26 04:29:16 +08:00
Cotes Chung
b5c26fed08 Fix SCSS code style 2021-10-26 04:29:16 +08:00
Cotes Chung
2dc2175723 Fix JS code style 2021-10-26 04:29:16 +08:00
Cotes Chung
2f79b8d408 Fix code style for Markdown 2021-10-26 04:29:16 +08:00
Cotes
cbe6c3fb7b Skip the Jekyll build on the source code 2021-10-23 03:34:19 +08:00
Cotes Chung
bb1188a01a Merge branch 'hotfix/4.3.3' 2021-10-20 06:29:03 +08:00
Cotes Chung
406ed520cb Bump version to 4.3.3 2021-10-20 06:28:49 +08:00
Cotes Chung
1d7a134dd5 Fix exclude list 2021-10-20 06:17:53 +08:00
Cotes Chung
421db9dc92 Merge branch 'hotfix/4.3.2' 2021-10-15 00:49:57 +08:00
Cotes Chung
a5b8e7862b Bump version to 4.3.2 2021-10-15 00:49:13 +08:00
Cotes Chung
30d3249782 Remove the host of the search result URLs 2021-10-15 00:49:13 +08:00
Cotes Chung
fa15aebbca Fix the failure of the init-tool with the —no-gh option (resolve #429) 2021-10-15 00:49:13 +08:00
Cotes Chung
565ad9229c Remove the value of img_cdn and avatar from the gem package 2021-10-15 00:49:13 +08:00
Cotes Chung
3d6304efd8 Build on the release branches to reuse the travis cache 2021-10-15 00:49:13 +08:00
Cotes Chung
80fd684577 Improve the issue templates 2021-10-04 18:04:15 +08:00
Cotes Chung
80980465d7 Correct grammar and spelling in docs & issue templates
Also improve the Markdown code style
2021-10-04 17:53:07 +08:00
Cotes Chung
2858a082a3 Merge branch 'hotfix/4.3.1' 2021-10-01 18:49:10 +08:00
Cotes Chung
9b0b7d7772 Bump version to 4.3.1 2021-10-01 18:48:42 +08:00
Cotes Chung
952b1f493b Fix contents in tutorials
- Correct the aspect ratio of the mockup image
- Delete code snippet space in docs
2021-10-01 18:39:02 +08:00
Cotes Chung
a887f1d57d Prevent the site test from failing when the avatar is not assigned (close #418)
Some rookies like to do this :(
2021-10-01 18:39:02 +08:00
Cotes Chung
945e8d1953 Bump version to 4.3.0 2021-09-30 02:32:57 +08:00
Cotes Chung
a400dc9501 Specify the version of the images in the CDN 2021-09-30 02:23:34 +08:00
Cotes Chung
6a4169fc03 Make the init tool compatible with BSD 2021-09-30 02:17:24 +08:00
Cotes Chung
95b4b453e6 Merge branch 'feature/docs' into develop 2021-09-30 00:17:24 +08:00
Cotes Chung
de14c00570 Improve README header 2021-09-29 22:36:47 +08:00
Cotes Chung
f4d4065b1c Update the tutorials 2021-09-29 22:36:47 +08:00
Cotes Chung
52f854a2da Update the comment of _config.yml
Reduce the probability of users using `baseurl` incorrectly
2021-09-29 22:36:47 +08:00
Cotes Chung
38f20e8119 Update issue template 2021-09-29 22:36:47 +08:00
Cotes Chung
1728d697e6 Merge branch 'feature/enhance-script-tools' into develop 2021-09-29 22:20:03 +08:00
Cotes Chung
d9863d6a02 Separate the release steps from the bump tool 2021-09-29 22:18:38 +08:00
Cotes Chung
b460d03c3b Merge the test tool into the deploy tool 2021-09-29 22:18:38 +08:00
Cotes Chung
a053c454e4 Improve the init tool 2021-09-29 22:18:38 +08:00
Cotes Chung
77c2009658 Improve the layout of toc entries 2021-09-29 22:17:22 +08:00
Cotes Chung
9844b964a8 Improve the alignment of code block 2021-09-29 16:44:03 +08:00
Cotes Chung
063b2a6651 Prevent Disqus from jumping when page loading 2021-09-29 03:24:41 +08:00
Cotes Chung
e5df04dd59 Hide the scroll bar of code block when not hovering (resolve #414) 2021-09-29 03:24:41 +08:00
Cotes Chung
9e9278ce30 Fix code style of SCSS files 2021-09-24 15:35:44 +08:00
Cotes Chung
30dfc6fb7e Merge branch 'feature/icons-improvement' into develop 2021-09-24 15:32:35 +08:00
Cotes Chung
1ce350e33e Beautify the style of categories button 2021-09-24 15:21:49 +08:00
Cotes Chung
50c88f7205 Prevent the back-to-top button from flickering when switching the theme mode 2021-09-24 15:21:49 +08:00
Cotes Chung
387fc67102 Improve the vertical alignment of icons
- sidebar bottom icons
- back to top icon
2021-09-24 15:21:49 +08:00
Cotes Chung
414715fc47 Merge branch 'feature/code-snippet' into develop 2021-09-24 15:20:00 +08:00
Cotes Chung
1bb54096f4 Improve the UX of clipboard button 2021-09-24 15:13:00 +08:00
Cotes Chung
abb548fcee Change the icon & color of the code block header 2021-09-24 15:13:00 +08:00
Cotes Chung
ed93fbdfde Covert the language alias on code header 2021-09-24 15:13:00 +08:00
Cotes Chung
4ad0a76789 Add label icon to code snippet header 2021-09-24 15:13:00 +08:00
Cotes Chung
89b76dc2a0 Merge branch 'feature/color-scheme' into develop 2021-09-24 15:09:14 +08:00
Cotes Chung
395b24736a Improve the layout of sidebar icons 2021-09-24 14:54:15 +08:00
Cotes Chung
fa0155de6f Lighten the light mode color scheme 2021-09-23 20:39:16 +08:00
Cotes Chung
0bffb276fe Unlock Ruby 3.0 2021-09-22 01:22:32 +08:00
Cotes Chung
2417db656c Add aria label 2021-09-17 18:59:49 +08:00
Cotes Chung
e5bf234835 Fix cursor for some buttons & links (fix #411) 2021-09-17 16:58:32 +08:00
Cotes Chung
2dfdb66e0a Refactor clipboard functions 2021-09-17 16:08:00 +08:00
Cotes Chung
da9881a47f Merge branch 'hotfix/4.2.1' 2021-09-16 21:01:16 +08:00
Cotes Chung
c68a937e01 Improve the bump tool so that it can cherry-pick a merge type commit 2021-09-16 21:00:32 +08:00
Cotes Chung
4001ef7cba Prevent copying code line numbers on Safari 2021-09-16 18:42:50 +08:00
Cotes Chung
1b16b152df Optimize icon position 2021-09-16 17:56:12 +08:00
Cotes Chung
e607e5fe86 Restore the copy URL function that was deleted by mistake 2021-09-16 17:55:52 +08:00
Cotes Chung
d761d340a8 Bump version to 4.2.0 2021-09-16 01:40:38 +08:00
Cotes Chung
f411ba33d8 Fix code style 2021-09-16 01:19:40 +08:00
Cotes Chung
f722757f6f Update docs 2021-09-16 01:17:09 +08:00
Cotes Chung
beabb36d7f Add custom title to code block 2021-09-16 01:17:09 +08:00
Cotes Chung
42ff0f2282 Merge branch 'feature/improve-code-clipoard' into develop 2021-09-15 18:20:01 +08:00
Cotes Chung
34631a0c30 Update locale settings for code block clipboard (resolve #408) 2021-09-15 15:02:23 +08:00
Cotes Chung
53b0329e5a Improve the clipboard UX 2021-09-15 14:57:59 +08:00
Cotes Chung
2877896b9e Merge branch 'feature/improve-disqus' into develop 2021-09-14 20:47:01 +08:00
Cotes Chung
7ef88c8b8f Auto switch Disqus theme 2021-09-14 20:45:17 +08:00
Cotes Chung
2acf14ecf0 Replace Disqus lazy loading plugin with native JS 2021-09-14 20:45:17 +08:00
Cotes Chung
603705f20e Merge branch 'feature/beautify-scrollbar' into develop 2021-09-14 20:40:44 +08:00
Cotes Chung
0267ad8d40 Move sass variables 2021-09-14 20:40:16 +08:00
Cotes Chung
c0b8c089c2 Custom the scrollbar on Webkit browsers
the default scrollbar on Windows looks like shit
2021-09-14 16:47:11 +08:00
Cotes Chung
a603aac8e8 Merge branch 'feature/hide-lineno-of-code-block' into develop 2021-09-14 15:53:04 +08:00
Cotes Chung
91ed3d4649 Hide line number of some posts 2021-09-13 22:36:01 +08:00
Cotes Chung
20454e5a57 Add the feature of hiding line numbers 2021-09-13 22:26:17 +08:00
Cotes Chung
aadda0347c Merge branch 'feature/copy-snippet' (resolve #396, close #400) 2021-09-11 00:42:47 +08:00
Cotes Chung
5e9a7b319e Add clipboard JS 2021-09-11 00:30:21 +08:00
Cotes Chung
2537283beb Add clipboard button to code block 2021-09-11 00:30:21 +08:00
Cotes Chung
7dc7a7efc8 Add code block header 2021-09-11 00:30:21 +08:00
Cotes Chung
39b09b97c0 Merge branch 'feature/full-text-search' into develop 2021-09-04 21:24:37 +08:00
Cotes Chung
8d164c2e6e Enable full-text search (fix #401) 2021-09-04 21:23:43 +08:00
Cotes Chung
1a94b1889f Upgrade simple-jekyll-search from 1.7.3 to 1.10.0 2021-09-04 21:23:09 +08:00
Cotes Chung
6d07d4738b Remove margin between list items 2021-08-26 21:10:57 +08:00
Cotes Chung
6e0afcf9e8 Improve recognition of CJK 2021-08-26 01:26:16 +08:00
Cotes Chung
952927762a Run travis build only when tagging 2021-08-10 19:47:14 +08:00
Cotes Chung
3c3598e8b1 Reduce SASS compressed blank lines 2021-08-09 19:39:43 +08:00
Cotes Chung
9d9bca5e3b Improve the bump tool 2021-08-09 13:17:40 +08:00
Cotes Chung
03248f5bff Update comments for locales 2021-08-09 12:50:49 +08:00
Cotes Chung
e2c288a925 Add not results prompt in zh-CN 2021-08-09 12:49:59 +08:00
Maulana Kurniawan
b80d95dcdd Add Indonesian translation for search: no results. (#394)
Signed-off-by: maulanakurniawann <maulanakurniawan@outlook.co.id>
2021-08-09 12:46:23 +08:00
Cotes Chung
72ba1f7849 Fix tabs & improve topbar items 2021-08-03 22:55:35 +08:00
Hadian Alkani
46d80cbf9a Add Indonesian translation & locales (#390) 2021-08-03 16:58:12 +08:00
Cotes Chung
0213331a16 Improve the way to set the default value of locales 2021-08-01 22:04:11 +08:00
Cotes Chung
780af9ac5f Remove unused variable on HTML & JS 2021-08-01 21:49:44 +08:00
Cotes Chung
b513c0764d Update some locales value 2021-07-30 15:55:59 +08:00
Cotes Chung
57e8c6e594 Drop site config options content_lang & outdated 2021-07-30 15:55:59 +08:00
Cotes Chung
49dc866bd8 Fix docs 2021-07-22 01:30:26 +08:00
Cotes Chung
b7a483680e Bump version to 4.1.0 2021-07-22 00:51:20 +08:00
Cotes Chung
7ecb377c9b Update docs 2021-07-22 00:14:08 +08:00
Cotes Chung
a83e4c1b30 Optimize JS loading priority 2021-07-21 23:50:16 +08:00
Cotes Chung
0b29c0321f Add layout localization 2021-07-21 23:50:16 +08:00
Cotes Chung
2e76300d04 Revert "Delete useless SCSS snippets"
This reverts commit ab8cef9174.
2021-07-21 01:00:05 +08:00
Cotes Chung
20f2ff4b23 Update bot's reply message 2021-07-20 02:51:46 +08:00
Cotes Chung
899609a291 Switch to another issue bot 2021-07-20 02:26:03 +08:00
Cotes Chung
f56852a700 Fix breadcrumb for pagination 2021-07-20 02:08:28 +08:00
Cotes Chung
c969eaa040 Recover the missing image link identifier class 2021-07-20 02:08:28 +08:00
Cotes Chung
ab8cef9174 Delete useless SCSS snippets 2021-07-19 17:53:44 +08:00
Cotes Chung
b3ff6c79a6 Ignore the variables hook in the site file 2021-07-17 13:26:29 +08:00
Cotes Chung
7f8c19d480 Improve the code style on shell scripts
Double quote to prevent globbing and word splitting.
2021-07-11 17:26:49 +08:00
Cotes Chung
d52fa88337 Prevent the post date from shifting when loading 2021-07-11 17:04:13 +08:00
Cotes Chung
bea170cff0 Add fade in effect for lazy-loaded images 2021-07-11 15:05:18 +08:00
Cotes Chung
961ebb545b Set the dollar sign of code snippets to non-selectable 2021-07-08 21:19:33 +08:00
Cotes Chung
797450174d Dynamically detect the sass variables hook 2021-07-07 03:00:13 +08:00
FieryThunder
f0a2113a9f Fix typo of the issue template (#359) 2021-07-07 01:56:23 +08:00
Cotes Chung
c98a41317f Add a hook for custom variables (fix #355) 2021-07-04 23:24:30 +08:00
Cotes Chung
5f1e6e9350 Create the code language badge by Liquid
It prevents the language badges from flashing
2021-07-04 22:02:52 +08:00
Cotes Chung
65dbea9d3b Prevent image caption shifting
Before the image tag modified by JS, the caption will shift
2021-07-03 05:11:11 +08:00
Cotes Chung
fd97067ec3 Optimize the JS loading priorities 2021-07-03 05:11:11 +08:00
Cotes Chung
d5413a954f Update posts
- Set width and height for images
- Update the related tutorial
2021-07-03 05:11:11 +08:00
Cotes Chung
9359d6ef11 Ignore image links in html-proofer test 2021-07-02 17:14:40 +08:00
Cotes Chung
6d1d440c00 Preventing image reflow (fix #351) 2021-07-02 17:14:40 +08:00
Cotes Chung
08ec6cd3b5 Simplify the gitlab flow history 2021-06-24 21:30:05 +08:00
Cotes Chung
3ecb59deb1 Bump version to 4.0.2
(cherry picked from commit a6d4db251f)
2021-06-23 23:02:55 +08:00
Cotes Chung
885ed44646 Lock the ruby version number (#245, #247, #344)
Since version 3.0, Ruby has no `webrick` that Jekyll (<= 4.2) needs
2021-06-23 23:00:46 +08:00
Cotes Chung
d31e677ca0 Fix git-ignore list (#343) 2021-06-04 19:43:45 +08:00
blacksheep-git
bf3b539d6d Update 2019-08-08-text-and-typography.md
Fixed typo from 'Setction' to 'Section'.
2021-05-28 10:30:25 -06:00
Cotes Chung
ab927e9954 Improve sidebar cursor position calculation (fix #338) 2021-05-27 01:05:01 +08:00
Cotes Chung
d5e08b05ab Remove PR filter from workflow
GitHub does not allow to run workflows on PR from first-time contributors.
see: <https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks>
2021-05-19 13:50:19 +08:00
Cotes Chung
eb247b8886 Improve the paginator design for the mobile screens (#331) 2021-05-19 11:09:52 +08:00
Cotes Chung
4fa7c6af6e Bump version to 4.0.1
(cherry picked from commit b887c439c6)
2021-05-08 03:26:04 +08:00
Cotes Chung
2cce0be8af Add the missing files to the gem 2021-05-08 03:19:13 +08:00
Cotes Chung
cf7d8a45ba Bump version to 4.0.0
(cherry picked from commit db82f71515)
2021-04-30 14:10:24 +08:00
Cotes Chung
6d254af55f Simplify the favicons 2021-04-29 19:58:37 +08:00
Cotes Chung
a4dc39f70e Center the mermaid SVG 2021-04-24 16:32:56 +08:00
Cotes Chung
84bb4d0c4b Add image popup effect 2021-04-24 16:32:56 +08:00
Cotes Chung
e8296fe2e4 Improve the site config 2021-04-20 04:34:11 +08:00
Cotes Chung
6a45d7ccd1 Remove SRI of bootstrap and font-awesome css
Sometimes it causes the fetch event to fail after the PWA cache key is updated:

```
The FetchEvent for "<url_from_CDN>" resulted in a network error response: an "opaque" response was used for a request whose type is not no-cors
```
2021-04-20 04:22:28 +08:00
Cotes Chung
5df67616be Fix the grammar and typo of the docs 2021-04-20 04:22:28 +08:00
Cotes Chung
f0ce5ceb71 Fix tabs url for service worker 2021-04-20 04:22:28 +08:00
Cotes Chung
a9acaa669d Reduce the external files required for gem installation 2021-04-20 04:22:28 +08:00
Cotes Chung
72e8ffafa6 Exclude JS source code from the output 2021-04-20 04:22:28 +08:00
Cotes Chung
52f4012463 Fix custom author name in RSS template 2021-04-18 03:21:55 +08:00
Cotes Chung
d5407181a4 Add shadow effect option for images 2021-04-18 03:15:11 +08:00
Cotes Chung
4ed6988be3 Globally mark out image links 2021-04-17 15:00:21 +08:00
Cotes Chung
3f2d400f16 Improve the selector for lazy loading images (fix #313)
When `page.dynamic_title` is set to false, the image will not be loaded
2021-04-13 23:29:24 +08:00
Cotes Chung
e84331b26a Fix the response stream of service worker
After service worker update (rebuild the site), the following error will occasionally appear:

```
The FetchEvent for "<url_from_CDN>" resulted in a network error response: an "opaque" response was used for a request whose type is not no-cors
```

This commit ensures that the response object has been cached before being returned.
2021-04-13 16:51:49 +08:00
Cotes Chung
efd8d44b12 Improve the UI design
- Optimize the text color in light mode
- Stop iOS Safari input field zooming
- Uniform font size for posts
2021-04-13 16:51:49 +08:00
Cotes Chung
a71659ed27 Fix bump tool 2021-04-12 13:34:01 +08:00
mattpopovich
b14e97a92d Small typo fix 2021-04-12 12:38:39 +08:00
Cotes Chung
826b7dca1a Turn off autocompletion of input form 2021-04-11 14:13:30 +08:00
Cotes Chung
d720d0f66c Bump version to 3.3.2
(cherry picked from commit 0b0e493ff0)
2021-04-11 01:39:27 +08:00
Cotes Chung
c1b8e28601 Fix links color in search results 2021-04-11 01:18:19 +08:00
Cotes Chung
aa54e901b1 Resume the pv cache source & add validation for the number of localStorage keys 2021-04-10 23:36:08 +08:00
Cotes Chung
a03149cd40 Reduce PWA storage space 2021-04-10 14:51:04 +08:00
Cotes Chung
588fbbbec7 Stop tracking Gemfile.lock in deployment tool (#306) 2021-04-07 15:15:17 +08:00
Cotes Chung
6341752986 Enhance detection of PV key validity in localStorage 2021-04-07 15:01:23 +08:00
Cotes Chung
11bcd7027d Fix dns links in head 2021-04-06 23:16:02 +08:00
Cotes Chung
4a0242e496 Simplify the PV config options
- Remove options `site.google_analytics.pv.enabled` and `site.google_analytics.pv.proxy_url`
- Rename options `site.google_analytics.pv.cache` to `site.google_analytics.pv.cache_path`
2021-04-06 23:15:36 +08:00
Cotes Chung
48e4c7e6d3 Fix the PV fetching failed when local cache is disabled
also improve the PV report logic
2021-04-06 02:32:53 +08:00
Cotes Chung
991f53f8b2 Unify the text color in the panel 2021-04-06 02:32:53 +08:00
Cotes Chung
7a5ad10bdc Optimize the responsive design for Pad devices 2021-04-06 02:32:53 +08:00
Cotes Chung
3b5441a1c2 Hide scrollbar of sidebar 2021-04-05 18:47:03 +08:00
Cotes Chung
a1fca3706f Update credits in README 2021-04-02 22:18:19 +08:00
Cotes Chung
49346fd3c6 Bump version to 3.3.1
(cherry picked from commit 0b043daa34)
2021-04-02 21:15:50 +08:00
Cotes Chung
bff97df3b5 Fix the MathJax config was lost in jekyll-compress-html 2021-04-02 21:14:43 +08:00
Cotes Chung
dbe4c3d42f Bump version to 3.3.0
(cherry picked from commit 41741dc336)
2021-04-02 16:17:40 +08:00
Cotes Chung
fad8a23b87 Update the bump tool 2021-04-02 16:16:31 +08:00
Cotes Chung
834de0f02c Optimize the typo color 2021-04-02 16:10:07 +08:00
Cotes Chung
1ff38722a2 Rename copyright file for JS 2021-04-02 16:02:14 +08:00
Cotes Chung
1c0cd6b6b0 Remove a stale variable from timeago.js 2021-04-02 15:57:36 +08:00
Cotes Chung
4973a61e39 Update ruby setup actions (fix #306)
No longer tracking Gemfile.lock
2021-04-01 04:17:18 +08:00
dependabot-preview[bot]
99c12f6cd4 [Security] Bump kramdown from 2.3.0 to 2.3.1
Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. **This update includes a security fix.**
- [Release notes](https://github.com/gettalong/kramdown/releases)
- [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page)
- [Commits](https://github.com/gettalong/kramdown/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-29 17:15:44 +00:00
Cotes Chung
042cec33d8 Update docs
- Remove ToC
- Remove JetBrains logo from readme
- Update funding options
2021-03-28 13:48:49 +08:00
Cotes Chung
8c940dbb96 Fix a code snippet of tutorial 2021-03-23 15:45:21 +08:00
Cotes Chung
9636612755 Fix the cache list on service worker
Adding '/index.html' to the cache storage
2021-03-23 15:42:10 +08:00
Cotes Chung
18f6c6ac4e Fix PWA error caused by service worker store the POST Request as cache key
fix #297, fix #301
2021-03-22 22:38:22 +08:00
Cotes Chung
88aa81dfe5 Revert "Restore the year of first publication in footer"
This reverts commit 338eddb454.
2021-03-20 22:41:35 +08:00
Cotes Chung
1b47c95cf6 Disable configuration option 'site.author' 2021-03-20 22:37:10 +08:00
DuchkPy
aa7309c136 Update typing error 2021-03-12 23:28:45 +08:00
Cotes Chung
d162167580 Support TeX and LaTeX math delimiters (#243) 2021-03-09 15:52:56 +08:00
Cotes Chung
6688e27787 Improve the pattern of issue bot 2021-03-04 21:52:19 +08:00
Cotes Chung
89751c8e9f Bump version to 3.2.2
(cherry picked from commit f78747d841)
2021-03-04 15:04:14 +08:00
Cotes Chung
eae506113b Fix the corners of the page navigation buttons of the latest/oldest post 2021-03-04 15:02:06 +08:00
Cotes Chung
3400568b09 Change the bundle cache path on gh-actions
ubuntu-latest changed from 18.04 TLS to 20.04 LTS causes a file path change to the `ffi` gem, invalidating the gh-actions cache file, and causes the build to fail.

See: <https://github.com/ffi/ffi/issues/769>
2021-03-04 15:02:06 +08:00
Cotes Chung
d2bb423220 Change the order of post meta & improve timeago 2021-03-03 18:32:06 +08:00
dependabot-preview[bot]
c6b0a8247b Bump html-proofer from 3.18.5 to 3.18.6
Bumps [html-proofer](https://github.com/gjtorikian/html-proofer) from 3.18.5 to 3.18.6.
- [Release notes](https://github.com/gjtorikian/html-proofer/releases)
- [Commits](https://github.com/gjtorikian/html-proofer/compare/v3.18.5...v3.18.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 21:11:56 +08:00
Cotes Chung
8ce8fc780f Improve the bump tool 2021-02-28 05:49:29 +08:00
Cotes Chung
ac2ec585f6 Update the sponsor buttons 2021-02-28 05:49:29 +08:00
Cotes Chung
338eddb454 Restore the year of first publication in footer 2021-02-28 05:42:24 +08:00
Cotes Chung
3573ccb7a3 Update the prompt of comments 2021-02-26 00:50:42 +08:00
Cotes Chung
82b3d061af Update the condition of issues intercept 2021-02-22 15:59:08 +08:00
Cotes Chung
fc94a8e36b Migration from BMC to Ko-fi 2021-02-22 15:55:54 +08:00
Cotes Chung
efc8c60b5d Fix image width in the list (when screen width is 768px) 2021-02-22 14:57:29 +08:00
Cotes Chung
3e79ad6300 Bump version to 3.2.1
(cherry picked from commit 125c23f19b)
2021-02-10 23:50:06 +08:00
Cotes Chung
273f2e152d Restore the copy link button in the post sharing option
Affected version >= 3.0.3, <= 3.2.0
2021-02-10 23:48:26 +08:00
Cotes Chung
d0a23c21ee Bump version to 3.2.0
(cherry picked from commit e13187cb1d)
2021-02-10 21:27:18 +08:00
Cotes Chung
89200f3109 Improve the bump tool 2021-02-10 21:15:58 +08:00
Cotes Chung
136773481e Add branches notice to the Docs 2021-02-10 21:15:58 +08:00
Cotes Chung
de7d2fab7c Optimize the language badge position in code block 2021-02-10 21:15:58 +08:00
Cotes Chung
1b1fa93cf6 Fix typo in readme & quick-start tutorial 2021-02-06 02:05:19 +08:00
Cotes Chung
7e31ba4103 Improve the width of search results items (fix #276) 2021-02-05 22:13:44 +08:00
Cotes Chung
34b7a80a78 Bump version to 3.1.1 2021-02-05 02:05:55 +08:00
Cotes Chung
ba6c7eceec Add a modification to Gemfile.lock in bump tool 2021-02-05 01:55:20 +08:00
Cotes Chung
5669f792a7 Fix search results slow scrolling (#273)
also:
- improve its responsive design
- fix the js path in gulp
2021-02-05 01:24:15 +08:00
Cotes Chung
f864b5c324 Hide empty categries/tags in search (#273) 2021-02-05 00:51:50 +08:00
Cotes Chung
c8ff81e79a Use regex in site exclusion list 2021-02-04 03:38:04 +08:00
Cotes Chung
2bcaabdab4 Give travis a new job: monitor the starter files 2021-02-04 03:15:20 +08:00
Cotes Chung
4faa595b04 Update dependencies in Gemfile.lock 2021-02-03 02:41:33 +08:00
Cotes Chung
d7443aad5d Bump version to 3.1.0 2021-02-03 01:42:10 +08:00
Cotes Chung
b2beaa0f4c Update travis settings for release-branches
- drop the deprecated flag `--deployment` of bundle (so we have to specify the bundler caching path)
2021-02-03 00:46:36 +08:00
Cotes Chung
83a7878043 Improved bump tool to fit the release branches 2021-02-02 21:56:17 +08:00
Cotes Chung
94b99350fc Restore the prompt in the page nav button in the latest/oldest articles 2021-02-02 21:56:17 +08:00
Cotes Chung
6dc9cdfa25 Reduce the font size of the Disqus prompt 2021-02-02 21:56:17 +08:00
Cotes Chung
fa56ea48c3 Improve docs 2021-02-02 21:56:17 +08:00
dependabot-preview[bot]
7d3e25c90d Bump tzinfo-data from 1.2020.6 to 1.2021.1 (#272)
Bumps [tzinfo-data](https://github.com/tzinfo/tzinfo-data) from 1.2020.6 to 1.2021.1.
- [Release notes](https://github.com/tzinfo/tzinfo-data/releases)
- [Commits](https://github.com/tzinfo/tzinfo-data/compare/v1.2020.6...v1.2021.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-01 19:33:45 +08:00
Cotes Chung
6c9ab6e5f8 Fix gemfile 2021-02-01 18:03:27 +08:00
Cotes Chung
91da99282d Add lang option to the site config sample 2021-02-01 17:38:50 +08:00
Cotes Chung
413a86277b Generate the breadcrumb by Liquid
also subtracted '/tabs/' from the tabs path
2021-01-31 22:06:10 +08:00
Cotes Chung
1879b94f3d Exclude gem-spec from output 2021-01-30 05:28:33 +08:00
Cotes Chung
7b5f7086b7 Fix post feature image style 2021-01-30 03:12:43 +08:00
Cotes Chung
a8b8a379f6 Improve the docs
- Add missing url references in the tutorial
- Add gem version badge in README
2021-01-30 02:00:34 +08:00
Bogdan Stoica
eacad65cbb Add alt attribute to the post's preview image (#271) 2021-01-30 01:14:03 +08:00
Cotes Chung
7a87ab4d05 Bump version to 3.0.3 2021-01-28 23:44:53 +08:00
Cotes Chung
c4be7c0cd6 Add more spec meta to gem 2021-01-28 23:39:03 +08:00
Cotes Chung
c9765e6923 Merge gem-build & bump tool
Drop the yard doc
2021-01-28 23:17:16 +08:00
Cotes Chung
5c04d4e45b Bypass the jekyll build on source branch 2021-01-28 20:56:23 +08:00
Cotes Chung
4d969ca0c5 Fix toc of readme 2021-01-28 20:56:23 +08:00
Cotes Chung
4a084eb681 Add new tool to build gem 2021-01-28 04:57:11 +08:00
Cotes Chung
adc117972a Fix the year of copyright 2021-01-28 03:37:08 +08:00
Cotes Chung
8e84c6b9d6 Improve code style
- js/css
- markdown
- shell
2021-01-28 03:21:58 +08:00
Cotes Chung
d8a42d9bb4 Bump version to 3.0.2 2021-01-27 03:41:12 +08:00
Cotes Chung
c1b20d8f71 Fix bump tool 2021-01-27 03:40:17 +08:00
Cotes Chung
08ce9f6c7c Fix typo of docs 2021-01-27 03:13:26 +08:00
Cotes Chung
0b4e40bcdf Fix footer links 2021-01-27 02:51:50 +08:00
Cotes Chung
9ae2aee222 Improve the gh-actions CD script 2021-01-26 23:26:03 +08:00
Cotes Chung
ec522e5219 Bump version to 3.0.1 2021-01-26 22:28:35 +08:00
Cotes Chung
4ee8f20df2 Meaningless commit
RubyGems doesn't allow re-pushing the yanked version (3.0.0), so we have to bump a new patch version
2021-01-26 22:26:32 +08:00
Cotes Chung
7d7c0da31b Bump version to 3.0.0 2021-01-26 21:40:46 +08:00
Cotes Chung
4343f1a8f8 Update the usage instructions 2021-01-26 20:31:26 +08:00
Cotes Chung
b85980e1e2 Optimize the embedded list style 2021-01-26 20:24:47 +08:00
Cotes Chung
893db51ff0 Improve the copyrights of the assets 2021-01-26 20:24:47 +08:00
Cotes Chung
cbb3bd4be5 Set default values for site variables
good for gem-based first run
2021-01-26 20:24:47 +08:00
Cotes Chung
7ed3bef1b1 Add gem-based settings 2021-01-26 20:24:47 +08:00
Cotes Chung
da9f7b8218 Process JS files with gulp 2021-01-25 06:43:02 +08:00
Cotes Chung
0e9104a58f Fix a typo on css 2021-01-25 02:44:35 +08:00
Cotes Chung
b7266aceac Contact theme styles 2021-01-25 02:44:35 +08:00
Cotes Chung
28f36bee23 Make code block 100% screen width on mobile 2021-01-23 13:19:51 +08:00
Cotes Chung
994b3e32d3 Optimize image width of list on mobile screens 2021-01-23 13:18:02 +08:00
Cotes Chung
75e9feb687 Optimize url filters 2021-01-19 00:01:01 +08:00
Cotes Chung
ab0e3f6ee4 Fix PV display when baseurl exists 2021-01-19 00:01:01 +08:00
Cotes Chung
0194bbced9 Fix baseUrl on rss-feed (#259) 2021-01-18 22:17:03 +08:00
dependabot-preview[bot]
e92cc239c1 Bump html-proofer from 3.18.3 to 3.18.5 (#257)
Bumps [html-proofer](https://github.com/gjtorikian/html-proofer) from 3.18.3 to 3.18.5.
- [Release notes](https://github.com/gjtorikian/html-proofer/releases)
- [Commits](https://github.com/gjtorikian/html-proofer/compare/v3.18.3...v3.18.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-17 22:29:34 +08:00
Cotes Chung
da976ce088 Allow the PRs from dependabot 2021-01-17 22:23:34 +08:00
Cotes Chung
6490b0fcbd Fix avatar url when site.baseurl exists (#253) 2021-01-17 21:47:11 +08:00
Ryan TG
ef1d05d342 Fix typo in dark typography SCSS (#249) 2021-01-15 02:29:28 +08:00
Cotes Chung
e8170f8379 Prevent the URLs of code block from being clickable 2021-01-10 18:48:36 +08:00
Cotes Chung
93fcf50131 Add image CDN tutorial 2021-01-09 23:05:55 +08:00
Cotes Chung
66a132c462 Remove the image files 2021-01-09 23:05:55 +08:00
Cotes Chung
6e6633c2fc Add image CDN support & improve image lazy loading 2021-01-09 23:05:55 +08:00
Cotes Chung
594eaf5100 Fix nokogiri vulnerability
Upgrade nokogiri to 1.11.0.rc4  or later
2021-01-06 01:46:45 +08:00
Dinesh Prasanth M K
940db20c5c Add instructions to setup Page Views
This patch adds a new blog post to setup Page Views
using Google analytics superProxy.

Signed-off-by: Dinesh Prasanth M K <mkdineshprasanth@gmail.com>
2021-01-06 00:05:15 +08:00
Cotes Chung
493e1d934b Bump version to 2.7.2 2020-12-31 22:54:58 +08:00
Cotes Chung
b9104d0f4c Upgrade dependencies in Gemfile.lock 2020-12-31 22:38:30 +08:00
Cotes Chung
3c72298563 Improve the smooth scrolling
- Add smooth scrolling to the footnotes
- Add hash to URL
2020-12-31 21:37:17 +08:00
Henk van Achterberg
ca2194770c Update pages-deploy.yml.hook (#229)
This change will make the baseurl configuration/testing work. Previous version failed. Posts should have /index.html as suffix in my experience.
2020-12-30 22:22:42 +08:00
Cotes Chung
08fbd06c63 Optimize the DOM of post link on homepage 2020-12-29 15:39:29 +08:00
Dinesh Prasanth M K
a20fd5bf6f Fix the dir name for hosting posts 2020-12-29 06:06:36 +08:00
Cotes Chung
7a88347c63 Remove inline code extra content 2020-12-28 19:38:24 +08:00
Cotes Chung
813443b206 Improve GitHub stuff
- Add more events to the issue interceptor
- Reduce issue label
2020-12-28 02:33:06 +08:00
Cotes Chung
c381353f86 Use liquid to determine whether to render ToC 2020-12-28 02:30:32 +08:00
Cotes Chung
aa6c33526a Fix the compatibility of the smooth scrolling in Safari
Safari(at least on v14) does not support CSS property `scroll-behavior`
2020-12-28 02:28:57 +08:00
Cotes Chung
081e77d462 Bump version to 2.7.1 2020-12-26 00:45:16 +08:00
Cotes Chung
bca7a2a634 Update docs
-  Add description list sample
-  Improve doc content
2020-12-26 00:41:06 +08:00
Cotes Chung
505da84a26 Fix the position of the table scroll bar 2020-12-26 00:41:06 +08:00
Cotes Chung
dfba411d61 Jump to the anchor position smoothly 2020-12-26 00:41:06 +08:00
Cotes Chung
fa310d3190 Optimize typography
- Set the table width to 100% on small screens
- Optimize list style
- Optimize image style
- Make checkbox color lighter (light mode)
- Reduce the space for inline code
2020-12-26 00:41:06 +08:00
Cotes Chung
ef0c9ce770 Simplify sidebar style
Avoid element shifting when rendering
2020-12-26 00:41:06 +08:00
Cotes Chung
7429ef3539 Fix the Jekyll minimum version requirement
Starting from Jekyll v4.1.0, the filter `number_of_words` accepts optional parameters to handle CKJ characters
2020-12-21 23:50:54 +08:00
Cotes Chung
6d4abcc437 Stop local HTML compression 2020-12-21 23:50:54 +08:00
Cotes Chung
5bdea71622 Bump version to 2.7.0 2020-12-19 00:49:31 +08:00
Cotes Chung
8e0004146b Improve CSS selector for image 2020-12-19 00:18:30 +08:00
Cotes Chung
557413cc4c Simplify the image custom class statement 2020-12-19 00:18:30 +08:00
Cotes Chung
6dc6f2a7cf Improve code style 2020-12-18 21:05:47 +08:00
Cotes Chung
8e5d8b8931 Feature: display the language of code snippets 2020-12-18 20:52:39 +08:00
Cotes Chung
260a906b11 Optimize code snippet background color 2020-12-18 20:24:14 +08:00
Cotes Chung
5ffbfaec26 Beautify the pin label on home page 2020-12-17 15:30:49 +08:00
Cotes Chung
b9ffe15ffb Feature: Add reading time to posts 2020-12-17 15:30:49 +08:00
Cotes Chung
87ba30a393 Hire a new bot to deal with the issues 2020-12-17 14:33:52 +08:00
Cotes Chung
cb984aa021 Simplify checkbox with fontawesome icon 2020-12-15 15:20:40 +08:00
Cotes Chung
0225d28fd3 Beautify shape and color of checkbox 2020-12-15 00:39:50 +08:00
Cotes Chung
aba3d25d7a Always load browser default checkbox 2020-12-15 00:39:50 +08:00
Cotes Chung
dc88321ed5 Improve image style (#204) 2020-12-15 00:39:50 +08:00
Cotes Chung
cc24af11fc Revert "Improve image style (#204)"
This reverts commit 07d29ec9bf.
2020-12-14 14:02:32 +08:00
Cotes Chung
d70354021c Make table horizontal scroll (#206) 2020-12-14 02:13:31 +08:00
Cotes Chung
d61446fafc Create a more beautiful checkbox
The browser's default checkbox is too ugly, especially in dark mode
2020-12-14 02:13:31 +08:00
Cotes Chung
d0a8d072fd Add checkbox demo 2020-12-14 00:20:56 +08:00
Cotes Chung
9d59461632 Reduce the frequency of error reporting
The project maintainer determines whether it is a bug
2020-12-13 20:36:26 +08:00
Cotes Chung
cea339088b Improve the checkbox style (#207)
Hotfix: the solution of #203 will affect the layout `archives`
2020-12-13 01:45:52 +08:00
Cotes Chung
07d29ec9bf Improve image style (#204) 2020-12-13 00:43:19 +08:00
Alexandra Zaharia
464fa001b2 Add checkbox style to remove bogus rendered bullet (#203) 2020-12-13 00:35:45 +08:00
Cotes Chung
53a98feff3 Update pwa cache list 2020-12-11 23:08:57 +08:00
Cotes Chung
b8ee5a7b0c Fix underscores in the links of tags/categories (#199) 2020-12-11 23:05:36 +08:00
Cotes Chung
289ce1263d Fix detection of mermaid objects 2020-12-11 02:20:18 +08:00
Cotes Chung
63f57fbc12 Delay GA loading 2020-12-10 23:57:48 +08:00
Cotes Chung
cdaa79cf80 Improve JS loading sequence 2020-12-10 20:13:03 +08:00
Cotes Chung
d53769e52b Improve the dark-mode color of the italics in code snippet 2020-12-10 20:13:03 +08:00
Cotes Chung
7de13415e7 Update README & improve manual 2020-12-10 20:13:03 +08:00
Cotes Chung
d196645d88 Introduce the mermaid in docs 2020-12-10 06:39:03 +08:00
Cotes Chung
4d2f13c0d7 Integrate with mermaid-js 2020-12-10 05:00:01 +08:00
Cotes Chung
5ed39300cb Add gitattributes 2020-12-08 13:49:12 +08:00
Cotes Chung
d7d3bc9947 Simplify site config 2020-12-08 13:49:12 +08:00
Cotes Chung
cf3943342a Update the minimum version requirements of Jekyll
Jekyll allow custom sorting of collection documents from 4.x
2020-12-07 19:51:30 +08:00
Cotes Chung
59deef469d Improve travis config. 2020-12-07 02:19:50 +08:00
Cotes Chung
bb13b52d44 Simplify theme-mode config 2020-12-07 01:14:40 +08:00
Cotes Chung
8d4c555638 Fix gh-actions cache not being hit issue (#191) 2020-12-07 00:10:15 +08:00
Cotes Chung
cbf707dc56 Update runner tool
allow LAN access Jekyll
2020-12-06 14:17:41 +08:00
Cotes Chung
6335991164 Avoid mode switch button shifting 2020-12-06 14:09:47 +08:00
Cotes Chung
5d6014ecee Regular improvement for liquid code 2020-12-05 02:44:28 +08:00
Cotes Chung
13aca77275 Change mode-toggle icon 2020-12-05 01:40:01 +08:00
Cotes Chung
1172f1646d Restore the archive-title that was deleted by mistake 2020-12-04 14:45:17 +08:00
Cotes Chung
e27825d3eb Improve JS/CSS selector
Separate layout from tabs, and more friendly to tabs rename (#187)
2020-12-04 14:18:25 +08:00
Cotes Chung
36c4f32b17 Fix yaml syntax of workflow 2020-12-02 18:40:06 +08:00
Cotes Chung
6a326dc8e0 Improve the interceptor action
Avoid secondary runs
2020-11-30 22:04:52 +08:00
Cotes Chung
20c14c0207 Fix & rename CN version README 2020-11-30 22:04:52 +08:00
Cotes Chung
575b5c292a Bump version to 2.6.2 2020-11-29 12:32:27 +08:00
Cotes Chung
479bd72c9d Fix the 404 title on mobile devices 2020-11-29 12:25:46 +08:00
Cotes Chung
f2efae8b01 Improve the issue/pr interceptor 2020-11-28 21:48:59 +08:00
Cotes Chung
8b2e6d1bf5 Restore the runner tool 2020-11-27 23:50:22 +08:00
Cotes Chung
0250a9c9f4 Bump version to 2.6.1 2020-11-27 22:38:55 +08:00
Cotes Chung
bbfbda7562 Fix tag <updated> and <summary> of feed.xml 2020-11-27 22:27:29 +08:00
Cotes Chung
a33b2d78b0 Bump version to 2.6.0 2020-11-27 02:58:05 +08:00
Cotes Chung
1280f89217 Improve docs 2020-11-27 02:57:18 +08:00
Cotes Chung
83bfd32807 Improve the bump version tool 2020-11-27 02:57:02 +08:00
Cotes Chung
4ea320b250 Generate sitemap by plugin 2020-11-26 23:58:11 +08:00
Cotes Chung
8909438267 Move home breadcrumb to config. 2020-11-26 23:47:34 +08:00
Cotes Chung
9482249999 Update issue template 2020-11-23 23:16:45 +08:00
Cotes Chung
43d4036941 Add editorconfig
Introduced by #119
2020-11-23 22:09:26 +08:00
Cotes Chung
a410600205 Update gitignore items 2020-11-23 21:17:25 +08:00
Cotes Chung
864119e3cc Lock html-proofer in stable version (#178) 2020-11-23 14:09:22 +08:00
Cotes Chung
4702244ae8 Fix the relative links on sidebar tabs. 2020-11-23 02:46:04 +08:00
Cotes Chung
b985965bc9 Fix bundle-install failed on gh-actions.
`--local` option of bundle-install:
  if an appropriate platform-specific gem exists on rubygems.org it will not be found.

see: <https://bundler.io/v2.1/man/bundle-install.1.html>
2020-11-23 02:03:15 +08:00
Cotes Chung
a5b002b2d8 Limit Jekyll gem version
also to trigger new CI to bypass the bundle cache error in GH-Actions
2020-11-22 04:45:42 +08:00
Cotes Chung
270d3ba499 Use collections to improve the tabs 2020-11-22 04:24:09 +08:00
Cotes Chung
1f2ed3db60 Restore gem tzinfo-data for Windows & JRuby (#176) 2020-11-20 22:27:52 +08:00
Cotes Chung
08354cc4f5 Fix the test tool and CD hook 2020-11-20 15:59:35 +08:00
Cotes Chung
ea56a900a0 Update the docs for discarded tools 2020-11-19 21:47:46 +08:00
Cotes Chung
8fa1f3b497 Clean up the discarded shell scripts 2020-11-19 21:47:46 +08:00
Cotes Chung
10bc44367a Add hook to generate the lastmod of posts 2020-11-19 21:11:00 +08:00
Cotes Chung
1889b6b4e0 Using jekyll-archives to create category/tag pages. 2020-11-19 01:12:41 +08:00
Cotes Chung
aac29d43e5 Auto close the irregular issues
also fix the token key of issue-cleaner
2020-11-17 17:29:58 +08:00
Cotes Chung
c340199191 Update git-ignore list. 2020-11-17 16:54:52 +08:00
Cotes Chung
c7241ba611 Avoid PWA caching browser extensions.
such as: Chrome extension
2020-11-16 02:16:14 +08:00
Cotes Chung
d7f351b143 Upgrade jQuery & Bootstrap (js) to latest version.
Notes: Bootstrap CSS remains at 4.0.0
2020-10-28 04:18:54 +08:00
Cotes Chung
62aef9f850 Improve the SCSS code style 2020-10-27 22:08:04 +08:00
Cotes Chung
7d128769f6 Avoid GA snippet blocking HTML parsing. 2020-10-27 21:20:06 +08:00
Cotes Chung
8d4c1deb15 Improve web accessibility
- Add associated label to form elements.
- Add discernible name to links.
2020-10-27 16:42:08 +08:00
Cotes Chung
57a4bfdb82 Replace heading elements of panel with span.
Fix the heading levels audit.
2020-10-27 05:41:36 +08:00
Cotes Chung
5741aa4e18 Fix the security of cross-origin destinations link. 2020-10-27 05:32:33 +08:00
Cotes Chung
ad5b614304 Add new tool to bump version. 2020-10-26 02:24:39 +08:00
Cotes Chung
4f1735aad6 Add version tag on <head>. 2020-10-26 02:24:32 +08:00
Cotes Chung
38b87cfdd7 Fix the numeric sort of trending tags size. 2020-10-24 22:20:59 +08:00
Wei Wang
bf8996fb8b Fix typo (#159) 2020-10-23 15:42:43 +08:00
Cotes Chung
2bd99ffd33 Simplify travis config. 2020-10-19 13:53:51 +08:00
Marnick Vandecauter
46a8efb38a Improve email javascript in sidebar (#155)
This will appear in Firefox and Safari.

Remediates the issue describe here: https://stackoverflow.com/questions/21461589/javascript-mailto-using-window-open#32675594
2020-10-19 00:10:27 +08:00
Cotes Chung
b9fb716e6a Optimize the hover effect of related-post card. 2020-10-18 13:11:05 +08:00
Cotes Chung
154fb04987 Add more details to the tutorial of customize favicon 2020-10-15 16:50:09 +08:00
Cotes Chung
a95d6d7101 Add --config option to the build-tool. 2020-10-12 14:19:01 +08:00
Cotes Chung
c98fd19900 Remove comments from HTML. 2020-10-12 14:18:02 +08:00
Cotes Chung
3c2675c4a1 Upgrade GA tag (analytics.js) to the latest tag (gtag.js) 2020-10-12 06:19:11 +08:00
Cotes Chung
db5a58638d Add more class to specify image position. 2020-10-10 20:18:24 +08:00
Cotes Chung
2a2bc1ee65 Fix compatibility with Docker Desktop (for Mac)
on Docker Desktop CE (Mac) 2.4.0.0
- command `mv` will cause permission preserve error
- command `chown` will get I/O error
2020-10-10 18:08:29 +08:00
Cotes Chung
e806a8556b Fix files r/w permissions under Linux Docker (#145)
also improve the scripts
2020-10-10 00:33:13 +08:00
Cotes Chung
049b486f82 Add docker support instructions to the docs. 2020-10-08 21:30:27 +08:00
Cotes Chung
8f11f91677 Add docker option to the tools. 2020-10-08 21:14:33 +08:00
Cotes Chung
d314c02a13 Drop the deprecating command set-env in actions workflow.
replace with environment files
2020-10-08 02:42:57 +08:00
Cotes Chung
ea5b6cf1f6 Specify the image location gracefully. 2020-10-08 02:42:57 +08:00
Cotes Chung
cb908bbb2b Added caption sytle for hyperlinked images (#144). 2020-10-07 12:24:44 +08:00
Cotes Chung
c221a3e0bc Reduce image caption margin. 2020-10-06 23:41:29 +08:00
Cotes Chung
ddc1149fb5 Specify the image width. 2020-10-06 23:13:01 +08:00
Cotes Chung
944d0ad724 Add styles to image caption (#144) 2020-10-06 23:13:01 +08:00
Cotes Chung
67d962d707 Fix the bundle cache path for CD hook. 2020-10-03 16:45:17 +08:00
Cotes Chung
04ad7bf432 Update the docs & reduce the image size. 2020-09-27 13:53:57 +08:00
Cotes Chung
a0f80debb1 Remove the tool that may confuse newbie. 2020-09-27 12:42:26 +08:00
Cotes Chung
f932cf0d00 Lazy load the feature image. 2020-09-20 17:58:52 +08:00
Cotes Chung
8484a34195 Fix copy link function (#133) 2020-09-17 19:20:50 +08:00
Cotes Chung
2cf5a58adf Install yq by APT on ubuntu of gh-actions.
`brew intall` on Ubuntu is too slow (about 1 min)
2020-09-17 13:54:12 +08:00
Cotes Chung
6f7ca13507 Add yq installation on travis config. 2020-09-17 02:25:57 +08:00
Cotes Chung
766e597a3b Update the docs for installing yq. 2020-09-17 02:10:17 +08:00
Cotes Chung
d0d1e02763 Improve the CD workflow and enhance the related tools. 2020-09-17 01:28:44 +08:00
Honnix
643c8177be Use yq to process YAML content (#130)
Use yq to process YAML content.
2020-09-17 01:20:04 +08:00
Cotes Chung
092ab5bbdb Fix the compatibility of fswatch under Linux. (#112) 2020-09-15 04:59:41 +08:00
Cotes Chung
e47f73f772 Normalize the CSS rgb function (#128) 2020-09-14 20:41:37 +08:00
Cotes Chung
2d8854ba74 Fix the overlap of footnote in vertical direction. (#123) 2020-09-11 23:25:54 +08:00
김동주
36fab37225 Fix typo
change function name "deoply" -> "deploy" @ ln45, 64
2020-09-11 15:01:47 +08:00
Cotes Chung
13abcd5958 Improve the init tool & fix the deploy tool. 2020-09-04 20:38:20 +08:00
Cotes Chung
9dcab7ac1f Improve the image style. 2020-09-02 22:07:14 +08:00
Cotes Chung
d78f034f5d Fix condition in page creator script. 2020-09-01 21:37:08 +08:00
Cotes Chung
c473771af4 Pretty shell format. 2020-09-01 15:04:25 +08:00
Cotes Chung
252e33b502 Improve the deploy tool 2020-09-01 11:53:14 +08:00
Cotes Chung
232dd36b78 Enhance the script to remove the space between categories/tags and colon in YAML. 2020-09-01 01:23:15 +08:00
Cotes Chung
2d7df50774 Fix the path contains spaces lead to tool script failure (#117) 2020-08-30 15:35:02 +08:00
Cotes Chung
31656e8cda Add more details to the bug-issue template. 2020-08-30 14:41:10 +08:00
Cotes Chung
e96f9051c0 Fix the exclusion regex rule of swatch (#112) 2020-08-30 01:20:55 +08:00
Cotes Chung
cb461df071 Extend the image style to the layout page (#113) 2020-08-28 23:02:28 +08:00
Cotes Chung
e439e65258 Reduce the font size of inline code. 2020-08-23 16:09:35 +08:00
Cotes Chung
3a449672cb Upgrade web-fonts source. 2020-08-23 15:19:33 +08:00
Cotes Chung
7bb861b573 Beautify the layout for posts heading and preview-image. 2020-08-21 23:03:05 +08:00
Cotes Chung
f0b4e30363 Improve the layout of list. 2020-08-21 23:03:05 +08:00
Cotes Chung
717a501c36 Update the docs.
- Optimize the code style of markdown list
- Increase post contents (#104, #100)
2020-08-21 22:46:46 +08:00
Cotes Chung
3ddf5047b5 Add more option to script tool. 2020-08-21 13:43:10 +08:00
Cotes Chung
31ac709e04 Stop CI on branch 'production'. 2020-08-21 01:40:56 +08:00
Cotes Chung
a1b2c71b89 Increase the margin between lists. 2020-08-21 01:26:18 +08:00
Cotes Chung
e9c29aa1b5 Merge branch 'codacy-badger-codacy-badge' 2020-08-21 00:47:51 +08:00
The Codacy Badger
f947c3f3d3 Add Codacy badge 2020-08-21 00:47:43 +08:00
Cotes Chung
78e8ffd7ba Merge branch 'code-quality' 2020-08-21 00:46:48 +08:00
Cotes Chung
60a8a2fa41 Improve markdown code style. 2020-08-21 00:45:56 +08:00
Cotes Chung
9e14673349 Improve SASS code style. 2020-08-20 02:29:13 +08:00
Cotes Chung
10ab9d3364 Improve the Shell code style. 2020-08-19 23:45:10 +08:00
Cotes Chung
038bccb3ca Fix JS object injection. 2020-08-19 23:45:10 +08:00
Cotes Chung
9b35380849 Improve JS code style. 2020-08-19 23:45:10 +08:00
Cotes Chung
a8f8bbaa1c Fix the unsupported code snippets in rouge. (#101) 2020-08-15 21:10:54 +08:00
Cotes Chung
188d8ffc69 Resume the min-width of the tables.
It was lost by mistake while fixing #85
2020-08-15 01:01:27 +08:00
Cotes Chung
0809e2b132 Update travis config to fit with the gitlab flow. 2020-08-14 01:47:12 +08:00
Cotes Chung
ab0adc36cf Update the PR issue template. 2020-08-14 01:42:35 +08:00
Cotes Chung
d4397dff08 Improved the pin for posts (#99). 2020-08-11 18:15:45 +08:00
Cotes Chung
db06610fd6 Update the docs. 2020-08-11 05:58:59 +08:00
Cotes Chung
c242cf8455 Standardize posts' file name in tool scripts. 2020-08-11 05:53:00 +08:00
Cotes Chung
ad7d8ac1c9 Merge branch 'release/2.5' 2020-08-03 03:44:13 +08:00
Cotes Chung
adff74b27b Update docs for v2.5 2020-08-03 03:28:53 +08:00
Cotes Chung
1c3c22bb68 Merge branch 'feature/improve-typography' into develop 2020-08-03 02:24:12 +08:00
Cotes Chung
628d4de095 Merge branch 'feature/build-by-gh-actions' into develop 2020-08-03 02:19:13 +08:00
Cotes Chung
48b3df2ea7 Added new tools and workflow. 2020-08-03 02:05:15 +08:00
Cotes Chung
3b0cf90f5c Improved the build tool.
Allows to specify an empty base-url.
2020-08-02 01:48:47 +08:00
Cotes Chung
544f72efff Optimized font colors. 2020-07-30 05:28:16 +08:00
Cotes Chung
112091cbf6 Improved the posts layout. 2020-07-30 05:12:36 +08:00
Cotes Chung
b04bb847b1 Merge branch 'hotfix/2.4.2' 2020-07-30 02:50:19 +08:00
Cotes Chung
a71bade6eb Merge tag 'v2.4.2' into develop
Fix the CI workflow
2020-07-30 02:50:19 +08:00
Cotes Chung
6ef97f1fad Fixed CI workflow. 2020-07-30 02:48:08 +08:00
Cotes Chung
4675d42f90 Merge branch 'feature/improve-pv-fetching' into develop 2020-07-26 22:25:39 +08:00
Cotes Chung
a624b9a472 Update pv fetching tool. 2020-07-26 22:25:26 +08:00
Cotes Chung
ad48a9ab06 Fixed empty PV issue. 2020-07-26 22:25:26 +08:00
Cotes Chung
18bd1a91ef Merge branch 'hotfix/2.4.1' 2020-07-26 18:31:56 +08:00
Cotes Chung
4cff8879ac Merge tag 'v2.4.1' into develop
use git-flow to improve development
2020-07-26 18:31:56 +08:00
Cotes Chung
4dd4915bed Update issues template 2020-07-26 18:30:12 +08:00
Cotes Chung
a227ae386d Updated the contribution guide. 2020-07-26 17:06:33 +08:00
Cotes Chung
32bd36f016 Updated the CI/CD scripts. 2020-07-25 23:08:37 +08:00
Cotes Chung
aa23becd14 Split post date format code snippets.
Code improvement
2020-07-24 04:15:38 +08:00
Cotes Chung
b2f0b4cb1b Improved post date display. 2020-07-23 20:57:11 +08:00
Cotes Chung
209058b84a Code improvement.
Passing parameters to includes
2020-07-22 23:02:11 +08:00
Cotes Chung
562fcd4fd8 Fixed posts' base-url on cache list. 2020-07-17 16:27:11 +08:00
Cotes Chung
22115f3797 Optimized update list & fixed sw cache list. 2020-07-16 21:00:19 +08:00
Cotes Chung
9f3619e54a Fixed last-mod display for non-English named posts. 2020-07-16 21:00:19 +08:00
Cotes Chung
5b0aaa5403 Improved script tools.
- Allows posts to be placed in subdirectories (#41, #87).
- Identify posts file with the suffix ‘.markdown’.

**Page creator**
- Pass the posts without any categories or tags.
- Omit the YAML comments for categories/tags.

**Lastmod**
- compatible with one-digit month or day post files.
2020-07-14 23:16:43 +08:00
Cotes Chung
733bb0fbfa Updated the PR template. 2020-07-14 12:03:23 +08:00
Cotes Chung
0d47beba97 Improved the tool scripts.
- Avoid the empty lastmod file.
- Check if there is no post.
- Fixed the prompt message.
2020-07-14 03:24:25 +08:00
Cotes Chung
c0ba181246 Improved the PV fetching.
Discard some of the old permalink PV records.
2020-07-14 03:24:25 +08:00
Cotes Chung
313c44f238 Update Docs. 2020-07-12 01:30:55 +08:00
Cotes Chung
46c2cfe64e Improved the page recognition.
Useful for label localization
2020-06-30 17:39:14 +08:00
Cotes Chung
cc4f18a5a2 Simplify the publishing process.
Renamed the tool script.
2020-06-26 18:48:11 +08:00
Cotes Chung
4491c82b02 Omit the license. 2020-06-26 17:33:43 +08:00
Cotes Chung
b9b8dd8cf1 Beautified the comment block. 2020-06-24 20:47:01 +08:00
Cotes Chung
9a1eab2635 Improved the issue templates. 2020-06-24 20:46:24 +08:00
Cotes Chung
30b013f354 Make the tables responsive. (#85) 2020-06-24 20:08:38 +08:00
Cotes Chung
4d4e9a063e Ensure the LocalStroage keys are valid.
Also update the cache key name.
2020-06-24 02:57:02 +08:00
Cotes Chung
afccb144b1 Improved styles for hiding line numbers. 2020-06-24 02:57:02 +08:00
Cotes Chung
e87ef0d40e Fixed the PV cache. 2020-06-24 02:57:02 +08:00
Cotes Chung
42e0617bde Prettified the inline-code code style. 2020-06-22 21:17:58 +08:00
Cotes Chung
edeb08aa28 Removed the line number of the snippet in the search results. 2020-06-17 21:22:44 +08:00
Cotes Chung
b0a35de9c6 Resume page link hover effect. 2020-06-17 16:17:03 +08:00
Cotes Chung
b3e6fc56f7 Improved the generation rules of Categories ID.
Avoid invalidation of icon animations for closed and opened top categories when category names contain a dot.
2020-06-16 16:01:12 +08:00
Cotes Chung
618ae9dcbc Optimized the TOC position. 2020-06-11 22:01:15 +08:00
Felix Wolfsteller
47e5c3a917 Add option for mastodon contact. 2020-06-09 21:05:20 +08:00
Cotes Chung
f9706411e7 Optimized pin icon size. 2020-06-09 20:37:42 +08:00
Cotes Chung
b22da94134 Updated the docs.
- Updated the build badge on ReadMe.
- Improved the PR template.
2020-06-09 20:37:42 +08:00
Cotes Chung
4476a7d755 Improved the community docs.
- Added the PR template & code of conduct
- Improved the issue templates.
2020-06-08 22:54:40 +08:00
Felix Wolfsteller
ea4cd78921 typo fix: s/defualt/default/ 2020-06-08 15:44:59 +02:00
Cotes Chung
752d0330b7 Remove invalid links from categories page. (#79)
To pass the HTML-Proofer test.
2020-06-07 21:51:11 +08:00
Cotes Chung
fbbd387402 Otpimized pin icon layout. 2020-06-07 21:51:11 +08:00
Cotes Chung
bec344f6e9 Fixed references in the Docs. 2020-06-07 21:29:39 +08:00
Cotes Chung
ba47cc0509 Optimized responsive layout. 2020-06-07 21:22:24 +08:00
Cotes Chung
34d54f9349 Super feature: Pinned posts. 2020-06-06 18:51:56 +08:00
Cotes Chung
d1963af964 Update workflow. 2020-06-06 04:01:17 +08:00
Cotes Chung
eff2a24f4c Enhanced the related posts.
If the number of related posts is less than 3, use the latest posts to supplement.
2020-06-05 06:14:40 +08:00
Cotes Chung
3caafbd50d Unified file naming style. 2020-06-05 06:14:40 +08:00
Cotes Chung
cb37a1909d Updated the comments in site config. 2020-06-05 06:14:40 +08:00
Cotes Chung
88eac91909 Fixed anchor position (desktop views). 2020-06-02 22:14:40 +08:00
Cotes Chung
0bb9c47cf9 Hide broken image of avatar. 2020-06-02 16:18:40 +08:00
Cotes Chung
b28724b4d4 Hide the empty trending tags from panel. 2020-06-02 02:34:24 +08:00
Cotes Chung
75c57d1725 Simplified the post JS file. 2020-06-02 02:34:24 +08:00
Cotes Chung
032f5c7f83 Updated the Chinese version README. 2020-06-01 19:51:58 +08:00
Cotes Chung
75e462a9e9 Replaced the blank loading image with HTML trick. 2020-06-01 19:50:29 +08:00
mattpopovich
ef3860004e Small grammar fix 2020-06-01 16:38:31 +08:00
mattpopovich
032706d27f Fixed some spelling/typos 2020-06-01 16:38:31 +08:00
Cotes Chung
02a269910f Optimized sidebar icons location.
screen width >= 1650px
2020-06-01 16:38:31 +08:00
Cotes Chung
abdf73fff4 Added issues cleaner. 2020-05-30 19:21:09 +08:00
Cotes Chung
be1d1554ea Corrected url within mainfest. 2020-05-30 17:48:16 +08:00
Cotes Chung
a2deea6537 Split the CSS selection from head tag. 2020-05-30 17:48:16 +08:00
Cotes Chung
1a2767ca24 Combine local JS.
’yui-compressor’ is no longer used.
2020-05-30 17:48:16 +08:00
Cotes Chung
cfb67a1cb9 Fixed image lazy loading. 2020-05-29 06:18:53 +08:00
Cotes Chung
171faafc67 Unify local links to posts (#65). 2020-05-29 06:18:53 +08:00
Cotes Chung
db5eb0a18a Beautified syntax highlight for language diff. 2020-05-29 06:18:53 +08:00
Cotes Chung
582ea30459 Support the mathematical expressions (#55). 2020-05-29 06:18:53 +08:00
Cotes Chung
064cefd9ff Combine CDN resources. 2020-05-26 23:25:57 +08:00
Cotes Chung
a57baf7e2c Optimized dark mode colors.
- the further reading cards
- button back-to-top
- table
2020-05-26 14:49:54 +08:00
Cotes Chung
473ab64f74 Added Linkedin share on posts (#60). 2020-05-26 00:01:15 +08:00
Cotes Chung
c5783c1289 Reduce the heading font weight. 2020-05-23 20:41:08 +08:00
Cotes Chung
a64d00c1e6 Make lang attribute configurable 2020-05-23 17:07:06 +08:00
Cotes Chung
7382eaa953 Feature: make contact options configurable (#58, #59). 2020-05-23 15:58:21 +08:00
Cotes Chung
bcd394598b Fixed heading layout in blockquote. 2020-05-22 20:49:27 +08:00
Cotes Chung
6d38f643ae Disable PWA at local. 2020-05-22 20:25:52 +08:00
Cotes Chung
532e7ad451 Fixed a bug in the Categories hierarchy. (#48, #57)
When one post have only one category will hit the bug.
2020-05-22 18:06:40 +08:00
241 changed files with 8945 additions and 6623 deletions

11
.editorconfig Normal file
View 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
View 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
View 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

View File

@@ -1,16 +1,43 @@
# How to Contribute
I want to thank you for sparing a time to improve this project! Here are some guidelines for contributing
We want to thank you for sparing time to improve this project! Here are some guidelines for contributing
To ensure that the blog design is not confused, this project do not accept suggestions for design changes, such as colors scheme, fonts, typography, etc. If your request is about enhancement, it is recommended to first submit a `Feature Request` type issue to discuss whether your idea fits the project.
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.
## Basic Process
Generally, contribute to the project by:
1. Fork this project.
2. Create a new branch `my-new-freature`(or `fix-a-bug`), then complete the development, commit and push.
3. Submit a new `Pull Request`.
1. Fork this project on GitHub and clone it locally.
2. Create a new branch from the default branch and give it a descriptive name (e.g., `my-new-feature`, `fix-a-bug`).
3. After completing the development, submit a new _Pull Request_.
## Modifying JavaScript
If your contribution involves JS modification, please read the following sections.
### Inline Scripts
If you need to add comments to the inline JS (the JS code between the tags `<script>` and `</script>`), please use `/**/` instead of two slashes `//`. Because the HTML will be compressed by [jekyll-compress-html](https://github.com/penibelst/jekyll-compress-html) during deployment, but it cannot handle the `//` properly. And this will disrupt the structure of the compressed HTML.
### External Scripts
If you need to add or modify JavaScripts in the directory `_javascript`, you need to install [Gulp.js](https://gulpjs.com/docs/en/getting-started/quick-start).
During development, real-time debugging can be performed through the following commands:
```console
$ bash tools/run.sh
```
Open another terminal tab and run:
```console
$ gulp dev # Type 'Ctrl + C' to stop
```
After debugging, run the command `gulp` (without any argument) will automatically output the compressed files to the directory `assests/js/dist/`.
---
: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:

3
.github/FUNDING.yml vendored
View File

@@ -1 +1,2 @@
custom: ['https://www.buymeacoffee.com/coteschung', 'https://cotes.gitee.io/alipay-wechat-donation']
ko_fi: coteschung
custom: https://cotes.gitee.io/alipay-wechat-donation

View File

@@ -1,39 +1,64 @@
---
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 :) -->
## Checklist
<!-- Please complete the following list of tasks, and then check it by changing the "[ ]" to "[x]" -->
- [ ] I have read the [tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
- [ ] There are no similar reports on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
- [ ] I found the bug on the latest code of the `master` branch.
## Describe the bug
**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
**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]
<!-- 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` -->
### 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)]
-->
### 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
**Additional context**
<!-- Add any other context about the problem here. -->

View File

@@ -4,18 +4,32 @@ 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 changing the "[ ]" to "[x]" -->
- [ ] I have read the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/.github/CONTRIBUTING.md).
- [ ] There is no similar request on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
- [ ] I have read the [project progress](https://github.com/cotes2020/jekyll-theme-chirpy/projects) and know the current progress of the project.
- [ ] I 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. -->

View File

@@ -1,57 +1,20 @@
---
name: Question
about: Ask what ever you want
about: Ask whatever 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 changing the "[ ]" to "[x]" -->
<!--
**Just wanted to say hi to the author.**
Hi, I'm ..., have a nice day !
-->
- [ ] I have read the [newlest tutorials](https://cotes2020.github.io/chirpy-demo/categories/tutorial/) and know the correct effect of the functional design.
- [ ] There is no similar question on [existing issues](https://github.com/cotes2020/jekyll-theme-chirpy/issues?q=is%3Aissue) (including closed ones).
- [ ] I have tried to find the answer on [Jekyll Forum](https://talk.jekyllrb.com/) and [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll).
- [ ] My question is based on the latest code of the `master` branch.
## Description
<!--
**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.
-->
<!-- Please describe your question in detail. -->

42
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,42 @@
## 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:
- Ruby version: <!-- by running: `ruby -v` -->
- Bundler version: <!-- by running: `bundle -v`-->
- Jekyll version: <!-- by running: `bundle list | grep " jekyll "` -->
### Checklist
<!-- Select checkboxes by change the "[ ]" to "[x]" -->
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

17
.github/stale.yml vendored Normal file
View 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

View File

@@ -1,21 +1,21 @@
name: build
name: 'Continuous Integration'
on:
push:
branches-ignore:
- stable
- 'release/**'
- 'docs'
tags-ignore:
- '*'
- '**'
paths-ignore:
- '.github/**'
- '!.github/workflows/**'
- '!.github/workflows/ci.yml'
- '.travis.yml'
- '.gitignore'
- 'docs/**'
- 'README.md'
- 'LICENSE'
pull_request:
paths:
- "**"
- '**'
jobs:
ci:
@@ -25,47 +25,16 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6.x'
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 0 # for posts's lastmod
- name: Bundle Caching
id: bundle-cache
uses: actions/cache@v1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install GNU-Coreutils(for macOS)
if: runner.os == 'macOS'
run: |
brew install coreutils
- name: Bundle config
run: |
bundle config path vendor/bundle
- name: Bundle Install
if: steps.bundle-cache.outputs.cache-hit != 'true'
run: |
bundle install
- name: Bundle Install locally
if: steps.bundle-cache.outputs.cache-hit == 'true'
run: |
bundle install --local
- name: Build Site
run: |
bash tools/build.sh
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
View 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
View File

@@ -0,0 +1,29 @@
name: 'Automatic build'
on:
push:
branches:
- main
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
View File

@@ -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

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "assets/lib"]
path = assets/lib
url = https://github.com/cotes2020/chirpy-static-assets.git

1
.nojekyll Normal file
View File

@@ -0,0 +1 @@

View File

@@ -1,36 +1,41 @@
os: linux
dist: bionic
language: ruby
rvm: 2.6.5
before_install:
- bundle config path 'vendor/bundle'
install:
- bundle install --quiet
rvm: 2.7.0
addons:
apt:
packages:
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
- libcurl4-openssl-dev # 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
# Overriding to drop the `--development` flag which requires the Gemfile.lock at build
install: bundle install --jobs=3 --retry=3 --path=vendor/bundle
branches:
only: stable
before_script: git -C "$HOME" clone "$BUILDER_REPO" --depth=1 -q
git:
depth: false # for posts lastmod
jobs:
include:
- stage: Upgrade
git:
depth: false # for posts' lastmod
script: eval "$BUILD_CMD"
- stage: Starter
language: minimal
install: true # skip install step
script: eval "$FLUSH_STARTER"
- stage: Docs
cache: bundler
git:
depth: false # for posts' lastmod
script: eval "$DOCS_CMD"
cache:
directories:
- $TRAVIS_BUILD_DIR/vendor/bundle
stages:
- name: Upgrade
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
- name: Starter
if: branch =~ /^v(\d)+(\.(\d)+){2}$/ OR tag IS present
- name: Docs
if: branch = docs
notifications:
email:
@@ -40,4 +45,4 @@ notifications:
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer

View File

@@ -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>

26
Gemfile
View File

@@ -1,14 +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 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"

283
README.md
View File

@@ -1,262 +1,105 @@
# Chirpy
<div align="center">
🌏 English • [简体中文](docs/README_zh-CN.md)
# Chirpy Jekyll Theme
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=event%3Apush)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
A minimal, sidebar, responsive web design Jekyll theme, focusing on text presentation, aim to help you easily record and share your knowledge. [Live Demo »](https://chirpy.cotes.info)
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)](https://rubygems.org/gems/jekyll-theme-chirpy)
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?branch=master&event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=branch%3Amaster+event%3Apush)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4e556876a3c54d5e8f2d2857c4f43894)](https://www.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cotes2020/jekyll-theme-chirpy&amp;utm_campaign=Badge_Grade)
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/jekyll-theme-chirpy/master/assets/img/sample/devices-mockup.png)](https://chirpy.cotes.info)
[**Live Demo →**](https://cotes2020.github.io/chirpy-demo)
## Table of Contents
[![Devices Mockup](https://raw.githubusercontent.com/cotes2020/chirpy-images/main/commons/devices-mockup.png)](https://cotes2020.github.io/chirpy-demo)
* [Features](#features)
* [Installing](#installing)
* [Usage](#usage)
* [Contributing](#contributing)
* [Credits](#credits)
* [Support](#support)
* [License](#license)
</div>
## Features
* Configurable theme mode
* Two-level Categories
* Last modified date for posts
* Table of Contents
* Automatically recommend related posts
* Syntax highlighting
* Search
* Atom Feeds
* Disqus Comments
* Google Analytics
* GA Pageviews reporting (Advanced)
* SEO and Performance Optimization
- Localized Layout
- Dark/Light Theme Mode
- Pinned Posts
- Hierarchical Categories
- Last Modified Date for Posts
- Table of Contents
- Auto-generated Related Posts
- Syntax Highlighting
- Mathematical Expressions
- Mermaid Diagram & Flowchart
- Disqus/Utterances/Giscus Comments
- Search
- Atom Feeds
- Google Analytics
- GA Pageviews Reporting
- SEO & Performance Optimization
## Installing
### Prerequisites
## Quick Start
Follow the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installtion of basic environment (`Ruby `, `RubyGems` and `Bundler`).
Before starting, please follow the instructions in the [Jekyll Docs](https://jekyllrb.com/docs/installation/) to complete the installation of `Ruby`, `RubyGems`, `Jekyll`, and `Bundler`. In addition, [Git](https://git-scm.com/) is also required to be installed.
To improve the writing experience, we need to use some script tools. If your machine is running Debian or macOS, make sure that [GNU coreutils](https://www.gnu.org/software/coreutils/) is installed. Otherwise, install by:
### Step 1. Creating a New Site
* Debian
Create a new repository from the [**Chirpy Starter**](https://github.com/cotes2020/chirpy-starter/generate) and name it `<GH_USERNAME>.github.io`, where `GH_USERNAME` represents your GitHub username.
### Step 2. Installing Dependencies
Before running for the first time, go to the root directory of your site, and install dependencies as follows:
```console
$ sudo apt-get install coreutils
$ bundle
```
* macOS
### Step 3. Running Local Server
Run the following command in the root directory of the site:
```console
$ brew install coreutils
$ bundle exec jekyll s
```
### Jekyll Plugins
[Fork **Chirpy** from GitHub](https://github.com/cotes2020/jekyll-theme-chirpy/fork), then clone your forked repo to local:
Or run with Docker:
```console
$ git clone git@github.com:USER/jekyll-theme-chirpy.git -b master
$ docker run -it --rm \
--volume="$PWD:/srv/jekyll" \
-p 4000:4000 jekyll/jekyll \
jekyll serve
```
and replace the `USER` above to your GitHub username.
After a while, navigate to the site at <http://localhost:4000>.
The first time you run or build the project on local machine, perform the installation of Jekyll plugins. Go to the root of repo and run:
## Documentation
```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
### Configuration
Generally, go to `_config.yml` and configure 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 content 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, checkout the file `_config.yml` and make sure that the `url` has been configured. What's more, if you prefer the [Project site on GitHub](https://help.github.com/en/github/working-with-github-pages/about-github-pages#types-of-github-pages-sites) and also use the default domain `<username>.github.io`, remember to change the `baseurl` to your project name that starting with a slash. For example, `/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.
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:
```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).
```
**3**. Push the changes to `origin/master` then go to GitHub website and enable GitHub Pages service for the repo.
**4**. Check it out:
|Site Type | Site URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
#### 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:
```console
$ bash tools/build.sh -d /path/to/local/project/
```
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.
**3**. Go to GitHub website and enable Pages service for the new repository.
**4**. Visit at:
|Site Type | Site URL |
|:---|:---|
|User or Organization | `https://<username>.github.io/`|
|Project| `https://<username>.github.io/project/`|
#### Finishing work
No matter which way you choose to deploy the website on GitHub, please enforce the `HTTPS` for it. See official docs: [Configuring a publishing source for your GitHub Pages site](https://help.github.com/en/github/working-with-github-pages/securing-your-github-pages-site-with-https).
### Documentation
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).
For more details on usage, please refer to the tutorial on the [demo website](https://cotes2020.github.io/chirpy-demo/) / [wiki](https://github.com/cotes2020/jekyll-theme-chirpy/wiki). Note that the tutorial is based on the [latest tag](https://github.com/cotes2020/jekyll-theme-chirpy/tags), and the features of the default branch are usually ahead of the documentation.
## Contributing
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).
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 come 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 OSS development 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!
[![Ko-fi](https://img.shields.io/badge/-Buy%20Me%20a%20Coffee-ff5f5f?logo=ko-fi&logoColor=white)](https://ko-fi.com/coteschung)
[![Wechat Pay](https://img.shields.io/badge/-Tip%20Me%20on%20WeChat-brightgreen?logo=wechat&logoColor=white)][cn-donation]
[![Alipay](https://img.shields.io/badge/-Tip%20Me%20on%20Alipay-blue?logo=alipay&logoColor=white)][cn-donation]
## License
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
This work is published under [MIT](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE) License.
<!-- ReadMe links -->
[jb]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
[cn-donation]: https://cotes.gitee.io/alipay-wechat-donation/

View File

@@ -1,28 +1,35 @@
# 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
# Additional parameters for datetime localization, optional. https://github.com/iamkun/dayjs/tree/dev/src/locale
prefer_datetime_locale:
# Change to your timezone http://www.timezoneconverter.com/cgi-bin/findzone/findzone
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.
A minimal, responsive, and powerful Jekyll theme for presenting professional writing.
# 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 +38,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
@@ -41,59 +50,79 @@ social:
# - https://www.facebook.com/username
# - https://www.linkedin.com/in/username
google_site_verification: google_meta_tag_verification # change to your verification string
google_site_verification: # fill in 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
#--------------------------
# The end of `jekyll-seo-tag` settings
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
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:
# Prefer color scheme setting.
#
# 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.
# 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: dual
theme_mode: # [light|dark]
# boolean type, global switch for ToC in posts.
# 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://raw.githubusercontent.com/cotes2020/chirpy-images/main'
# the avatar on sidebar, support local or CORS resources
avatar: '/commons/avatar.jpg'
# boolean type, the global switch for ToC in posts.
toc: true
comments:
active: # The global switch for posts comments, e.g., 'disqus'. Keep it empty means disable
# The active options are as follows:
disqus:
shortname: # fill with the Disqus shortname. https://help.disqus.com/en/articles/1717111-what-s-a-shortname
# utterances settings https://utteranc.es/
utterances:
repo: # <gh-username>/<repo>
issue_term: # < url | pathname | title | ...>
# Giscus options https://giscus.app
giscus:
repo: # <gh-username>/<repo>
repo_id:
category:
category_id:
mapping: # optional, default to 'pathname'
input_position: # optional, default to 'bottom'
lang: # optional, default to the value of `site.lang`
# Self-hosted static assets, optional https://github.com/cotes2020/chirpy-static-assets
assets:
self_host:
enabled: # boolean, keep empty means false
# specify the Jekyll environment, empty means both
# only works if `assets.self_host.enabled` is 'true'
env: # [development|production]
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'
syntax_highlighter_opts: # Rouge Options https://github.com/jneen/rouge#full-options
css_class: highlight
# default_lang: console
span:
line_numbers: false
@@ -101,104 +130,68 @@ 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
- scope:
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: /
-
scope:
# 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
values:
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
- scope:
path: ''
type: tabs # see `site.collections`
values:
layout: page
dynamic_title: true # Hide title in mobile screens.
breadcrumb:
-
label: Home
url: /
-
scope:
path: assets/data
permalink: /:title/
- scope:
path: assets/img/favicons
values:
layout: compress
swcache: true
- scope:
path: assets/js/dist
values:
swcache: true
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
- package*.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/

View File

@@ -0,0 +1,62 @@
# CDNs
cdns:
# Google Fonts
- url: https://fonts.googleapis.com
- url: https://fonts.gstatic.com
args: crossorigin
- url: https://fonts.googleapis.com
# jsDelivr CDN
- url: https://cdn.jsdelivr.net
# fonts
webfonts: https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
# Libraries
jquery:
js: https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
bootstrap:
css: https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css
js: https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.bundle.min.js
bootstrap-toc:
css: https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.css
js: https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@1.0.1/dist/bootstrap-toc.min.js
fontawesome:
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.11.2/css/all.min.css
search:
js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
mermaid:
js: https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js
dayjs:
js:
common: https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js
locale: https://cdn.jsdelivr.net/npm/dayjs@1/locale/:LOCALE.min.js
relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.min.js
localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1/plugin/localizedFormat.min.js
countup:
js: https://cdn.jsdelivr.net/npm/countup.js@1.9.3/dist/countUp.min.js
magnific-popup:
css: https://cdn.jsdelivr.net/npm/magnific-popup@1/dist/magnific-popup.min.css
js: https://cdn.jsdelivr.net/npm/magnific-popup@1/dist/jquery.magnific-popup.min.js
lozad:
js: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
clipboard:
js: https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js
polyfill:
js: https://polyfill.io/v3/polyfill.min.js?features=es6
mathjax:
js: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js

View File

@@ -0,0 +1,51 @@
# fonts
webfonts: /assets/lib/fonts/main.css
# Libraries
jquery:
js: /assets/lib/jquery-3.6.0/jquery.min.js
bootstrap:
css: /assets/lib/bootstrap-4.6.1/bootstrap.min.css
js: /assets/lib/bootstrap-4.6.1/bootstrap.bundle.min.js
bootstrap-toc:
css: /assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css
js: /assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js
fontawesome:
css: /assets/lib/fontawesome-free-5.15.4/css/all.min.css
search:
js: /assets/lib/simple-jekyll-search-1.10.0/simple-jekyll-search.min.js
mermaid:
js: /assets/lib/mermaid-8.13.10/mermaid.min.js
dayjs:
js:
common: /assets/lib/dayjs-1.10.7/dayjs.min.js
locale: /assets/lib/dayjs-1.10.7/locale/en.min.js
relativeTime: /assets/lib/dayjs-1.10.7/plugin/relativeTime.min.js
localizedFormat: /assets/lib/dayjs-1.10.7/plugin/localizedFormat.min.js
countup:
js: /assets/lib/countup.js-1.9.3/countUp.min.js
magnific-popup:
css: /assets/lib/magnific-popup-1.1.0/magnific-popup.css
js: /assets/lib/magnific-popup-1.1.0/jquery.magnific-popup.min.js
lozad:
js: /assets/lib/lozad-1.16.0/lozad.min.js
clipboard:
js: /assets/lib/clipboard-2.0.9/clipboard.min.js
polyfill:
js: /assets/lib/polyfill-v3-es6/polyfill.min.js
mathjax:
js: /assets/lib/mathjax-3.2.0/tex-chtml.js

30
_data/contact.yml Normal file
View 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

View File

@@ -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"

View File

@@ -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

78
_data/locales/en.yml Normal file
View File

@@ -0,0 +1,78 @@
# 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: Recently Updated
trending_tags: Trending Tags
toc: Contents
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:
written_by: By
posted: Posted
updated: Updated
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

78
_data/locales/id-ID.yml Normal file
View File

@@ -0,0 +1,78 @@
# 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
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:
written_by: Oleh
posted: Diterbitkan
updated: Diperbarui
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

78
_data/locales/ko-KR.yml Normal file
View File

@@ -0,0 +1,78 @@
# The layout text of site
# ----- Commons label -----
layout:
post: 포스트
category: 카테고리
tag: 태그
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home:
categories: 카테고리
tags: 태그
archives: 아카이브
about: 정보
# the text displayed in the search bar & search results
search:
hint: 검색
cancel: 취소
no_results: 검색 결과가 없습니다.
panel:
lastmod: 최근 업데이트
trending_tags: 인기 태그
toc: 바로가기
copyright:
# Shown at the bottom of the post
license:
template: 이 기사는 저작권자의 :LICENSE_NAME 라이센스를 따릅니다.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: 일부 권리 보유
verbose: >-
명시되지 않는 한 이 사이트의 블로그 게시물은 작성자의
Creative Commons Attribution 4.0 International(CC BY 4.0) 라이선스에 따라 사용이 허가되었습니다.
meta: Powered by :PLATFORM with :THEME theme.
not_found:
statment: 해당 URL은 존재하지 않습니다.
hint_template: :HEAD_BAK을 눌러 다시 찾거나 :ARCHIVES_PAGE에서 검색해 주세요.
head_back: 홈으로 돌아가기
archives_page: 아카이브 페이지
# ----- Posts related labels -----
post:
written_by: By
posted: 게시
updated: 업데이트
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: 포스트

78
_data/locales/my-MM.yml Normal file
View File

@@ -0,0 +1,78 @@
# The layout text of site
# ----- Commons label -----
layout:
post: ပို့စ်
category: ကဏ္ဍ
tag: နာမ(တက်ဂ်)
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: အဓိကစာမျက်နှာ
categories: ကဏ္ဍများ
tags: နာမ(တက်ဂ်)များ
archives: မှတ်တမ်း​တိုက်
about: အကြောင်းအရာ
# the text displayed in the search bar & search results
search:
hint: ရှာဖွေမည်
cancel: ဖျက်သိမ်းမည်
no_results: အိုး! ဘာမှမရှိပါ
panel:
lastmod: မကြာသေးမီကမွမ်းမံထားသည်
trending_tags: ခေတ်စားနေသည့်တက်ဂ်များ
toc: အကြောင်းအရာများ
copyright:
# Shown at the bottom of the post
license:
template: ဤပို့စ်သည်စာရေးသူ၏ :LICENSE_NAME လိုင်စင်ရထားသည်။
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: မူပိုင်ခွင့်အချို့ကို လက်ဝယ်ထားသည်။
verbose: >-
အခြားမှတ်သားထားချက်များမှလွဲ၍ ဤဆိုက်ရှိ ဘလော့ဂ်ပို့စ်များသည် စာရေးသူ၏
Creative Commons Attribution 4.0 International (CC BY 4.0) အောက်တွင် လိုင်စင်ရထားပါသည်။
meta: Powered by :PLATFORM with :THEME theme.
not_found:
statment: ဝမ်းနည်းပါသည်၊ ကျွန်ုပ်တို့သည် အဆိုပါ URL ကို မှားယွင်းစွာ နေရာချထားခြင်း သို့မဟုတ် ၎င်းသည် မရှိသောအရာကို ညွှန်ပြနေပါသည်။
hint_template: ၎င်းကို ထပ်မံရှာဖွေရန် :HEAD_BAK , သို့မဟုတ် :ARCHIVES_PAGE တွင်ရှာပါ။
head_back: အဓိကစာမျက်နှာသို့ပြန်သွားပါ။
archives_page: မှတ်တမ်း​တိုက် စာမျက်နှာ။
# ----- Posts related labels -----
post:
written_by: ကရေးသားခဲ့သည်။
posted: တင်ထားခဲ့သည်။
updated: မွမ်းမံထားခဲ့သည်။
words: စကားလုံးများ
pageview_measure: အမြင်များ
read_time:
unit: မိနစ်
prompt: ဖတ်ပါမည်
relate_posts: နောက်ထပ်ဖတ်ရန်
share: မျှဝေရန်
button:
next: အသစ်များ
previous: အဟောင်းများ
copy_code:
succeed: ကူးယူလိုက်ပြီ။
share_link:
title: လင့်ခ်ကို ကူးယူရန်
succeed: လင့်ခ်ကို ကူးယူလိုက်ပြီ။
# pinned prompt of posts list on homepage
pin_prompt: ချိတ်ထားသည်။
# categories page
categories:
category_measure: ကဏ္ဍများ
post_measure: ပို့စ်များ

78
_data/locales/ru-RU.yml Normal file
View File

@@ -0,0 +1,78 @@
# The layout text of site
# ----- Commons label -----
layout:
post: Публикация
category: Категория
tag: Тег
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: Домашняя страница
categories: Категории
tags: Теги
archives: Архив
about: О сайте
# the text displayed in the search bar & search results
search:
hint: поиск
cancel: Отменить
no_results: Ох! Ничего не найдено.
panel:
lastmod: Недавно обновлено
trending_tags: Популярные теги
toc: Содержание
copyright:
# Shown at the bottom of the post
license:
template: Публикация защищена лицензией :LICENSE_NAME.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: Некоторые права защищены.
verbose: >-
Публикации на сайте защищены лицензией Creative Commons Attribution 4.0 International (CC BY 4.0),
если в тексте публикации не указано иное.
meta: Powered by :PLATFORM with :THEME theme.
not_found:
statment: Извините, эта ссылка указывает на ресурс который не существует.
hint_template: :HEAD_BAK чтобы снова осуществить поиск, или поищите :ARCHIVES_PAGE.
head_back: Вернитесь на домашнюю страницу
archives_page: архиве
# ----- Posts related labels -----
post:
written_by: Автор
posted: Время публикации
updated: Обновлено
words: слов
pageview_measure: просмотров
read_time:
unit: минут
prompt: чтения
relate_posts: Вам также может быть интересно
share: Поделиться
button:
next: Предыдущая публикация
previous: Следующая публикация
copy_code:
succeed: Скопировано успешно!
share_link:
title: Скопировать ссылку
succeed: Ссылка успешно скопирована!
# pinned prompt of posts list on homepage
pin_prompt: Закреплено
# categories page
categories:
category_measure: категории
post_measure: публикации

78
_data/locales/uk-UA.yml Normal file
View File

@@ -0,0 +1,78 @@
# The layout text of site
# ----- Commons label -----
layout:
post: Публікація
category: Категорія
tag: Тег
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: Домашня сторінка
categories: Категорії
tags: Теги
archives: Архів
about: Про сайт
# the text displayed in the search bar & search results
search:
hint: пошук
cancel: Скасувати
no_results: Ох! Нічого не знайдено.
panel:
lastmod: Нещодавно оновлено
trending_tags: Популярні теги
toc: Зміст
copyright:
# Shown at the bottom of the post
license:
template: Публікація захищена ліцензією :LICENSE_NAME.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: Деякі права захищено.
verbose: >-
Публікації на сайті захищено ліцензією Creative Commons Attribution 4.0 International (CC BY 4.0),
якщо інше не вказано в тексті.
meta: Powered by :PLATFORM with :THEME theme.
not_found:
statment: Вибачте, це посилання вказує на ресурс, що не існує.
hint_template: :HEAD_BAK аби здійснити пошук, або пошукайте в :ARCHIVES_PAGE.
head_back: Поверніться на домашню сторінку
archives_page: архіві
# ----- Posts related labels -----
post:
written_by: Автор
posted: Час публікації
updated: Оновлено
words: слів
pageview_measure: переглядів
read_time:
unit: хвилин
prompt: читання
relate_posts: Вас також може зацікавити
share: Поділитися
button:
next: Попередня публікація
previous: Наступна публікація
copy_code:
succeed: Успішно скопійовано!
share_link:
title: Скопіювати посилання
succeed: Посилання успішно скопійовано!
# pinned prompt of posts list on homepage
pin_prompt: Закріплено
# categories page
categories:
category_measure: категорії
post_measure: публікації

77
_data/locales/zh-CN.yml Normal file
View File

@@ -0,0 +1,77 @@
# The layout text of site
# ----- Commons label -----
layout:
post: 文章
category: 分类
tag: 标签
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: 首页
categories: 分类
tags: 标签
archives: 归档
about: 关于
# the text displayed in the search bar & search results
search:
hint: 搜索
cancel: 取消
no_results: 搜索结果为空
panel:
lastmod: 最近更新
trending_tags: 热门标签
toc: 文章内容
copyright:
# Shown at the bottom of the post
license:
template: 本文由作者按照 :LICENSE_NAME 进行授权
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: 保留部分权利。
verbose: >-
除非另有说明,本网站上的博客文章均由作者按照知识共享署名 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:
written_by: 作者
posted: 发表于
updated: 更新于
words:
pageview_measure: 次浏览
read_time:
unit: 分钟
prompt: 阅读
relate_posts: 相关文章
share: 分享
button:
next: 下一篇
previous: 上一篇
copy_code:
succeed: 已复制!
share_link:
title: 分享链接
succeed: 链接已复制!
# pinned prompt of posts list on homepage
pin_prompt: 顶置
# categories page
categories:
category_measure: 个分类
post_measure: 篇文章

View File

@@ -1,17 +0,0 @@
# License data.
#
# v2.1
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed
license:
name: CC BY 4.0
link: "https://creativecommons.org/licenses/by/4.0/"
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.

View File

@@ -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:
-
@@ -20,10 +13,15 @@ platforms:
-
type: Telegram
icon: "fab fa-telegram"
link: "https://telegram.me/share?text=TITLE&url=URL"
link: "https://t.me/share/url?url=URL&text=TITLE"
# 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"

View File

@@ -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

View File

@@ -0,0 +1,12 @@
{% comment %} Site static assets origin {% endcomment %}
{% assign origin = 'cross_origin' %}
{% if site.assets.self_host.enabled %}
{% if site.assets.self_host.env %}
{% if site.assets.self_host.env == jekyll.environment %}
{% assign origin = 'self_host' %}
{% endif %}
{% else %}
{% assign origin = 'self_host' %}
{% endif %}
{% endif %}

5
_includes/comments.html Normal file
View File

@@ -0,0 +1,5 @@
<!-- The comments switcher -->
{% if page.comments and site.comments.active %}
{% capture path %}comments/{{ site.comments.active }}.html{% endcapture %}
{% include {{ path }} %}
{% endif %}

View File

@@ -0,0 +1,54 @@
<!--
The Disqus lazy loading.
-->
<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 type="text/javascript">
var disqus_config = function () {
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url }}';
};
/* 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.comments.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 (typeof modeToggle !== "undefined") {
/* modeToggle.addEventListener('click', reloadDisqus); // not pretty for 'color-scheme' */
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', reloadDisqus);
}
</script>

View File

@@ -0,0 +1,56 @@
<!-- https://giscus.app/ -->
<script type="text/javascript">
$(function () {
const origin = "https://giscus.app";
const iframe = "iframe.giscus-frame";
const lightTheme = "light";
const darkTheme = "dark_dimmed";
let initTheme = lightTheme;
if ($("html[data-mode=dark]").length > 0
|| ($("html[data-mode]").length == 0
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
initTheme = darkTheme;
}
let giscusAttributes = {
"src": "https://giscus.app/client.js",
"data-repo": "{{ site.comments.giscus.repo}}",
"data-repo-id": "{{ site.comments.giscus.repo_id }}",
"data-category": "{{ site.comments.giscus.category }}",
"data-category-id": "{{ site.comments.giscus.category_id }}",
"data-mapping": "{{ site.comments.giscus.mapping | default: 'pathname' }}",
"data-reactions-enabled": "1",
"data-emit-metadata": "0",
"data-theme": initTheme,
"data-input-position": "{{ site.comments.giscus.input_position | default: 'bottom' }}",
"data-lang": "{{ site.comments.giscus.lang | default: lang }}",
"crossorigin": "anonymous",
"async": ""
};
let giscusScript = document.createElement("script");
Object.entries(giscusAttributes).forEach(([key, value]) => giscusScript.setAttribute(key, value));
document.getElementById("tail-wrapper").appendChild(giscusScript);
addEventListener("message", (event) => {
if (event.source === window && event.data &&
event.data.direction === ModeToggle.ID) {
/* global theme mode changed */
const mode = event.data.message;
const theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
const message = {
setConfig: {
theme: theme
}
};
const giscus = document.querySelector(iframe).contentWindow;
giscus.postMessage({ giscus: message }, origin);
}
});
});
</script>

View File

@@ -0,0 +1,51 @@
<!-- https://utteranc.es/ -->
<script src="https://utteranc.es/client.js"
repo="{{ site.comments.utterances.repo }}"
issue-term="{{ site.comments.utterances.issue_term }}"
crossorigin="anonymous"
async>
</script>
<script type="text/javascript">
$(function() {
const origin = "https://utteranc.es";
const iframe = "iframe.utterances-frame";
const lightTheme = "github-light";
const darkTheme = "github-dark";
let initTheme = lightTheme;
if ($("html[data-mode=dark]").length > 0
|| ($("html[data-mode]").length == 0
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) {
initTheme = darkTheme;
}
addEventListener("message", (event) => {
let theme;
/* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */
if (event.origin === origin) {
/* page initial */
theme = initTheme;
} else if (event.source === window && event.data &&
event.data.direction === ModeToggle.ID) {
/* global theme mode changed */
const mode = event.data.message;
theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme);
} else {
return;
}
const message = {
type: "set-theme",
theme: theme
};
const utterances = document.querySelector(iframe).contentWindow;
utterances.postMessage(message, origin);
});
});
</script>

View File

@@ -1,26 +0,0 @@
<!--
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>
<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 }}';
this.page.identifier = '{{ page.url }}';
}
};
$.disqusLoader('#disqus', options);
</script>

View File

@@ -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">

View File

@@ -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 %}

View File

@@ -1,31 +1,35 @@
<!--
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">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between align-items-center text-muted">
<div class="footer-left">
<p class="mb-0">
© {{ 'now' | date: "%Y" }}
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
{% if site.data.rights.brief %}
{% if site.data.locales[lang].copyright.brief %}
<span data-toggle="tooltip" data-placement="top"
title="{{ site.data.rights.verbose }}">{{ site.data.rights.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
<a href="https://github.com/cotes2020/jekyll-theme-chirpy/">Chirpy</a>
theme.
{% 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>

View File

@@ -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>

View File

@@ -1,150 +1,90 @@
<!--
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>
<!-- Allow having a localized datetime different from the appearance language -->
{% if site.prefer_datetime_locale %}
<meta name="prefer-datetime-locale" content="{{ site.prefer_datetime_locale }}">
{% endif %}
{% if page.layout == 'home' or page.layout == 'post' %}
{% if 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 -->
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
{% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
<!-- ga -->
{% if jekyll.environment == 'production' %}
<link href="{{ site.data.assets[origin].webfonts | relative_url }}" rel="stylesheet">
{% else %}
{% for cdn in site.data.assets[origin].cdns %}
<link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
<link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
{% endfor %}
<link rel="stylesheet" href="{{ site.data.assets[origin].webfonts }}">
{% endif %}
<!-- GA -->
{% if jekyll.environment == 'production'
and site.google_analytics.id != empty and site.google_analytics.id %}
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
<link rel="dns-prefetch" href="https://www.google-analytics.com">
<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">
<!-- Bootstrap -->
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css }}">
<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>
<!-- Font Awesome -->
<link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.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">
<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">
<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">
{% 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">
{% elsif page.layout == 'page' %}
{% if page.title == 'Categories' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/categories.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/categories.css">
{% elsif page.title == 'Tags' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/tags.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/tags.css">
{% elsif page.title == 'Archives' %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/archives.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/archives.css">
{% else %}
<link rel="preload" href="{{ site.baseurl }}/assets/css/page.css" as="style">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/page.css">
{% endif %}
{% elsif 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">
{% elsif page.layout == 'post' %}
<link rel="preload" as="style" href="{{ site.baseurl }}/assets/css/post.css">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/post.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="stylesheet" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css" />
{% endif %}
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
{% if site.toc and page.toc %}
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.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 %}
{% if page.layout == 'page' or page.layout == 'post' %}
<!-- Manific Popup -->
<link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css }}">
{% endif %}
{% if site.toc and page.toc and page.layout == 'post' %}
<link rel="preload" as="script" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js">
<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 %}
<!-- JavaScript -->
<script src="{{ site.baseurl }}/assets/js/dist/tooltip-loader.min.js" async></script>
<script src="{{ site.data.assets[origin].jquery.js }}"></script>
<!-- PWA -->
<script src="{{ '/app.js' | relative_url }}" defer></script>
</head>
</head>

100
_includes/js-selector.html Normal file
View File

@@ -0,0 +1,100 @@
<!--
JS selector for site.
-->
<!-- layout specified -->
{% if 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="{{ site.data.assets[origin].countup.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 & clipboard -->
{% assign _urls = site.data.assets[origin].magnific-popup.js
| append: ',' | append: site.data.assets[origin].lozad.js
| append: ',' | append: site.data.assets[origin].clipboard.js
%}
{% include jsdelivr-combine.html urls=_urls %}
{% endif %}
{% if page.layout == 'home'
or page.layout == 'post'
or page.layout == 'archives'
or page.layout == 'category'
or page.layout == 'tag' %}
{% if site.prefer_datetime_locale %}
{% assign locale = site.prefer_datetime_locale | downcase %}
{% else %}
{% assign locale = site.lang | split: '-' | first %}
{% endif %}
{% assign _urls = site.data.assets[origin].dayjs.js.common
| append: ',' | append: site.data.assets[origin].dayjs.js.locale
| replace: ':LOCALE', locale
| append: ',' | append: site.data.assets[origin].dayjs.js.relativeTime
| append: ',' | append: site.data.assets[origin].dayjs.js.localizedFormat
%}
{% include jsdelivr-combine.html urls=_urls %}
{% endif %}
{% if page.layout == 'home'
or page.layout == 'categories'
or page.layout == 'post'
or page.layout == 'page' %}
{% assign type = page.layout %}
{% elsif page.layout == 'archives'
or page.layout == 'category'
or page.layout == 'tag' %}
{% assign type = "misc" %}
{% else %}
{% assign type = "commons" %}
{% endif %}
{% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
<script defer src="{{ script | 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="{{ site.data.assets[origin].polyfill.js }}"></script>
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js }}">
</script>
{% endif %}
<!-- commons -->
<script src="{{ site.data.assets[origin].bootstrap.js }}"></script>
{% if jekyll.environment == 'production' %}
<!-- PWA -->
<script defer src="{{ '/app.js' | relative_url }}"></script>
<!-- GA -->
{% if site.google_analytics.id != empty and site.google_analytics.id %}
{% include google-analytics.html %}
{% endif %}
{% endif %}

View File

@@ -0,0 +1,32 @@
{% assign urls = include.urls | split: ',' %}
{% assign combined_urls = nil %}
{% assign domain = 'https://cdn.jsdelivr.net/' %}
{% for url in urls %}
{% if url contains domain %}
{% assign url_snippet = url | slice: domain.size, url.size %}
{% if combined_urls %}
{% assign combined_urls = combined_urls | append: ',' | append: url_snippet %}
{% else %}
{% assign combined_urls = domain | append: 'combine/' | append: url_snippet %}
{% endif %}
{% elsif url contains '//' %}
<script src="{{ url }}"></script>
{% else %}
<script src="{{ url | relative_url }}"></script>
{% endif %}
{% endfor %}
{% if combined_urls %}
<script src="{{ combined_urls }}"></script>
{% endif %}

8
_includes/lang.html Normal file
View 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 %}

View File

@@ -0,0 +1,70 @@
{% 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 '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', 'json' %}
{{ _lang | upcase }}
{% else %}
{{ _lang | capitalize }}
{% endcase %}

View File

@@ -1,7 +0,0 @@
<!-- image lazy load: https://github.com/ApoorvSaxena/lozad.js -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
<script type="text/javascript">
const el = document.querySelectorAll('#post-wrapper img');
const observer = lozad(el);
observer.observe();
</script>

57
_includes/mermaid.html Normal file
View File

@@ -0,0 +1,57 @@
<!--
mermaid-js loader
-->
<script src="{{ site.data.assets[origin].mermaid.js }}"></script>
<script>
$(function() {
function updateMermaid(event) {
if (event.source === window && event.data &&
event.data.direction === ModeToggle.ID) {
const mode = event.data.message;
if (typeof mermaid === "undefined") {
return;
}
let expectedTheme = (mode === ModeToggle.DARK_MODE? "dark" : "default");
let config = { theme: expectedTheme };
/* Re-render the SVG <https://github.com/mermaid-js/mermaid/issues/311#issuecomment-332557344> */
$(".mermaid").each(function() {
let svgCode = $(this).prev().children().html();
$(this).removeAttr("data-processed");
$(this).html(svgCode);
});
mermaid.initialize(config);
mermaid.init(undefined, ".mermaid");
}
}
let initTheme = "default";
if ($("html[data-mode=dark]").length > 0
|| ($("html[data-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);
window.addEventListener("message", updateMermaid);
});
</script>

View File

@@ -1,25 +1,18 @@
<!--
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" dark-mode-invisible></i>
<i class="mode-toggle fas fa-moon" light-mode-invisible></i>
<script type="text/javascript">
class ModeToggle {
static get MODE_KEY() { return "mode"; }
static get MODE_ATTR() { return "data-mode"; }
static get DARK_MODE() { return "dark"; }
static get LIGHT_MODE() { return "light"; }
static get ID() { return "mode-toggle"; }
constructor() {
if (this.mode != null) {
if (this.mode == ModeToggle.DARK_MODE) {
if (this.hasMode) {
if (this.isDarkMode) {
if (!this.isSysDarkPrefer) {
this.setDark();
}
@@ -30,12 +23,12 @@
}
}
var self = this;
let self = this;
/* always follow the system prefers */
this.sysDarkPrefers.addListener(function() {
if (self.mode != null) {
if (self.mode == ModeToggle.DARK_MODE) {
this.sysDarkPrefers.addEventListener("change", () => {
if (self.hasMode) {
if (self.isDarkMode) {
if (!self.isSysDarkPrefer) {
self.setDark();
}
@@ -48,71 +41,89 @@
self.clearMode();
}
self.notify();
});
} /* constructor() */
setDark() {
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
}
setLight() {
$('html').attr(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
}
clearMode() {
$('html').removeAttr(ModeToggle.MODE_KEY);
sessionStorage.removeItem(ModeToggle.MODE_KEY);
}
get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
get isDarkMode() { return this.mode == ModeToggle.DARK_MODE; }
get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
get isLightkMode() { return this.mode == ModeToggle.LIGHT_MODE; }
get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
get hasMode() { return this.mode != null; }
get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
flipMode() {
if (this.hasMode) {
if (this.isSysDarkPrefer) {
if (this.isLightkMode) {
this.clearMode();
} else {
this.setLight();
}
} else {
if (this.isDarkMode) {
this.clearMode();
} else {
this.setDark();
}
}
/* get the current mode on screen */
get modeStatus() {
if (this.isDarkMode
|| (!this.hasMode && this.isSysDarkPrefer)) {
return ModeToggle.DARK_MODE;
} else {
if (this.isSysDarkPrefer) {
this.setLight();
} else {
this.setDark();
}
return ModeToggle.LIGHT_MODE;
}
}
} /* flipMode() */
setDark() {
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.DARK_MODE);
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
}
setLight() {
$('html').attr(ModeToggle.MODE_ATTR, ModeToggle.LIGHT_MODE);
sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
}
clearMode() {
$('html').removeAttr(ModeToggle.MODE_ATTR);
sessionStorage.removeItem(ModeToggle.MODE_KEY);
}
/* Notify another plugins that the theme mode has changed */
notify() {
window.postMessage({
direction: ModeToggle.ID,
message: this.modeStatus
}, "*");
}
} /* ModeToggle */
let toggle = new ModeToggle();
const toggle = new ModeToggle();
$(".mode-toggle").click(function() {
toggle.flipMode();
});
function flipMode() {
if (toggle.hasMode) {
if (toggle.isSysDarkPrefer) {
if (toggle.isLightMode) {
toggle.clearMode();
} else {
toggle.setLight();
}
</script>
} else {
if (toggle.isDarkMode) {
toggle.clearMode();
} else {
toggle.setDark();
}
}
} else {
if (toggle.isSysDarkPrefer) {
toggle.setLight();
} else {
toggle.setDark();
}
}
toggle.notify();
} /* flipMode() */
</script>

View File

@@ -1,12 +1,10 @@
{% comment %}
Remove line numbers from code snippets.
v2.2
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
Published under the MIT License
Remove the line number of the code snippet.
{% endcomment %}
{% 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">' %}
{% 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 %}

View File

@@ -1,72 +0,0 @@
<!--
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 text-muted topbar-down">
<div class="access">
{% if site.data.updates %}
{% include update_list.html %}
{% if update_list.size > 0 %}
<div id="access-lastmod" class="post">
<h3 data-toc-skip>
{{- site.data.label.panel.lastmod -}}
</h3>
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
{% for item in update_list %}
{% assign post_url = item | split: "::" | last | prepend: "/posts/" | append: "/" %}
{% assign post = site.posts | where: "url", post_url | first %}
{% if post %}
{% assign url = post.url | prepend: site.baseurl %}
<li><a href="{{ url }}">{{ post.title }}</a></li>
{% assign sum = sum | plus: 1 %}
{% if sum >= MAX_SIZE %} {% break %} {% endif %}
{% endif %}
{% endfor %}
</ul>
</div><!-- #access-lastmod -->
{% endif %}
{% endif %} <!-- site.data.updates -->
<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 %}
{% for tag in trending_tags %}
{% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %}
<a class="post-tag" href="{{ url | relative_url }}">{{ tag | replace: '-', ' ' }}</a>
{% endfor %}
</div>
</div>
</div> <!-- .access -->
{% if page.layout == 'post' and site.toc and page.toc %}
<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>
<nav id="toc" data-toggle="toc"></nav>
</div>
{% endif %}
</div> <!-- #panel-wrapper -->

View File

@@ -1,31 +1,30 @@
<!--
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 %}
</div>
</div>

View File

@@ -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 %}
@@ -51,38 +45,44 @@
{% endif %}
{% if show %}
<!-- show number -->
<li class="page-item {% if i == paginator.page %} active{% endif %}">
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
<!-- show number -->
<li class="page-item {% if i == paginator.page %} active{% endif %}">
<a class="page-link btn-box-shadow" href="{{ site.baseurl }}/{% if i > 1%}page{{ i }}/{% endif %}">{{ i }}</a>
</li>
{% else %}
<!-- hide number -->
{% if i < pre and left_ellipsis == false %}
<li class="page-item disabled">
<span class="page-link btn-box-shadow">...</span>
</li>
{% else %}
<!-- hide number -->
{% if i < pre and left_ellipsis == false %}
<li class="page-item disabled">
<span class="page-link btn-box-shadow">...</span>
</li>
{% assign left_ellipsis = true %}
{% elsif i > next and right_ellipsis == false %}
<li class="page-item disabled">
<span class="page-link btn-box-shadow">...</span>
</li>
{% assign right_ellipsis = true %}
{% endif %}
{% assign left_ellipsis = true %}
{% elsif i > next and right_ellipsis == false %}
<li class="page-item disabled">
<span class="page-link btn-box-shadow">...</span>
</li>
{% assign right_ellipsis = true %}
{% endif %}
{% endif %}
{% 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 -->
</ul> <!-- .pagination -->

View File

@@ -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 text-muted 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 %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url | escape %}
<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 }}"
data-title-succeed="{{ site.data.locales[lang].post.button.share_link.succeed }}">
</i>
</span>
</div>
</div>

30
_includes/read-time.html Normal file
View 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 }}">
<em>{{- read_time -}}{{" "}}{{- site.data.locales[lang].post.read_time.unit -}}</em>
{%- if include.prompt -%}
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
{%- endif -%}
</span>

View File

@@ -0,0 +1,277 @@
<!--
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 -->
{% assign IMG_TAG = '<img ' %}
{% if _content contains IMG_TAG %}
{% assign _img_content = nil %}
{% assign _img_snippets = _content | split: IMG_TAG %}
{% for _img_snippet in _img_snippets %}
{% if forloop.first %}
{% assign _img_content = _img_snippet %}
{% continue %}
{% endif %}
{% assign _width = nil %}
{% assign _height = nil %}
{% assign _src = nil %}
{% assign _left = _img_snippet | split: '>' | first %}
{% assign _right = _img_snippet | remove: _left %}
{% assign _left = _left | remove: ' /' %}
{% assign _left = _left | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
{% assign _attrs = _left | split: ' ' %}
{% for _attr in _attrs %}
{% assign _pair = _attr | split: '=' %}
{% if _pair.size < 2 %}
{% continue %}
{% endif %}
{% capture _key %}{{ _pair | first }}{% endcapture %}
{% capture _value %}{{ _pair | last | replace: '"', '' }}{% endcapture %}
{% case _key %}
{% when 'width' %}
{% assign _width = _value %}
{% when 'height' %}
{% assign _height = _value %}
{% when 'src' %}
{% assign _src = _value %}
{% endcase %}
{% if _width and _height and _src %}
{% break %}
{% endif %}
{% endfor %}
{% if _src %}
{% unless _src contains '://' %}
<!-- Add CDN URL -->
{% if site.img_cdn %}
{% assign _src_prefix = site.img_cdn %}
{% else %}
{% assign _src_prefix = site.baseurl %}
{% endif %}
<!-- Add image path -->
{% if page.img_path %}
{% assign _path = page.img_path %}
{% assign last_char = _path | slice: -1 %}
{% unless last_char == '/' %}
{% assign _path = _path | append: '/' %}
{% endunless %}
{% assign _src_prefix = _src_prefix | append: _path %}
{% endif %}
{% assign _final_src = _src_prefix | append: _src %}
{% assign _left = _left | replace: _src, _final_src %}
{% endunless %}
<!-- lazy-load images <https://github.com/ApoorvSaxena/lozad.js#usage> -->
{% assign _left = _left | replace: 'src=', 'data-src=' %}
{% endif %}
<!-- Add SVG placehoder to prevent layout reflow -->
{% if _width and _height %}
{%- capture _svg -%}
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
{%- endcapture -%}
{% assign _left = _svg | append: ' ' | append: _left %}
{% endif %}
<!-- Bypass the HTML-proofer test -->
{% assign _left = _left | append: ' data-proofer-ignore' %}
{% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
{% endfor %}
{% 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 _label_text = _left | split: 'file="' | last | split: '"' | first %}
{% assign _label_icon = 'far fa-file-code' %}
{% else %}
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
{% capture _label_text %}{% include language-alias.html language=_lang %}{% endcapture %}
{% assign _label_icon = 'fas fa-code small' %}
{% endif %}
{% capture _label %}
<span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
{% endcapture %}
{% assign _new_content = _new_content | append: _snippet
| append: '<div class="code-header">'
| append: _label
| append: '<button aria-label="copy" data-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 %}
<!-- Create heading anchors -->
{% assign heading_levels = '2,3,4,5' | split: ',' %}
{% assign _heading_content = _content %}
{% for level in heading_levels %}
{% capture mark_start %}<h{{ level }} id="{% endcapture %}
{% capture mark_end %}</h{{ level }}>{% endcapture %}
{% if _heading_content contains mark_start %}
{% assign _new_content = nil %}
{% assign heading_snippets = _heading_content | split: mark_start %}
{% for snippet in heading_snippets %}
{% if forloop.first %}
{% assign _new_content = snippet %}
{% continue %}
{% endif %}
{% assign id = snippet | split: '"' | first %}
{% capture anchor %}<a href="#{{ id }}" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>{% endcapture %}
{% assign left = snippet | split: mark_end | first %}
{% assign right = snippet | slice: left.size, snippet.size %}
{% assign left = left | replace: '">', '"><span class="mr-2">' | append: '</span>' %}
{% assign _new_content = _new_content | append: mark_start
| append: left | append: anchor | append: mark_end | append: right
%}
{% endfor %}
{% assign _heading_content = _new_content %}
{% endif %}
{% endfor %}
{% assign _content = _heading_content %}
<!-- Wrap prompt element of blockquote with the <div> tag -->
{% assign blockquote_start = '<blockquote class=' %}
{% assign blockquote_end = '</blockquote>' %}
{% assign cls_prefix = 'prompt-' %}
{% if _content contains blockquote_start %}
{% assign _prompt_content = nil %}
{% assign _prompt_snippets = _content | split: blockquote_start %}
{% for _snippet in _prompt_snippets %}
{% if forloop.first %}
{% assign _prompt_content = _snippet %}
{% continue %}
{% endif %}
{% assign left = _snippet | split: blockquote_end | first %}
{% assign right = _snippet | slice: left.size, _snippet.size %}
{% assign cls_str = left | split: '>' | first %}
{% assign cls_array = cls_str | remove: '"' | split: ' ' %}
{% assign is_prompt = false %}
{% for cls in cls_array %}
{% if cls contains cls_prefix %}
{% assign is_prompt = true %}
{% break %}
{% endif %}
{% endfor %}
{% unless is_prompt %}
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: _snippet %}
{% continue %}
{% endunless %}
{% assign left = left | slice: cls_str.size, left.size %}
{% assign left = cls_str | append: '><div' | append: left | append: '</div>' %}
{% assign _prompt_content = _prompt_content | append: blockquote_start | append: left | append: right %}
{% endfor %}
{% assign _content = _prompt_content %}
{% endif %}
<!-- return -->
{{ _content }}

View File

@@ -1,75 +1,106 @@
<!--
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 SEPARATOR = ":" %}
{% assign score_list = "" | split: "" %}
{% assign post_index = 0 %}
{% assign last_index = site.posts.size | minus: 1 %}
{% for post in site.posts %}
{% if post.url != page.url %}
{% assign score = 0 %}
{% for tag in post.tags %}
{% if page.tags contains tag %}
{% assign score = score | plus: TAG_SCORE %}
{% endif %}
{% endfor %}
{% for category in post.categories %}
{% if page.categories contains category %}
{% assign score = score | plus: CATEGORY_SCORE %}
{% endif %}
{% endfor %}
{% if score > 0 %}
{% capture score_item %}{{ score }}:{{ post_index }}{% endcapture %}
{% assign score_list = score_list | push: score_item %}
{% endif %}
{% for i in (0..last_index) %}
{% assign post = site.posts[i] %}
{% if post.url == page.url %}
{% continue %}
{% endif %}
{% assign post_index = post_index | plus: 1 %}
{% assign score = 0 %}
{% for tag in post.tags %}
{% if page.tags contains tag %}
{% assign score = score | plus: TAG_SCORE %}
{% endif %}
{% endfor %}
{% for category in post.categories %}
{% if page.categories contains category %}
{% assign score = score | plus: CATEGORY_SCORE %}
{% endif %}
{% endfor %}
{% if score > 0 %}
{% capture score_item %}{{ score }}{{ SEPARATOR }}{{ i }}{% endcapture %}
{% assign score_list = score_list | push: score_item %}
{% endif %}
{% 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">
{% assign content = post.content %}
{% include no-linenos.html %}
<p>{{ content | markdownify | strip_html | truncate: 200 | replace: '&', '&amp;' }}</p>
<p>
{% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }}
</p>
</div>
</div>
</a>
</div>
{% assign count = count | plus: 1 %}
{% if count >= MAX_SIZE %}
{% break %}
{% endif %}
{% endfor %}
</div> <!-- .card-deck -->
</div>
{% endif %}
</div> <!-- #related-posts -->
{% endif %}

View File

@@ -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>
<a href="{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="{{ site.data.assets[origin].search.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>
</script>

View File

@@ -1,20 +1,11 @@
<!--
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 mb-4">{{ site.data.label.panel.trending_tags }}</h4>
{% include trending-tags.html %}
{% for tag in trending_tags %}
{% capture url %}/tags/{{ tag | downcase | 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>
</div>
</div>

View File

@@ -1,81 +1,93 @@
<!--
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">
<div class="profile-wrapper text-center">
<div id="avatar">
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
{% if site.avatar != empty and site.avatar %}
{% capture avatar_url %}
{% if site.avatar contains '://' %}
{{ site.avatar }}
{% elsif site.img_cdn != empty 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 class="site-title mt-3">
<a href="{{ '/' | relative_url }}">{{ site.title }}</a>
</div>
</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 %}
{% 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">
{% unless site.theme_mode %}
<button class="mode-toggle btn" aria-label="Switch Mode">
<i class="fas fa-adjust"></i>
</button>
{% if site.theme_mode == "dual" %}
<span id="mode-toggle-wrapper">
{% include mode-toggle.html %}
</span>
<span class="icon-border"></span>
{% endif %}
{% if site.data.contact.size > 0 %}
<span class="icon-border"></span>
{% endif %}
{% endunless %}
<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>
{% 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 %}
</div>
{% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}"
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% endfor %}
</div> <!-- .sidebar-bottom -->
</div><!-- #sidebar -->

15
_includes/timeago.html Normal file
View File

@@ -0,0 +1,15 @@
<!--
Date format snippet
See: ${JS_ROOT}/utils/timeago.js
-->
<em class="timeago{% if include.class %} {{ include.class }}{% endif %}"
data-ts="{{ include.date | date: '%s' }}"
{% if include.tooltip %}
data-toggle="tooltip" data-placement="bottom" data-tooltip-df="llll"
{% endif %}
{% if include.capitalize %}
data-capitalize="true"
{% endif %}>
{{ include.date | date: '%Y-%m-%d' }}
</em>

16
_includes/toc.html Normal file
View File

@@ -0,0 +1,16 @@
{% assign enable_toc = false %}
{% if site.toc and page.toc %}
{% if page.content contains '<h2' or page.content contains '<h3' %}
{% assign enable_toc = true %}
{% endif %}
{% endif %}
{% if enable_toc %}
<!-- BS-toc.js will be loaded at medium priority -->
<script src="{{ site.data.assets[origin].bootstrap-toc.js }}"></script>
<div id="toc-wrapper" class="pl-0 pr-4 mb-5">
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>
<nav id="toc" data-toggle="toc"></nav>
</div>
{% endif %}

View File

@@ -1,50 +1,70 @@
<!--
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-wrapper" class="row justify-content-center">
<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 %}
<span>
<a href="{{ site.baseurl }}{{ item.url | remove: '.html'}}">
{{ item.label }}
</a>
</span>
{% else %}
<span>{{ item.label }}</span>
{% 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="{{ '/' | 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>{{ 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 -}}
{% else %}
{{- page.title -}}
{% endif %}
{% if page.layout == 'home' %}
{{- site.data.locales[lang].title | default: site.title -}}
{% elsif page.collection == 'tabs' or page.layout == 'page' %}
{%- capture tab_key -%}{{ page.url | split: '/' }}{%- endcapture -%}
{{- site.data.locales[lang].tabs[tab_key] | default: page.title -}}
{% else %}
{{- 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 }}...">
<i class="fa fa-times-circle fa-fw" id="search-cleaner"></i>
<input class="form-control" id="search-input" type="search"
aria-label="search" autocomplete="off" placeholder="{{ site.data.locales[lang].search.hint | capitalize }}...">
</span>
<span id="search-cancel" >Cancel</span>
<span id="search-cancel" >{{ site.data.locales[lang].search.cancel }}</span>
</div>
</div>
</div>

View File

@@ -1,31 +1,50 @@
{% 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 all_tags = 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 %}
{% 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 iter in all_tags %}
{% assign count = count | plus: 1 %}
{% assign tag = iter | split: "::" | last %}
{% assign trending_tags = trending_tags | push: tag %}
{% if count >= MAX %}
{% break %}
{% endif %}
{% 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 %}
{% if trending_tags.size > 0 %}
<div id="access-tags">
<div class="panel-heading">{{- site.data.locales[lang].panel.trending_tags -}}</div>
<div class="d-flex flex-wrap mt-3 mb-1 mr-3">
{% for tag_name in trending_tags %}
{% assign url = tag_name | slugify | url_encode | prepend: "/tags/" | append: "/" %}
<a class="post-tag" href="{{ url | relative_url }}">{{ tag_name }}</a>
{% endfor %}
</div>
</div>
{% endif %}

View File

@@ -0,0 +1,40 @@
{% 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 %}
{% if update_list.size > 0 %}
<div id="access-lastmod" class="post">
<div class="panel-heading">{{- site.data.locales[lang].panel.lastmod -}}</div>
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
{% for item in update_list %}
{% assign index = item | split: "::" | last | plus: 0 %}
{% assign post = site.posts[index] %}
{% assign url = post.url | relative_url %}
<li><a href="{{ url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</div> <!-- #access-lastmod -->
{% endif %}

View File

@@ -1,21 +0,0 @@
{% comment %}
Get the last 5 post from lastmod list.
v2.2
https://github.com/cotes2020/jekyll-theme-chirpy
© 2020 Cotes Chung
MIT License
{% endcomment %}
{% assign MAX_SIZE = 5 %}
{% assign sum = 0 %}
{% assign update_list = "" | split: "" %}
{% for entry in site.data.updates %}
{% capture elem %}
{{- entry.lastmod -}}::{{- entry.filename -}}
{% endcapture %}
{% assign update_list = update_list | push: elem %}
{% endfor %}
{% assign update_list = update_list | sort | reverse %}

View 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;
});
});

View File

@@ -0,0 +1,19 @@
/**
* A tool for locale datetime
*/
const LocaleHelper = (function () {
const $preferLocale = $('meta[name="prefer-datetime-locale"]');
const locale = $preferLocale.length > 0 ?
$preferLocale.attr('content').toLowerCase() : $('html').attr('lang').substr(0, 2);
const attrTimestamp = 'data-ts';
const attrDateFormat = 'data-df';
return {
locale: () => locale,
attrTimestamp: () => attrTimestamp,
attrDateFormat: () => attrDateFormat,
getTimestamp: ($elem) => Number($elem.attr(attrTimestamp)), // unix timestamp
getDateFormat: ($elem) => $elem.attr(attrDateFormat)
};
}());

View File

@@ -0,0 +1,13 @@
/*
* Listener for theme mode toggle
*/
$(function() {
$(".mode-toggle").click((e) => {
const $target = $(e.target);
let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
$target : $target.parent());
$btn.blur(); // remove the clicking outline
flipMode();
});
});

View File

@@ -0,0 +1,36 @@
/**
* A tool for smooth scrolling and topbar switcher
*/
const ScrollHelper = (function () {
const $body = $("body");
const ATTR_TOPBAR_VISIBLE = "data-topbar-visible";
const topbarHeight = $("#topbar-wrapper").outerHeight();
let scrollUpCount = 0; // the number of times the scroll up was triggered by ToC or anchor
let topbarLocked = false;
let orientationLocked = false;
return {
hideTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, false),
showTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, true),
// scroll up
addScrollUpTask: () => {
scrollUpCount += 1;
if (!topbarLocked) { topbarLocked = true; }
},
popScrollUpTask: () => scrollUpCount -= 1,
hasScrollUpTask: () => scrollUpCount > 0,
topbarLocked: () => topbarLocked === true,
unlockTopbar: () => topbarLocked = false,
getTopbarHeight: () => topbarHeight,
// orientation change
orientationLocked: () => orientationLocked === true,
lockOrientation: () => orientationLocked = true,
unLockOrientation: () => orientationLocked = false
};
}());

View File

@@ -0,0 +1,129 @@
/*
* 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 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 mobile screens (Sidebar hidden) ---*/
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");
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("input", () => {
if (input.val() === "") {
if (isMobileView()) {
hints.removeClass("unloaded");
} else {
resultSwitch.off();
}
} else {
resultSwitch.on();
if (isMobileView()) {
hints.addClass("unloaded");
}
}
});
});

View 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);
});

View File

@@ -0,0 +1,6 @@
/**
* Initial Bootstrap Tooltip.
*/
$(function () {
$("[data-toggle=\"tooltip\"]").tooltip();
});

View File

@@ -0,0 +1,90 @@
/*
* Hide Header on scroll down
*/
$(function() {
const $searchInput = $("#search-input");
const delta = ScrollHelper.getTopbarHeight();
let didScroll;
let lastScrollTop = 0;
function hasScrolled() {
let st = $(this).scrollTop();
/* Make sure they scroll more than delta */
if (Math.abs(lastScrollTop - st) <= delta) {
return;
}
if (st > lastScrollTop ) { // Scroll Down
ScrollHelper.hideTopbar();
if ($searchInput.is(":focus")) {
$searchInput.blur(); /* remove focus */
}
} else { // Scroll up
// has not yet scrolled to the bottom of the screen, that is, there is still space for scrolling
if (st + $(window).height() < $(document).height()) {
if (ScrollHelper.hasScrollUpTask()) {
return;
}
if (ScrollHelper.topbarLocked()) { // avoid redundant scroll up event from smooth scrolling
ScrollHelper.unlockTopbar();
} else {
if (ScrollHelper.orientationLocked()) { // avoid device auto scroll up on orientation change
ScrollHelper.unLockOrientation();
} else {
ScrollHelper.showTopbar();
}
}
}
}
lastScrollTop = st;
} // hasScrolled()
function handleLandscape() {
if ($(window).scrollTop() === 0) {
return;
}
ScrollHelper.lockOrientation();
ScrollHelper.hideTopbar();
}
if (screen.orientation) {
screen.orientation.onchange = () => {
const type = screen.orientation.type;
if (type === "landscape-primary" || type === "landscape-secondary") {
handleLandscape();
}
};
} else {
// for the browsers that not support `window.screen.orientation` API
$(window).on("orientationchange",() => {
if ($(window).width() < $(window).height()) { // before rotating, it is still in portrait mode.
handleLandscape();
}
});
}
$(window).scroll(() => {
if (didScroll) {
return;
}
didScroll = true;
});
setInterval(() => {
if (didScroll) {
hasScrolled();
didScroll = false;
}
}, 250);
});

View File

@@ -0,0 +1,67 @@
/*
* Top bar title auto change while scrolling up/down in mobile screens.
*/
$(function() {
const titleSelector = "div.post>h1:first-of-type";
const $pageTitle = $(titleSelector);
const $topbarTitle = $("#topbar-title");
if ($pageTitle.length === 0 /* on Home page */
|| $pageTitle.hasClass("dynamic-title")
|| $topbarTitle.is(":hidden")) {/* not in mobile views */
return;
}
const defaultTitleText = $topbarTitle.text().trim();
let pageTitleText = $pageTitle.text().trim();
let hasScrolled = false;
let lastScrollTop = 0;
if ($("#page-category").length || $("#page-tag").length) {
/* The title in Category or Tag page will be "<title> <count_of_posts>" */
if (/\s/.test(pageTitleText)) {
pageTitleText = pageTitleText.replace(/[0-9]/g, "").trim();
}
}
// When the page is scrolled down and then refreshed, the topbar title needs to be initialized
if ($pageTitle.offset().top < $(window).scrollTop()) {
$topbarTitle.text(pageTitleText);
}
let options = {
rootMargin: '-48px 0px 0px 0px', // 48px equals to the topbar height (3rem)
threshold: [0, 1]
};
let observer = new IntersectionObserver((entries) => {
if (!hasScrolled) {
hasScrolled = true;
return;
}
let curScrollTop = $(window).scrollTop();
let isScrollDown = lastScrollTop < curScrollTop;
lastScrollTop = curScrollTop;
let heading = entries[0];
if (isScrollDown) {
if (heading.intersectionRatio === 0) {
$topbarTitle.text(pageTitleText);
}
} else {
if (heading.intersectionRatio === 1) {
$topbarTitle.text(defaultTitleText);
}
}
}, options);
observer.observe(document.querySelector(titleSelector));
/* Click title will scroll to top */
$topbarTitle.click(function() {
$("body,html").animate({scrollTop: 0}, 800);
});
});

5
_javascript/copyright Normal file
View File

@@ -0,0 +1,5 @@
/*!
* Chirpy v5.1.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
* © 2019 Cotes Chung
* MIT Licensed
*/

View 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");
}
});
});

View 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>");
});

View File

@@ -0,0 +1,133 @@
/*
* 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 ATTR_TITLE_SUCCEED = 'data-title-succeed';
const ATTR_TITLE_ORIGIN = 'data-original-title';
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(ATTR_TITLE_SUCCEED);
$(btn).attr(ATTR_TITLE_ORIGIN, succeedTitle).tooltip('show');
}
function hideTooltip(btn) {
$(btn).tooltip('hide').removeAttr(ATTR_TITLE_ORIGIN);
}
function setSuccessIcon(btn) {
let btnNode = $(btn);
let iconNode = btnNode.children();
iconNode.attr('class', ICON_SUCCESS);
}
function resumeIcon(btn) {
let btnNode = $(btn);
let iconNode = btnNode.children();
iconNode.attr('class', ICON_DEFAULT);
}
clipboard.on('success', (e) => {
e.clearSelection();
const trigger = e.trigger;
if (isLocked(trigger)) {
return;
}
setSuccessIcon(trigger);
showTooltip(trigger);
lock(trigger);
setTimeout(() => {
hideTooltip(trigger);
resumeIcon(trigger);
unlock(trigger);
}, TIMEOUT);
});
/* --- Post link sharing --- */
$('#copy-link').click((e) => {
let target = $(e.target);
if (isLocked(target)) {
return;
}
// Copy URL to clipboard
const url = window.location.href;
const $temp = $("<input>");
$("body").append($temp);
$temp.val(url).select();
document.execCommand("copy");
$temp.remove();
// Switch tooltip title
const defaultTitle = target.attr(ATTR_TITLE_ORIGIN);
const succeedTitle = target.attr(ATTR_TITLE_SUCCEED);
target.attr(ATTR_TITLE_ORIGIN, succeedTitle).tooltip('show');
lock(target);
setTimeout(() => {
target.attr(ATTR_TITLE_ORIGIN, defaultTitle);
unlock(target);
}, TIMEOUT);
});
});

View 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');
});

View File

@@ -0,0 +1,20 @@
/**
* Update month/day to locale datetime
*
* Requirement: <https://github.com/iamkun/dayjs>
*/
$(function() {
dayjs.locale(LocaleHelper.locale());
dayjs.extend(window.dayjs_plugin_localizedFormat);
$(`[${LocaleHelper.attrTimestamp()}]`).each(function () {
const date = dayjs.unix(LocaleHelper.getTimestamp($(this)));
const df = LocaleHelper.getDateFormat($(this));
const text = date.format(df);
$(this).text(text);
$(this).removeAttr(LocaleHelper.attrTimestamp());
$(this).removeAttr(LocaleHelper.attrDateFormat());
});
});

View 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();
}
}
});

View File

@@ -0,0 +1,96 @@
/*
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() {
const $topbarTitle = $("#topbar-title");
const REM = 16; // in pixels
const ATTR_SCROLL_FOCUS = "scroll-focus";
$("a[href*='#']")
.not("[href='#']")
.not("[href='#0']")
.click(function(event) {
if (this.pathname.replace(/^\//, "") !==
location.pathname.replace(/^\//, "")) {
return;
}
if (location.hostname !== this.hostname) {
return;
}
const hash = decodeURI(this.hash);
let toFootnoteRef = RegExp(/^#fnref:/).test(hash);
let toFootnote = toFootnoteRef ? false : RegExp(/^#fn:/).test(hash);
let selector = hash.includes(":") ? hash.replace(/\:/g, "\\:") : hash;
let $target = $(selector);
let isMobileViews = $topbarTitle.is(":visible");
let isPortrait = $(window).width() < $(window).height();
if (typeof $target === "undefined") {
return;
}
event.preventDefault();
if (history.pushState) { /* add hash to URL */
history.pushState(null, null, hash);
}
let curOffset = $(window).scrollTop();
let destOffset = $target.offset().top -= REM / 2;
if (destOffset < curOffset) { // scroll up
ScrollHelper.hideTopbar();
ScrollHelper.addScrollUpTask();
if (isMobileViews && isPortrait) {
destOffset -= ScrollHelper.getTopbarHeight();
}
} else { // scroll down
if (isMobileViews && isPortrait) {
destOffset -= ScrollHelper.getTopbarHeight();
}
}
$("html").animate({
scrollTop: destOffset
}, 500, () => {
$target.focus();
/* clean up old scroll mark */
if ($(`[${ATTR_SCROLL_FOCUS}=true]`).length) {
$(`[${ATTR_SCROLL_FOCUS}=true]`).attr(ATTR_SCROLL_FOCUS, false);
}
/* Clean :target links */
if ($(":target").length) { /* element that visited by the URL with hash */
$(":target").attr(ATTR_SCROLL_FOCUS, false);
}
/* set scroll mark to footnotes */
if (toFootnote || toFootnoteRef) {
$target.attr(ATTR_SCROLL_FOCUS, 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 */
}
if (ScrollHelper.hasScrollUpTask()) {
ScrollHelper.popScrollUpTask();
}
});
}); /* click() */
});

View File

@@ -0,0 +1,87 @@
/**
* Calculate the Timeago
*
* Requirement: <https://github.com/iamkun/dayjs>
*/
$(function() {
const attrTimestamp = LocaleHelper.attrTimestamp();
const attrCapitalize = 'data-capitalize';
const $timeago = $(".timeago");
let timeagoTasks = $timeago.length;
let intervalId = void 0;
dayjs.locale(LocaleHelper.locale());
dayjs.extend(window.dayjs_plugin_relativeTime);
dayjs.extend(window.dayjs_plugin_localizedFormat);
function relativetime($elem) {
const now = dayjs();
const past = dayjs.unix(LocaleHelper.getTimestamp($elem));
let diffMonth = now.diff(past, 'month', true);
if (diffMonth > 10) { // year ago range: 11 months to 17months
$elem.removeAttr(attrTimestamp);
return past.format('ll'); // see: https://day.js.org/docs/en/display/format#list-of-localized-formats
}
let diffMinute = now.diff(past, 'minute', true);
if (diffMinute > 44) { // an hour ago range: 45 to 89 minutes
$elem.removeAttr(attrTimestamp);
}
return past.fromNow();
}
function updateTimeago() {
$timeago.each(function() {
if (typeof $(this).attr(attrTimestamp) === 'undefined') {
timeagoTasks -= 1;
return;
}
let relativeTime = relativetime($(this));
const capitalize = $(this).attr(attrCapitalize);
if (typeof capitalize !== 'undefined' && capitalize === 'true') {
relativeTime = relativeTime.replace(/^\w/, (c) => c.toUpperCase());
}
if ($(this).text() !== relativeTime) {
$(this).text(relativeTime);
}
});
if (timeagoTasks === 0 && typeof intervalId !== "undefined") {
clearInterval(intervalId); /* stop interval */
}
return timeagoTasks;
}
function setupTooltips() {
$timeago.each(function() {
const tooltip = $(this).attr('data-toggle');
if (typeof tooltip === 'undefined' || tooltip !== 'tooltip') {
return;
}
const df = $(this).attr('data-tooltip-df');
const ts = LocaleHelper.getTimestamp($(this));
const dateStr = dayjs.unix(ts).format(df);
$(this).attr('data-original-title', dateStr);
$(this).removeAttr('data-tooltip-df');
});
}
if (timeagoTasks === 0) {
return;
}
setupTooltips();
if (updateTimeago()) { /* run immediately */
intervalId = setInterval(updateTimeago, 60 * 1000); /* run every minute */
}
});

View File

@@ -1,14 +1,10 @@
---
title: Archives
layout: page
# The Archives of posts.
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
<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 %}
@@ -20,11 +16,12 @@ title: Archives
{% endif %}
<li>
<div>
{% capture this_day %}{{ post.date | date: "%d" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%b" }}{% 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>
{% assign ts = post.date | date: '%s' %}
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: "%d" }}</span>
<span class="date month small text-muted" data-ts="{{ ts }}" data-df="MMM">
{{ post.date | date: '%m' }}
</span>
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</div>
</li>
{% if forloop.last %}
@@ -37,4 +34,4 @@ title: Archives
{% assign last_month = "" %}
{% endif %}
{% endfor %}
</div>
</div>

99
_layouts/categories.html Normal file
View 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 %}

View File

@@ -1,25 +1,24 @@
---
layout: page
# The Category layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# MIT Licensed
---
<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] %}
{% 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" data-ts="{{ post.date | date: '%s' }}" data-df="ll">
{{ post.date | date: '%Y-%m-%d' }}
</span>
</li>
{% endfor %}
</ul>
</div>
</div>

View File

@@ -1,60 +1,61 @@
---
layout: compress
# Default layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
---
<!DOCTYPE html>
{% include lang.html %}
{% include assets-origin.html %}
{% capture prefer_mode %}
{% if site.theme_mode != "dual" %}
mode="{{ site.theme_mode }}"
{% if site.theme_mode %}
data-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">
{% unless site.theme_mode %}
{% include mode-toggle.html %}
{% endunless %}
<div id="sidebar" class="d-flex flex-column">
{% include sidebar.html %}
</div>
<body data-spy="scroll" data-target="#toc" data-topbar-visible="true">
{% include sidebar.html %}
{% include topbar.html %}
<div id="main-wrapper">
<div id="main">
{% capture _content %}
{{ content }}
{% endcapture %}
{% include fixlinenos.html %}
{{ _content }}
{{ content }}
{% include footer.html %}
</div>
{% include search-results.html %}
</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>
</html>

View File

@@ -1,44 +1,98 @@
---
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 and item.hidden != 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>
{% assign _content = post.content %}
{% include no-linenos.html %}
{{ _content | markdownify | strip_html | truncate: 200 }}
{% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }}
</p>
</div>
<div class="post-meta text-muted">
<!-- posted date -->
<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>
<!-- page views -->
{% if site.google_analytics.pv.enabled %}
<i class="far fa-eye fa-fw"></i>
<span id="pv_{{-post.title-}}" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</span>
<div class="post-meta text-muted d-flex">
<div class="mr-auto">
<!-- posted date -->
<i class="far fa-calendar fa-fw"></i>
{% include timeago.html date=post.date tooltip=true capitalize=true %}
<!-- time to read -->
<i class="far fa-clock fa-fw"></i>
{% include read-time.html content=post.content %}
<!-- categories -->
{% if post.categories.size > 0 %}
<i class="far fa-folder-open fa-fw"></i>
<span>
{% for category in post.categories %}
{{ category }}
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
</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>
</div> <!-- .post-meta -->
</div> <!-- .post-review -->
{% endfor %}
{% endfor %}
</div> <!-- #post-list -->
{% if paginator.total_pages > 0 %}

View File

@@ -1,38 +1,66 @@
---
layout: default
# The page layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT License
---
{% include lang.html %}
{% include assets-origin.html %}
<div class="row">
<div class="col-12 col-lg-11 col-xl-8">
<div id="page" class="post pb-5 pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 mb-md-4">
{% if page.dynamic_title %}
<h1 class="dynamic-title">{{ page.title }}</h1>
<div class="post-content">
<!-- core -->
<div id="core-wrapper" class="col-12 col-lg-11 col-xl-8">
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
{% capture _content %}
{% if layout.refactor or page.layout == 'page' %}
{% include refactor-content.html content=content %}
{% else %}
{{ content }}
{% endif %}
{% endcapture %}
{% if page.layout == 'page' or page.collection == 'tabs'%}
{% assign title = site.data.locales[lang].tabs[tab_key] | default: page.title %}
<h1 class="dynamic-title">
{{ title }}
</h1>
<div class="post-content">
{{ _content }}
</div>
{% else %}
{{ content }}
{{ _content }}
{% endif %}
</div> <!-- #page -->
</div><!-- .col-12 -->
{% include panel.html %}
</div>
</div> <!-- #core-wrapper -->
<!-- pannel -->
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted">
<div class="access">
{% include update-list.html %}
{% include trending-tags.html %}
</div>
{% for _include in layout.pannel_includes %}
{% assign _include_path = _include | append: '.html' %}
{% include {{ _include_path }} %}
{% endfor %}
</div>
</div>
{% if site.disqus.comments and page.comments %}
<!-- tail -->
{% if layout.tail_includes %}
<div class="row">
<div class="col-12 col-lg-11 col-xl-8">
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
{% include disqus.html %}
</div> <!-- .pl-1 pr-1 -->
</div> <!-- .col-12 -->
<div id="tail-wrapper" class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
{% for _include in layout.tail_includes %}
{% assign _include_path = _include | append: '.html' %}
{% include {{ _include_path }} %}
{% endfor %}
</div>
</div>
</div> <!-- .row -->
{% endif %}

View File

@@ -1,145 +1,144 @@
---
layout: default
# The posts' layout
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
layout: page
refactor: true
pannel_includes:
- toc
tail_includes:
- related-posts
- post-nav
- comments
---
<div class="row">
{% include lang.html %}
<div id="post-wrapper" class="col-12 col-lg-11 col-xl-8">
{% if page.image.src %}
{% capture bg %}
{% unless page.image.no_bg %}{{ 'bg' }}{% endunless %}
{% endcapture %}
<img src="{{ page.image.src }}" class="preview-img {{ bg | strip }}"
alt="{{ page.image.alt | default: "Preview Image" }}"
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
<h1 data-toc-skip>{{ page.title }}</h1>
<div class="post-meta text-muted d-flex flex-column">
<!-- Published date and author -->
<div>
Posted
<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>
by
<span class="author">
{% if page.author %}
{{ page.author }}
{% else%}
{{ site.author }}
{% endif %}
</span>
</div>
<!-- lastmod -->
{%- capture filename -%}
{{ page.url | split: "/" | last }}
{%- endcapture -%}
{% assign record = site.data.updates | where: "filename", filename | first %}
{% if record %}
<div>
Updated
<span class="timeago lastmod"
data-toggle="tooltip" data-placement="bottom"
title="{{ record.lastmod | date: site.data.date_format.tooltip }}">
{{ record.lastmod | date: site.data.date_format.post }}
<i class="unloaded">{{ record.lastmod | date_to_xmlschema}}</i>
</span>
</div>
{% endif %}
<!-- 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>
{% endif %}
</div> <!-- .post-meta -->
<div class="post-content">
{% if page.image %}
<img src="{{ page.image }}">
{% endif %}
{{ content }}
</div>
<div class="post-tail-wrapper text-muted">
<!-- categories -->
{% if page.categories.size > 0 %}
<div class="post-meta mb-3">
<i class="far fa-folder-open fa-fw mr-1"></i>
{% for category in page.categories %}
<a href='{{ site.baseurl }}/categories/{{ category | replace: ' ', '-' | downcase | url_encode }}/'>{{ category }}</a>
{%- unless forloop.last -%}, {%- endunless -%}
{% endfor %}
</div>
{% endif %}
<!-- tags -->
{% if page.tags.size > 0 %}
<div class="post-tags">
<i class="fa fa-tags fa-fw mr-1"></i>
{% for tag in page.tags %}
<a href="{{ site.baseurl }}/tags/{{ tag | replace: ' ', '-' | downcase | url_encode }}/"
class="post-tag no-text-decoration" >
{{- tag -}}
</a>
{% endfor %}
</div>
{% endif %}
<div class="post-tail-bottom
d-flex justify-content-between align-items-center pt-5 pb-2">
{% if site.data.rights.license %}
<div class="license-wrapper">
This post is licensed under
<a href="{{ site.data.rights.license.link }}">{{ site.data.rights.license.name }}</a>
by the author.
</div>
{% endif %}
{% include post-sharing.html %}
</div><!-- .post-tail-bottom -->
</div><!-- div.post-tail -->
</div> <!-- .post -->
</div> <!-- #post-wrapper -->
{% include panel.html %}
</div> <!-- .row -->
<div class="row">
<div id="post-extend-wrapper" class="col-12 col-lg-11 col-xl-8">
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
{% include post-nav.html %}
{% if site.disqus.comments and page.comments %}
{% include disqus.html %}
{% if page.image.width %}
width="{{ page.image.width }}"
{% elsif page.image.w %}
width="{{ page.image.w }}"
{% endif %}
{% include related-posts.html %}
{% if page.image.height %}
height="{{ page.image.height }}"
{% elsif page.image.h %}
height="{{ page.image.h }}"
{% endif %}>
{% endif %}
</div> <!-- .pl-1 pr-1 -->
<h1 data-toc-skip>{{ page.title }}</h1>
</div> <!-- #post-extend-wrapper -->
<div class="post-meta text-muted">
</div> <!-- .row -->
<!-- author -->
<div>
{% capture author_name %}{{ page.author.name | default: site.social.name }}{% endcapture %}
{% assign author_link = nil %}
{% include lozad.html %}
{% if page.author.link %}
{% assign author_link = page.author.link %}
{% elsif author_name == site.social.name %}
{% assign author_link = site.social.links[0] %}
{% endif %}
{{ site.data.locales[lang].post.written_by }}
<em>
{% if author_link %}
<a href="{{ author_link }}">{{ author_name }}</a>
{% else %}
{{ author_name }}
{% endif %}
</em>
</div>
<div class="d-flex">
<div>
<!-- published date -->
<span>
{{ site.data.locales[lang].post.posted }}
{% include timeago.html date=page.date tooltip=true %}
</span>
<!-- lastmod date -->
{% if page.last_modified_at %}
<span>
{{ site.data.locales[lang].post.updated }}
{% include timeago.html date=page.last_modified_at tooltip=true %}
</span>
{% endif %}
<!-- read time -->
{% include read-time.html content=content prompt=true %}
<!-- page views -->
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
<span>
<em id="pv" class="pageviews">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</em>
{{ site.data.locales[lang].post.pageview_measure }}
</span>
{% endif %}
</div>
</div> <!-- .d-flex -->
</div> <!-- .post-meta -->
<div class="post-content">
{{ content }}
</div>
<div class="post-tail-wrapper text-muted">
<!-- categories -->
{% if page.categories.size > 0 %}
<div class="post-meta mb-3">
<i class="far fa-folder-open fa-fw mr-1"></i>
{% for category in page.categories %}
<a href='{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/'>{{ category }}</a>
{%- unless forloop.last -%}, {%- endunless -%}
{% endfor %}
</div>
{% endif %}
<!-- tags -->
{% if page.tags.size > 0 %}
<div class="post-tags">
<i class="fa fa-tags fa-fw mr-1"></i>
{% for tag in page.tags %}
<a href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
class="post-tag no-text-decoration" >
{{- tag -}}
</a>
{% endfor %}
</div>
{% endif %}
<div class="post-tail-bottom
d-flex justify-content-between align-items-center mt-3 pt-5 pb-2">
<div class="license-wrapper">
{% if site.data.locales[lang].copyright.license.template %}
{% capture _replacement %}
<a href="{{ site.data.locales[lang].copyright.license.link }}">
{{ site.data.locales[lang].copyright.license.name }}
</a>
{% endcapture %}
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
{% endif %}
</div>
{% include post-sharing.html %}
</div><!-- .post-tail-bottom -->
</div><!-- div.post-tail-wrapper -->

View File

@@ -1,25 +1,23 @@
---
layout: page
# The layout for Tag page
# v2.0
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2017-2019 Cotes Chung
# MIT Licensed
---
<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] %}
{% 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" data-ts="{{ post.date | date: '%s' }}" data-df="ll">
{{ post.date | date: '%Y-%m-%d' }}
</span>
</li>
{% endfor %}
</ul>
</div>
</div>

21
_layouts/tags.html Normal file
View 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>

View 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

View File

@@ -1,25 +1,33 @@
---
title: Text and Typography
author: Cotes Chung
author:
name: Cotes Chung
link: https://github.com/cotes2020
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
@@ -35,39 +43,136 @@ 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.
> This line shows the _block quote_.
## Prompts
> An example showing the `tip` type prompt.
{: .prompt-tip }
> An example showing the `info` type prompt.
{: .prompt-info }
> An example showing the `warning` type prompt.
{: .prompt-warning }
> An example showing the `danger` type prompt.
{: .prompt-danger }
## 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
[http://127.0.0.1:4000](http://127.0.0.1:4000)
## Links
<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].
## Images
## Image
- Default (with caption)
![Desktop View]({{ "/assets/img/sample/mockup.png" | relative_url }})
![Desktop View](/posts/20190808/mockup.png){: width="972" height="589" }
_Full screen width and center alignment_
<br>
- Shadow
![Window shadow](/posts/20190808/window.png){: .shadow width="1548" height="864" style="max-width: 90%" }
_shadow effect (visible in light mode)_
<br>
- Left aligned
![Desktop View](/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 70%" .normal}
<br>
- Float to left
![Desktop View](/posts/20190808/mockup.png){: 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
![Desktop View](/posts/20190808/mockup.png){: 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
This is an example of `Inline Code`.
## Filepath
## Code Snippet
Here is the `/path/to/the/file.extend`{: .filepath}.
## Code block
### Common
@@ -80,79 +185,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

Some files were not shown because too many files have changed in this diff Show More