Skip to content

Commit 446ad6f

Browse files
committed
2 parents edecd73 + e09831b commit 446ad6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+688
-579
lines changed

.github/workflows/cd.yml

+29-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
name: CD
2+
23
on:
34
push:
4-
tags:
5-
- "v[0-9]+.[0-9]+.[0-9]+"
65
branches:
7-
- docs
6+
- production
7+
tags-ignore:
8+
- "**"
89

910
jobs:
10-
launch:
11+
release:
12+
permissions:
13+
contents: write
14+
issues: write
15+
pull-requests: write
1116
runs-on: ubuntu-latest
1217
steps:
13-
- run: |
14-
curl -X POST -H "Accept: application/vnd.github+json" \
15-
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
16-
https://api.github.com/repos/${{ secrets.BUILDER }}/dispatches \
17-
-d '{"event_type":"deploy", "client_payload":{"branch": "${{ github.ref_name }}"}}'
18+
- uses: actions/checkout@v4
19+
20+
- uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: 3.3
23+
bundler-cache: true
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: latest
28+
29+
- run: npm install
30+
- run: npx semantic-release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
34+
35+
publish:
36+
needs: release
37+
uses: ./.github/workflows/publish.yml

.github/workflows/ci.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: "CI"
22
on:
33
push:
4-
branches-ignore:
5-
- "production"
6-
- "docs"
4+
branches:
5+
- "master"
76
paths-ignore:
87
- ".github/**"
98
- "!.github/workflows/ci.yml"
@@ -12,16 +11,14 @@ on:
1211
- "README.md"
1312
- "LICENSE"
1413
pull_request:
15-
paths:
16-
- "**"
1714

1815
jobs:
1916
build:
2017
runs-on: ubuntu-latest
2118

2219
strategy:
2320
matrix:
24-
ruby: ["3.0", "3.1", "3.2"]
21+
ruby: ["3.1", "3.2", "3.3"]
2522

2623
steps:
2724
- name: Checkout
@@ -37,6 +34,8 @@ jobs:
3734

3835
- name: Setup Node
3936
uses: actions/setup-node@v4
37+
with:
38+
node-version: latest
4039

4140
- name: Build Assets
4241
run: npm i && npm run build

.github/workflows/codeql.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: "CodeQL"
22

33
on:
44
push:
5+
branches: ["master"]
56
paths: ["_javascript/**/*.js"]
67
pull_request:
78
paths: ["_javascript/**/*.js"]

.github/workflows/publish.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- docs
7+
workflow_call:
8+
9+
jobs:
10+
launch:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: |
14+
curl -X POST -H "Accept: application/vnd.github+json" \
15+
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
16+
https://api.github.com/repos/${{ secrets.BUILDER }}/dispatches \
17+
-d '{"event_type":"deploy", "client_payload":{"branch": "${{ github.ref_name }}"}}'

.github/workflows/pages-deploy.yml .github/workflows/starter/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.2
45+
ruby-version: 3.3
4646
bundler-cache: true
4747

4848
- name: Build site

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Gemfile.lock
1515

1616
# Jekyll cache
1717
.jekyll-cache
18+
.jekyll-metadata
1819
_site
1920

2021
# RubyGems

_config.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ analytics:
6464
id: # 填入你的 Google Analytics ID
6565
goatcounter:
6666
id: # 填入你的 GoatCounter ID
67+
umami:
68+
id: # 填入你的 Umami ID
69+
domain: # 填入你的 Umami 域名
70+
matomo:
71+
id: # 填入你的 Matomo ID
72+
domain: # 填入你的 Matomo 域名
6773

6874
# 页面浏览量设置
6975
pageviews:
@@ -87,12 +93,12 @@ backgroud_animation: false
8793
# 启用鼠标点击特效
8894
mouse_click_effect: false
8995

90-
# 图像 CDN 端点。
96+
# 媒体资源 CDN 端点。
9197
# 注意一旦被分配,CDN 网址会被加在
92-
# 所有以 '/' 开始的图像(网站头像和帖子中的图像)路径上
98+
# 所有以 '/' 开始的媒体资源(网站头像,帖子中的图像,音频和视频文件)路径上
9399
#
94100
# 例如,'https://cdn.com'
95-
img_cdn: ""
101+
cdn: ""
96102

97103
# 侧边栏的头像,支持本地或 CROS 资源
98104
avatar: /avatar.png

