Skip to content

Commit edecd73

Browse files
committed
2 parents 63acf59 + 9508391 commit edecd73

36 files changed

+297
-162
lines changed

.github/workflows/pages-deploy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Setup Pages
3939
id: pages
40-
uses: actions/configure-pages@v3
40+
uses: actions/configure-pages@v4
4141

4242
- name: Setup Ruby
4343
uses: ruby/setup-ruby@v1
@@ -57,7 +57,7 @@ jobs:
5757
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
5858
5959
- name: Upload site artifact
60-
uses: actions/upload-pages-artifact@v1
60+
uses: actions/upload-pages-artifact@v3
6161
with:
6262
path: "_site${{ steps.pages.outputs.base_path }}"
6363

@@ -70,4 +70,4 @@ jobs:
7070
steps:
7171
- name: Deploy to GitHub Pages
7272
id: deployment
73-
uses: actions/deploy-pages@v2
73+
uses: actions/deploy-pages@v4

.markdownlint.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commands-show-output": false,
3+
"blanks-around-fences": false,
4+
"line-length": false,
5+
"no-inline-html": {
6+
"allowed_elements": ["kbd", "sub"]
7+
}
8+
}

.vscode/extensions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Common formatter
88
"esbenp.prettier-vscode",
99
"foxundermoon.shell-format",
10-
"stylelint.vscode-stylelint"
10+
"stylelint.vscode-stylelint",
11+
"yzhang.markdown-all-in-one"
1112
]
1213
}

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"prettier.trailingComma": "none",
66
// Shopify Liquid
77
"files.associations": {
8-
"*.html": "liquid"
8+
"*.html": "jekyll"
9+
},
10+
"[markdown]": {
11+
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
912
},
1013
// Formatter
1114
"[html][liquid]": {

_config.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,28 @@ social:
4646
# - https://www.facebook.com/username
4747
# - https://www.linkedin.com/in/username
4848

49-
google_site_verification: # 填入你的认证字符串
49+
# 网站认证设置
50+
webmaster_verifications:
51+
google: # 填入你的 Google 认证代码
52+
bing: # 填入你的 Bing 认证代码
53+
alexa: # 填入你的 Alexa 认证代码
54+
yandex: # 填入你的 Yandex 认证代码
55+
baidu: # 填入你的百度认证代码
56+
facebook: # 填入你的 Facebook 认证代码
5057

5158
# ↑ --------------------------
5259
# `jekyll-seo-tag` 设置结束
5360

54-
google_analytics:
55-
id: # 填入你的 Google Analytics ID
61+
# 网页分析设置
62+
analytics:
63+
google:
64+
id: # 填入你的 Google Analytics ID
65+
goatcounter:
66+
id: # 填入你的 GoatCounter ID
5667

57-
goatcounter:
58-
id: # 填入你的 Goatcounter ID
68+
# 页面浏览量设置
69+
pageviews:
70+
provider: # 目前仅支持 'goatcounter'
5971

6072
# 设置首选配色方案
6173
#
@@ -109,8 +121,9 @@ panel:
109121
toc: true
110122

111123
comments:
112-
active: # 帖子评论区全局开关,例如,'disqus'。保持为空表示禁用
113-
# active 选项可以是如下:
124+
# 帖子评论区全局开关,例如,'disqus'。保持为空表示禁用。
125+
provider:
126+
# provider 选项可以是如下:
114127
# disqus 评论系统 > https://disqus.com/
115128
disqus:
116129
shortname: # 填入你的 disqus shorname › https://help.disqus.com/en/articles/1717111-what-s-a-shortname
@@ -130,6 +143,7 @@ comments:
130143
category:
131144
category_id:
132145
mapping: # 可选项,默认为 'pathname'
146+
strict: # 可选项,默认为 '0'
133147
input_position: # 可选项,默认为 'bottom'
134148
lang: # 可选项,默认为 `site.lang` 的值
135149
reactions_enabled: # 可选项,默认为 1

_data/origin/cors.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ cdns:
88
- url: https://fonts.googleapis.com
99
# jsDelivr CDN
1010
- url: https://cdn.jsdelivr.net
11-
# polyfill.io for math
12-
- url: https://polyfill.io
11+
# polyfill.io for math (cdnjs.cloudflare.com/polyfill)
12+
- url: https://cdnjs.cloudflare.com
1313

1414
# fonts
1515

16-
webfonts: https://fonts.googleapis.com/css2?family=Lato&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
16+
webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
1717

1818
# Libraries
1919

_data/share.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,12 @@ platforms:
2929
icon: "icon-weibo"
3030
link: "https://service.weibo.com/share/share.php?title=TITLE&url=URL"
3131

32-
# Uncomment below if you need to.
33-
#
3432
# - type: Linkedin
35-
# icon: "fab fa-linkedin"
33+
# icon: "icon-linkedin"
3634
# link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
3735
#
38-
# - type: Weibo
39-
# icon: "fab fa-weibo"
40-
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
41-
#
4236
# - type: Mastodon
43-
# icon: "fa-brands fa-mastodon"
37+
# icon: "icon-mastodon"
4438
# # See: https://github.com/justinribeiro/share-to-mastodon#properties
4539
# instances:
4640
# - label: mastodon.social
@@ -50,4 +44,4 @@ platforms:
5044
# - label: fosstodon.org
5145
# link: "https://fosstodon.org/"
5246
# - label: photog.social
53-
# link: "https://photog.social/"
47+
# link: "https://photog.social/"

_includes/analytics/goatcounter.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- GoatCounter -->
2+
<script
3+
async
4+
src="https://gc.zgo.at/count.js"
5+
data-goatcounter="https://{{ site.analytics.goatcounter.id }}.goatcounter.com/count"
6+
></script>

_includes/analytics/google.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Global site tag (gtag.js) - Google Analytics -->
2+
<script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.id }}"></script>
3+
<script>
4+
document.addEventListener('DOMContentLoaded', function (event) {
5+
window.dataLayer = window.dataLayer || [];
6+
function gtag() {
7+
dataLayer.push(arguments);
8+
}
9+
10+
gtag('js', new Date());
11+
gtag('config', '{{ site.analytics.google.id }}');
12+
});
13+
</script>

