Skip to content

Commit 51fe6de

Browse files
committed
2 parents afacfe4 + 1317797 commit 51fe6de

29 files changed

+346
-205
lines changed

.browserslistrc

-5
This file was deleted.

.commitlintrc.json

-8
This file was deleted.

.github/dependabot.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ updates:
77
bundler:
88
dependency-type: "production"
99
schedule:
10-
interval: "weekly"
10+
interval: "monthly"
1111
- package-ecosystem: "npm"
1212
directory: "/"
1313
versioning-strategy: increase
1414
groups:
1515
npm:
1616
dependency-type: "development"
1717
schedule:
18-
interval: "weekly"
18+
interval: "monthly"
1919
- package-ecosystem: "github-actions"
2020
directory: "/"
2121
groups:
2222
gh-actions:
2323
update-types:
2424
- "major"
2525
schedule:
26-
interval: "weekly"
26+
interval: "monthly"

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
strategy:
2323
matrix:
24-
ruby: [2.7, 3]
24+
ruby: ["3.0", "3.1", "3.2"]
2525

2626
steps:
2727
- name: Checkout
@@ -36,7 +36,7 @@ jobs:
3636
bundler-cache: true
3737

3838
- name: Setup Node
39-
uses: actions/setup-node@v3
39+
uses: actions/setup-node@v4
4040

4141
- name: Build Assets
4242
run: npm i && npm run build

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ jobs:
2929

3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@v2
32+
uses: github/codeql-action/init@v3
3333
with:
3434
languages: "${{ matrix.language }}"
3535

3636
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
3737
# If this step fails, then you should remove it and run the build manually (see below)
3838
- name: Autobuild
39-
uses: github/codeql-action/autobuild@v2
39+
uses: github/codeql-action/autobuild@v3
4040

4141
- name: Perform CodeQL Analysis
42-
uses: github/codeql-action/analyze@v2
42+
uses: github/codeql-action/analyze@v3
4343
with:
4444
category: "/language:${{ matrix.language }}"

.github/workflows/pages-deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup Ruby
4343
uses: ruby/setup-ruby@v1
4444
with:
45-
ruby-version: 3
45+
ruby-version: 3.2
4646
bundler-cache: true
4747

4848
- name: Build site

.github/workflows/stale.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@ permissions:
88
issues: write
99
pull-requests: write
1010

11+
env:
12+
STALE_LABEL: stale
13+
EXEMPT_LABELS: "pending,planning,in progress"
14+
MESSAGE: >
15+
This conversation has been automatically marked as stale because it has not had recent activity.
16+
It will be closed if no further activity occurs.
17+
Thank you for your contributions.
18+
1119
jobs:
1220
stale:
1321
runs-on: ubuntu-latest
1422
steps:
15-
- uses: actions/stale@v8
23+
- uses: actions/stale@v9
1624
with:
1725
days-before-stale: 30
1826
days-before-close: 1
19-
stale-issue-label: stale
20-
exempt-issue-labels: pending
21-
stale-issue-message: >
22-
This issue has been automatically marked as stale because it has not had recent activity.
23-
It will be closed if no further activity occurs.
24-
Thank you for your contributions.
25-
stale-pr-label: stale
26-
exempt-pr-labels: pending
27-
stale-pr-message: >
28-
This PR has been automatically marked as stale because it has not had recent activity.
29-
It will be closed if no further activity occurs.
30-
Thank you for your contributions.
27+
stale-issue-label: ${{ env.STALE_LABEL }}
28+
exempt-issue-labels: ${{ env.EXEMPT_LABELS }}
29+
stale-issue-message: ${{ env.MESSAGE }}
30+
stale-pr-label: ${{ env.STALE_LABEL }}
31+
exempt-pr-labels: ${{ env.EXEMPT_LABELS }}
32+
stale-pr-message: ${{ env.MESSAGE }}

.prettierrc

-3
This file was deleted.

.versionrc.json

-20
This file was deleted.

_config.yml

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ img_cdn: ""
8282
# 侧边栏的头像,支持本地或 CROS 资源
8383
avatar: /avatar.png
8484