_data/media.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- extension: mp3
2+
mime_type: mpeg
3+
- extension: mov
4+
mime_type: quicktime
5+
- extension: avi
6+
mime_type: x-msvideo
7+
- extension: mkv
8+
mime_type: x-matroska
9+
- extension: ogv
10+
mime_type: ogg
11+
- extension: weba
12+
mime_type: webm
13+
- extension: 3gp
14+
mime_type: 3gpp
15+
- extension: 3g2
16+
mime_type: 3gpp2
17+
- extension: mid
18+
mime_type: midi

_data/origin/basic.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ webfonts: /assets/lib/fonts/main.css
44

55
# Libraries
66

7-
jquery:
8-
js: /assets/lib/jquery/jquery.min.js
9-
107
bootstrap:
118
css: /assets/lib/bootstrap/bootstrap.min.css
129
js: /assets/lib/bootstrap/bootstrap.bundle.min.js
@@ -31,9 +28,9 @@ dayjs:
3128
relativeTime: /assets/lib/dayjs/plugin/relativeTime.min.js
3229
localizedFormat: /assets/lib/dayjs/plugin/localizedFormat.min.js
3330

34-
magnific-popup:
35-
css: /assets/lib/magnific-popup/magnific-popup.css
36-
js: /assets/lib/magnific-popup/jquery.magnific-popup.min.js
31+
glightbox:
32+
css: /assets/lib/glightbox/glightbox.min.css
33+
js: /assets/lib/glightbox/glightbox.min.js
3734

3835
lazy-polyfill:
3936
css: /assets/lib/loading-attribute-polyfill/loading-attribute-polyfill.min.css

_data/origin/cors.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Sour
1717

1818
# Libraries
1919

20-
jquery:
21-
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
22-
2320
bootstrap:
2421
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css
2522
js: https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js
@@ -44,9 +41,9 @@ dayjs:
4441
relativeTime: https://cdn.jsdelivr.net/npm/[email protected]/plugin/relativeTime.min.js
4542
localizedFormat: https://cdn.jsdelivr.net/npm/[email protected]/plugin/localizedFormat.min.js
4643

47-
magnific-popup:
48-
css: https://cdn.jsdelivr.net/npm/[email protected].0/dist/magnific-popup.min.css
49-
js: https://cdn.jsdelivr.net/npm/[email protected].0/dist/jquery.magnific-popup.min.js
44+
glightbox:
45+
css: https://cdn.jsdelivr.net/npm/[email protected].0/dist/css/glightbox.min.css
46+
js: https://cdn.jsdelivr.net/npm/[email protected].0/dist/js/glightbox.min.js
5047

5148
lazy-polyfill:
5249
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/loading-attribute-polyfill.min.css

_includes/analytics/matomo.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Matomo -->
2+
<script type="text/javascript">
3+
var _paq = window._paq = window._paq || [];
4+
_paq.push(['trackPageView']);
5+
_paq.push(['enableLinkTracking']);
6+
(function() {
7+
var u="//{{ site.analytics.matomo.domain }}/";
8+
_paq.push(['setTrackerUrl', u+'matomo.php']);
9+
_paq.push(['setSiteId', {{ site.analytics.matomo.id }}]);
10+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
11+
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
12+
})();
13+
</script>
14+
<!-- End Matomo Code -->

_includes/analytics/umami.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- Umami -->
2+
<script
3+
defer
4+
src="{{ site.analytics.umami.domain }}/script.js"
5+
data-website-id="{{ site.analytics.umami.id }}"
6+
></script>

_includes/comments/disqus.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{ threshold: [0] }
2929
);
3030

31-
disqus_observer.observe(document.querySelector('#disqus_thread'));
31+
disqus_observer.observe(document.getElementById('disqus_thread'));
3232

3333
/* Auto switch theme */
3434
function reloadDisqus() {
@@ -44,7 +44,7 @@
4444
}
4545
}
4646

47-
if (document.querySelector('.mode-toggle')) {
47+
if (document.getElementById('mode-toggle')) {
4848
window.addEventListener('message', reloadDisqus);
4949
}
5050
</script>

_includes/comments/giscus.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<script type="text/javascript">
33
(function () {
44
const origin = 'https://giscus.app';
5-
const iframe = 'iframe.giscus-frame';
65
const lightTheme = 'light';
76
const darkTheme = 'dark_dimmed';
87

@@ -58,7 +57,7 @@
5857
}
5958
};
6059

61-
const giscus = document.querySelector(iframe).contentWindow;
60+
const giscus = document.getElementsByClassName('giscus-frame')[0].contentWindow;
6261
giscus.postMessage({ giscus: message }, origin);
6362
}
6463
});