_includes/comments.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<!-- The comments switcher -->
2-
{% if page.comments and site.comments.active %}
3-
{% capture path %}comments/{{ site.comments.active }}.html{% endcapture %}
1+
<!-- The comments switcher -->
2+
{% if page.comments and site.comments.provider %}
3+
{% capture path %}comments/{{ site.comments.provider }}.html{% endcapture %}
44
{% include {{ path }} %}
55
{% endif %}

_includes/comments/giscus.html

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'data-category': '{{ site.comments.giscus.category }}',
2626
'data-category-id': '{{ site.comments.giscus.category_id }}',
2727
'data-mapping': '{{ site.comments.giscus.mapping | default: 'pathname' }}',
28+
'data-strict' : '{{ site.comments.giscus.strict | default: '0' }}',
2829
'data-reactions-enabled': '{{ site.comments.giscus.reactions_enabled | default: '1' }}',
2930
'data-emit-metadata': '0',
3031
'data-theme': initTheme,

_includes/embed/bilibili.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<iframe
2-
class="embed-video bilibili"
2+
class="embed-video"
33
loading="lazy"
44
src="https://player.bilibili.com/player.html?bvid={{ include.id }}"
55
scrolling="no"
6-
border="0"
7-
frameborder="no"
6+
frameborder="0"
87
framespacing="0"
98
allowfullscreen="true"
10-
></iframe>
9+
></iframe>