85+
# SEO `og:image` 元标记中使用的全站社交预览图像的 URL。
86+
# 可以在帖子的 Front Matter 中使用 `page.image` 覆盖。
87+
social_preview_image: # 字符串,本地或跨域资源
88+
8589
# 设置显示右侧边栏的内容
8690
panel:
8791
# 设置显示在帖子中右侧边栏的内容

_data/locales/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ copyright:
4242
Except where otherwise noted, the blog posts on this site are licensed
4343
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
4444
45-
meta: Using the :THEME theme for :PLATFORM
45+
meta: Using the :THEME theme for :PLATFORM.
4646

4747
not_found:
4848
title: "404: Page not found"

_data/origin/cors.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ bootstrap:
2323
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js
2424

2525
toc:
26-
css: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.css
27-
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.js
26+
css: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.css
27+
js: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.js
2828

2929
fontawesome:
30-
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css
30+
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css
3131

3232
search:
3333
js: https://cdn.jsdelivr.net/npm/[email protected]/dest/simple-jekyll-search.min.js
3434

3535
mermaid:
36-
js: https://cdn.jsdelivr.net/npm/mermaid@10.5.0/dist/mermaid.min.js
36+
js: https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js
3737

3838
dayjs:
3939
js:

_data/share.yml

+23
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,26 @@ platforms:
2828
- type: 微博
2929
icon: "icon-weibo"
3030
link: "https://service.weibo.com/share/share.php?title=TITLE&url=URL"
31+
32+
# Uncomment below if you need to.
33+
#
34+
# - type: Linkedin
35+
# icon: "fab fa-linkedin"
36+
# link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
37+
#
38+
# - type: Weibo
39+
# icon: "fab fa-weibo"
40+
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
41+
#
42+
# - type: Mastodon
43+
# icon: "fa-brands fa-mastodon"
44+
# # See: https://github.com/justinribeiro/share-to-mastodon#properties
45+
# instances:
46+
# - label: mastodon.social
47+
# link: "https://mastodon.social/"
48+
# - label: mastodon.online
49+
# link: "https://mastodon.online/"
50+
# - label: fosstodon.org
51+
# link: "https://fosstodon.org/"
52+
# - label: photog.social
53+
# link: "https://photog.social/"

_includes/embed/bilibili.html

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

_includes/head.html

+28-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<!-- The Head -->
2-
31
<head>
42
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
53
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
@@ -11,29 +9,38 @@
119
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
1210
>
1311

14-
{% capture seo_tags %}
12+
{%- capture seo_tags -%}
1513
{% seo title=false %}
16-
{% endcapture %}
14+
{%- endcapture -%}
15+
16+
<!-- Setup Open Graph image -->
1717