_includes/comments/utterances.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<script type="text/javascript">
1111
(function () {
1212
const origin = 'https://utteranc.es';
13-
const iframe = 'iframe.utterances-frame';
1413
const lightTheme = 'github-light';
1514
const darkTheme = 'github-dark';
1615
let initTheme = lightTheme;
@@ -43,7 +42,7 @@
4342
theme: theme
4443
};
4544

46-
const utterances = document.querySelector(iframe).contentWindow;
45+
const utterances = document.getElementsByClassName('utterances-frame')[0].contentWindow;
4746
utterances.postMessage(message, origin);
4847
});
4948
})();

_includes/embed/audio.html

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% assign src = include.src | strip %}
2+
{% assign title = include.title | strip %}
3+
{% assign types = include.types | default: '' | strip | split: '|' %}
4+
5+
{% unless src contains '://' %}
6+
{%- capture src -%}
7+
{% include media-url.html src=src %}
8+
{%- endcapture -%}
9+
{% endunless %}
10+
11+
<p>
12+
<audio class="embed-audio" controls>
13+
{% assign extension = src | split: '.' | last %}
14+
{% assign types = extension | concat: types %}
15+
16+
{% assign ext_size = extension | size %}
17+
{% assign src_size = src | size %}
18+
{% assign slice_size = src_size | minus: ext_size %}
19+
20+
{% assign filepath = src | slice: 0, slice_size %}
21+
22+
{% for type in types %}
23+
{% assign src = filepath | append: type %}
24+
{% assign media_item = site.data.media | find: 'extension', type %}
25+
{% assign mime_type = media_item.mime_type | default: type %}
26+
<source src="{{ src }}" type="audio/{{ mime_type }}">
27+
{% endfor %}
28+
29+
Your browser does not support the audio tag. Here is a
30+
<a href="{{ src | strip }}">link to the audio file</a> instead.
31+
</audio>
32+
{% if title %}
33+
<em>{{ title }}</em>
34+
{% endif %}
35+
</p>

_includes/embed/video.html

+26-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{% assign video_url = include.src %}
2+
{% assign title = include.title %}
23
{% assign poster_url = include.poster %}
4+
{% assign types = include.types | default: '' | strip | split: '|' %}
35

46
{% unless video_url contains '://' %}
57
{%- capture video_url -%}
6-
{% include img-url.html src=video_url img_path=page.img_path %}
8+
{% include media-url.html src=video_url %}
79
{%- endcapture -%}
810
{% endunless %}
911

1012
{% if poster_url %}
1113
{% unless poster_url contains '://' %}
1214
{%- capture poster_url -%}
13-
{% include img-url.html src=poster_url img_path=page.img_path %}
15+
{% include media-url.html src=poster_url subpath=page.media_subpath %}
1416
{%- endcapture -%}
1517
{% endunless %}
1618
{% assign poster = 'poster="' | append: poster_url | append: '"' %}
@@ -31,8 +33,27 @@
3133
{% endif %}
3234

3335
<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 class="embed-video file" {{ poster }} {{ attributes }}>
37+
{% assign extension = video_url | split: '.' | last %}
38+
{% assign types = extension | concat: types %}
39+
40+
{% assign ext_size = extension | size %}
41+
{% assign src_size = video_url | size %}
42+
{% assign slice_size = src_size | minus: ext_size %}
43+
44+
{% assign filepath = video_url | slice: 0, slice_size %}
45+
46+
{% for type in types %}
47+
{% assign src = filepath | append: type %}
48+
{% assign media_item = site.data.media | find: 'extension', type %}
49+
{% assign mime_type = media_item.mime_type | default: type %}
50+
<source src="{{ src }}" type="video/{{ mime_type }}">
51+
{% endfor %}
52+
53+
Your browser does not support the video tag. Here is a
54+
<a href="{{ video_url | strip }}">link to the video file</a> instead.
3655
</video>
37-
<em>{{ include.title }}</em>
56+
{% if title %}
57+
<em>{{ title }}</em>
58+
{% endif %}
3859
</p>

0 commit comments

Comments
 (0)