Skip to content

Commit b1dde3f

Browse files
committed
Updating to 4.3.0 redesigned sidebar, codeblock icon, CI
1 parent dda9b35 commit b1dde3f

37 files changed

+487
-380
lines changed

.github/workflows/pages-deploy.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,5 @@ jobs:
2525
ruby-version: 2.7
2626
bundler-cache: true
2727

28-
- name: Check baseurl
29-
run: |
30-
baseurl="$(grep '^baseurl:' _config.yml | sed "s/.*: *//;s/['\"]//g;s/#.*//")"
31-
if [[ -n $baseurl ]]; then
32-
echo "BASE_URL=$baseurl" >> $GITHUB_ENV
33-
fi
34-
35-
- name: Build Site
36-
env:
37-
JEKYLL_ENV: production
38-
run: |
39-
bundle exec jekyll b -d "_site$BASE_URL"
40-
41-
- name: Test Site
42-
run: |
43-
bash tools/test.sh
44-
4528
- name: Deploy
46-
run: |
47-
if [[ -n $BASE_URL ]]; then
48-
mv _site$BASE_URL _site-rename
49-
rm -rf _site
50-
mv _site-rename _site
51-
fi
52-
53-
bash tools/deploy.sh
29+
run: bash tools/deploy.sh

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ end
1717

1818
# Performance-booster for watching directories on Windows
1919
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
20+
21+
# Jekyll <= 4.2.0 compatibility with Ruby 3.0
22+
gem "webrick", "~> 1.7"

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Import the theme
44
theme: jekyll-theme-chirpy
55

6-
# Only if your site type is GitHub Project sites and doesn't have a custom domain,
7-
# change below value to '/projectname'.
6+
# Change the following value to '/PROJECT_NAME' ONLY IF your site type is GitHub Pages Project sites
7+
# and doesn't have a custom domain.
88
baseurl: ''
99

1010
# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm

_data/contact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
-
44
type: github
5-
icon: 'fab fa-github-alt'
5+
icon: 'fab fa-github'
66
-
77
type: twitter
88
icon: 'fab fa-twitter'

_includes/disqus.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-->
44

55
<div id="disqus_thread" class="pt-2 pb-2">
6-
<p class="text-center text-muted small mb-5">
6+
<p class="text-center text-muted small">
77
Comments powered by <a href="https://disqus.com/">Disqus</a>.
88
</p>
99
</div>

_includes/language-alias.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{% comment %}
2+
3+
Convert the alias of the syntax language to the official name
4+
5+
See: <https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers>
6+
7+
{% endcomment %}
8+
9+
{% assign _lang = include.language | default: '' %}
10+
11+
{% case _lang %}
12+
{% when 'actionscript', 'as', 'as3' %}
13+
{{ 'ActionScript' }}
14+
{% when 'applescript' %}
15+
{{ 'AppleScript' }}
16+
{% when 'brightscript', 'bs', 'brs' %}
17+
{{ 'BrightScript' }}
18+
{% when 'cfscript', 'cfc' %}
19+
{{ 'CFScript' }}
20+
{% when 'coffeescript', 'coffee', 'coffee-script' %}
21+
{{ 'CoffeeScript' }}
22+
{% when 'cs', 'csharp' %}
23+
{{ 'C#' }}
24+
{% when 'erl' %}
25+
{{ 'Erlang' }}
26+
{% when 'graphql' %}
27+
{{ 'GraphQL' }}
28+
{% when 'haskell', 'hs' %}
29+
{{ 'Haskell' }}
30+
{% when 'javascript', 'js' %}
31+
{{ 'JavaScript' }}
32+
{% when 'make', 'mf', 'gnumake', 'bsdmake' %}
33+
{{ 'Makefile' }}
34+
{% when 'md', 'mkd' %}
35+
{{ 'Markdown' }}
36+
{% when 'm' %}
37+
{{ 'Matlab' }}
38+
{% when 'objective_c', 'objc', 'obj-c', 'obj_c', 'objectivec' %}
39+
{{ 'Objective-C' }}
40+
{% when 'perl', 'pl' %}
41+
{{ 'Perl' }}
42+
{% when 'php','php3','php4','php5' %}
43+
{{ 'PHP' }}
44+
{% when 'plaintext', 'text' %}
45+
{{ 'Text' }}
46+
{% when 'py' %}
47+
{{ 'Python' }}
48+
{% when 'rb' %}
49+
{{ 'Ruby' }}
50+
{% when 'rs','no_run','ignore','should_panic' %}
51+
{{ 'Rust' }}
52+
{% when 'bash', 'zsh', 'ksh', 'sh' %}
53+
{{ 'Shell' }}
54+
{% when 'st', 'squeak' %}
55+
{{ 'Smalltalk' }}
56+
{% when 'tex'%}
57+
{{ 'TeX' }}
58+
{% when 'latex' %}
59+
{{ 'LaTex' }}
60+
{% when 'ts', 'typescript' %}
61+
{{ 'TypeScript' }}
62+
{% when 'vb', 'visualbasic' %}
63+
{{ 'Visual Basic' }}
64+
{% when 'vue', 'vuejs' %}
65+
{{ 'Vue.js' }}
66+
{% when 'yml' %}
67+
{{ 'YAML' }}
68+
{% when 'css', 'html', 'scss', 'ssh', 'toml', 'xml', 'yaml' %}
69+
{{ _lang | upcase }}
70+
{% else %}
71+
{{ _lang | capitalize }}
72+
{% endcase %}