1818
{% if page.image %}
19-
{% assign img = page.image.path | default: page.image %}
20-
21-
{% unless img contains '://' %}
22-
{% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
23-
{% capture target %}"{{ img | absolute_url }}"{% endcapture %}
24-
25-
{% if site.img_cdn contains '//' %}
26-
<!-- it's a cross-origin URL -->
27-
{% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
28-
{% else %}
29-
<!-- it's a local file path -->
30-
{%- capture replacement -%}
31-
"{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
32-
{%- endcapture -%}
33-
{% endif %}
34-
35-
{% assign seo_tags = seo_tags | replace: target, replacement %}
19+
{% assign src = page.image.path | default: page.image %}
20+
21+
{% unless src contains '://' %}
22+
{%- capture img_url -%}
23+
{% include img-url.html src=src img_path=page.img_path %}
24+
{%- endcapture -%}
25+
26+
{%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%}
27+
{%- capture new_url -%}{{ img_url }}{%- endcapture -%}
28+
29+
{% assign seo_tags = seo_tags | replace: old_url, new_url %}
3630
{% endunless %}
31+
32+
{% elsif site.social_preview_image %}
33+
{%- capture img_url -%}
34+
{% include img-url.html src=site.social_preview_image %}
35+
{%- endcapture -%}
36+
37+
{%- capture og_image -%}
38+
<meta property="og:image" content="{{ img_url }}" />
39+
{%- endcapture -%}
40+
41+
{% assign old_meta_clip = '<meta name="twitter:card"' %}
42+
{% assign new_meta_clip = og_image | append: old_meta_clip %}
43+
{% assign seo_tags = seo_tags | replace: old_meta_clip, new_meta_clip %}
3744
{% endif %}
3845

3946
{{ seo_tags }}

_includes/img-url.html

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{%- comment -%}
2+
Generate image final URL based on `site.img_cdn`, `page.img_path`
3+
4+
Arguments:
5+
src - basic image path, required
6+
img_path - relative path of image, optional
7+
8+
Return:
9+
image URL
10+
{%- endcomment -%}
11+
12+
{% assign url = include.src %}
13+
14+
{%- if url -%}
15+
{% unless url contains ':' %}
16+
{%- comment -%} CND URL {%- endcomment -%}
17+
{% assign prefix = site.img_cdn | default: '' | relative_url %}
18+
19+
{%- comment -%} Add page image path prefix {%- endcomment -%}
20+
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
21+
22+
{% assign url = prefix
23+
| append: '/'
24+
| append: url
25+
| replace: '///', '/'
26+
| replace: '//', '/'
27+
| replace: ':', ':/'
28+
%}
29+
{% endunless %}
30+
{%- endif -%}
31+
32+
{{- url -}}

_includes/js-selector.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
%}
4747
{% endif %}
4848

49-
{% if page.content contains '<h2' or page.content contains '<h3' and site.toc and page.toc %}
49+
{% if page.content contains '<h2' or page.content contains '<h3' and site.panel.post.toc and page.toc %}
5050
{% assign urls = urls | append: ',' | append: site.data.origin[type].toc.js %}
5151
{% endif %}
5252

_includes/post-sharing.html

+27-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
11
<!-- Post sharing snippet -->
22

33
<div class="share-wrapper d-flex align-items-center">
4-
<span class="share-label text-muted me-1">{{ site.data.locales[include.lang].post.share }}</span>
4+
<span class="share-label text-muted">{{ site.data.locales[include.lang].post.share }}</span>
55
<span class="share-icons">
66
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
77
{% assign title = title | uri_escape %}
88
{% assign url = page.url | absolute_url | url_encode %}
99

10-
{% for share in site.data.share.platforms %}
10+
{% for share in site.data.share.platforms -%}
11+
{%- capture tooltip -%}
12+
data-bs-toggle="tooltip" data-bs-placement="top" title="{{ share.type }}" aria-label="{{ share.type }}"
13+
{%- endcapture -%}
14+
15+
{% if share.type == 'Mastodon' %}
16+
<script defer type="module" src="https://cdn.jsdelivr.net/npm/@justinribeiro/share-to-mastodon/+esm"></script>
17+
<button class="btn text-start" {{ tooltip }}>
18+
<share-to-mastodon
19+
class="share-mastodon"
20+
message="{{ title }}"
21+
url="{{ url }}"
22+
{%- if share.instances -%}
23+
customInstanceList="{{ share.instances | jsonify | xml_escape }}"
24+
{%- endif %}
25+
>
26+
<i class="fa-fw {{ share.icon }}"></i>
27+
</share-to-mastodon>
28+
</button>
29+
30+
{% continue %}
31+
{% endif %}
32+
1133
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
12-
<a
13-
href="{{ link }}"
14-
data-bs-toggle="tooltip"
15-
data-bs-placement="top"
16-
title="{{ share.type }}"
17-
target="_blank"
18-
rel="noopener"
19-
aria-label="{{ share.type }}"
20-
>
34+
35+
<a href="{{ link }}" target="_blank" rel="noopener" {{ tooltip }}>
2136
<i class="iconfont {{ share.icon }}"></i>
2237
</a>
2338
{% endfor %}
@@ -31,7 +46,7 @@
3146
title="{{ site.data.locales[include.lang].post.button.share_link.title }}"
3247
data-title-succeed="{{ site.data.locales[include.lang].post.button.share_link.succeed }}"
3348
>
34-
<i class="iconfont icon-link pe-none"></i>
49+
<i class="iconfont icon-link pe-none fs-6"></i>
3550
</button>
3651
</span>
3752
</div>

0 commit comments

Comments
 (0)