_includes/embed/video.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{% assign video_url = include.src %}
2+
{% assign poster_url = include.poster %}
3+
4+
{% unless video_url contains '://' %}
5+
{%- capture video_url -%}
6+
{% include img-url.html src=video_url img_path=page.img_path %}
7+
{%- endcapture -%}
8+
{% endunless %}
9+
10+
{% if poster_url %}
11+
{% unless poster_url contains '://' %}
12+
{%- capture poster_url -%}
13+
{% include img-url.html src=poster_url img_path=page.img_path %}
14+
{%- endcapture -%}
15+
{% endunless %}
16+
{% assign poster = 'poster="' | append: poster_url | append: '"' %}
17+
{% endif %}
18+
19+
{% assign attributes = 'controls' %}
20+
21+
{% if include.autoplay %}
22+
{% assign attributes = attributes | append: ' ' | append: 'autoplay' %}
23+
{% endif %}
24+
25+
{% if include.loop %}
26+
{% assign attributes = attributes | append: ' ' | append: 'loop' %}
27+
{% endif %}
28+
29+
{% if include.muted %}
30+
{% assign attributes = attributes | append: ' ' | append: 'muted' %}
31+
{% endif %}
32+
33+
<p>
34+
<video class="embed-video file" src="{{ video_url }}" {{ poster }} {{ attributes }}>
35+
Your browser doesn't support HTML video. Here is a <a href="{{ video_url }}">link to the video</a> instead.
36+
</video>
37+
<em>{{ include.title }}</em>
38+
</p>

_includes/embed/youtube.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<iframe
2-
class="embed-video youtube"
2+
class="embed-video"
33
loading="lazy"
44
src="https://www.youtube.com/embed/{{ include.id }}"
55
title="YouTube video player"

_includes/footer.html

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@
3434
{%- endcapture -%}
3535

3636
{%- capture _theme -%}
37-
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
37+
<a
38+
data-bs-toggle="tooltip"
39+
data-bs-placement="top"
40+
title="v{{ theme.version }}"
41+
href="https://github.com/cotes2020/jekyll-theme-chirpy"
42+
target="_blank"
43+
rel="noopener"
44+
>Chirpy</a>
3845
{%- endcapture -%}
3946

4047
{{ site.data.locales[include.lang].meta | replace: ':PLATFORM', _platform | replace: ':THEME', _theme }}

_includes/goatcounter.html

-8
This file was deleted.

_includes/google-analytics.html

-14
This file was deleted.

_includes/head.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{%- endcapture -%}
4040

4141
{%- capture twitter_image -%}
42-
<meta property="twitter:card" content="summary_large_image" />
42+
<meta name="twitter:card" content="summary_large_image" />
4343
<meta property="twitter:image" content="{{ img_url }}" />
4444
{%- endcapture -%}
4545

@@ -72,7 +72,7 @@
7272
{% endif %}
7373

7474
<!-- GA -->
75-
{% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
75+
{% if jekyll.environment == 'production' and site.analytics.google.id != empty and site.analytics.google.id %}
7676
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
7777
<link rel="dns-prefetch" href="https://www.google-analytics.com">
7878

_includes/img-url.html

+13-15
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,23 @@
1414

1515
{%- if url -%}
1616
{% unless url contains ':' %}
17-
{%- comment -%} CND URL {%- endcomment -%}
18-
{% assign prefix = site.img_cdn | default: '' %}
19-
2017
{%- comment -%} Add page image path prefix {%- endcomment -%}
2118
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
2219

23-
{% assign url = prefix
24-
| append: '/'
25-
| append: url
26-
| replace: '///', '/'
27-
| replace: '//', '/'
28-
| replace: ':', ':/'
29-
%}
30-
31-
{% if include.absolute %}
32-
{% assign url = url | absolute_url %}
33-
{% else %}
34-
{% assign url = url | relative_url %}
20+
{%- comment -%} Prepend CND URL {%- endcomment -%}
21+
{% if site.img_cdn %}
22+
{% assign url = site.img_cdn | append: '/' | append: url %}
3523
{% endif %}
24+
25+
{% assign url = url | replace: '///', '/' | replace: '//', '/' | replace: ':/', '://' %}
26+
27+
{% unless url contains '://' %}
28+
{% if include.absolute %}
29+
{% assign url = site.url | append: site.baseurl | append: url %}
30+
{% else %}
31+
{% assign url = site.baseurl | append: url %}
32+
{% endif %}
33+
{% endunless %}
3634
{% endunless %}
3735
{%- endif -%}
3836

0 commit comments

Comments
 (0)