_includes/refactor-content.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,23 @@
119119

120120
{% if _left contains 'file="' %}
121121
{% assign _text = _left | split: 'file="' | last | split: '"' | first %}
122+
{% assign _label_icon = 'far fa-file-code' %}
122123
{% else %}
123-
{% assign _text = _left | split: 'language-' | last | split: ' ' | first %}
124+
{% assign _lang = _left | split: 'language-' | last | split: ' ' | first %}
125+
{% capture _text %}{% include language-alias.html language=_lang %}{% endcapture %}
126+
{% assign _label_icon = 'fas fa-code small' %}
124127
{% endif %}
125128

129+
{% capture _label %}
130+
<span text-data="{{ _text }}"><i class="fa-fw {{ _label_icon }}"></i></span>
131+
{% endcapture %}
132+
126133
{% assign _new_content = _new_content | append: _snippet
127-
| append: '<div class="code-header" text-data="'
128-
| append: _text
129-
| append: '"><button data-original-title="'
134+
| append: '<div class="code-header">'
135+
| append: _label
136+
| append: '<button aria-label="copy" title-succeed="'
130137
| append: site.data.locales[lang].post.button.copy_code.succeed
131-
| append: '"><i class="far fa-clone"></i></button></div>'
138+
| append: '"><i class="far fa-clipboard"></i></button></div>'
132139
| append: '<div class="highlight"><code>'
133140
%}
134141

_includes/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
</ul> <!-- ul.nav.flex-column -->
5151

52-
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center">
52+
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
5353

5454
{% for entry in site.data.contact %}
5555
{% capture url %}

_javascript/copyright

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Chirpy v4.2.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
2+
* Chirpy v4.3.0 (https://github.com/cotes2020/jekyll-theme-chirpy/)
33
* © 2019 Cotes Chung
44
* MIT Licensed
55
*/

_javascript/utils/clipboard.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $(function() {
4141
});
4242

4343
$(btnSelector).tooltip({
44-
trigger: 'click',
44+
trigger: 'hover',
4545
placement: 'left'
4646
});
4747

@@ -53,11 +53,12 @@ $(function() {
5353
const ICON_DEFAULT = getIcon(btnSelector);
5454

5555
function showTooltip(btn) {
56-
$(btn).tooltip('show');
56+
const succeedTitle = $(btn).attr('title-succeed');
57+
$(btn).attr('data-original-title', succeedTitle).tooltip('show');
5758
}
5859

5960
function hideTooltip(btn) {
60-
$(btn).tooltip('hide');
61+
$(btn).tooltip('hide').removeAttr('data-original-title');
6162
}
6263

6364
function setSuccessIcon(btn) {

0 commit comments

Comments
 (0)