Skip to content

Commit 21d74f1

Browse files
committed
Merge branch 'master' into production
2 parents 60836af + d6d0098 commit 21d74f1

File tree

18 files changed

+149
-122
lines changed

18 files changed

+149
-122
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
build:
2020
runs-on: ubuntu-latest
2121

22+
strategy:
23+
matrix:
24+
ruby: ["3.0", "3.1", "3.2"]
25+
2226
steps:
2327
- name: Checkout
2428
uses: actions/checkout@v4
@@ -28,7 +32,7 @@ jobs:
2832
- name: Setup Ruby
2933
uses: ruby/setup-ruby@v1
3034
with:
31-
ruby-version: 3
35+
ruby-version: ${{ matrix.ruby }}
3236
bundler-cache: true
3337

3438
- name: Setup Node

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
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.hook

Lines changed: 1 addition & 1 deletion
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

Lines changed: 15 additions & 13 deletions
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 }}

README.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@
1010
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)][license] 
1111
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
1212

13-
[**Live Demo**][demo]
13+
[**Live Demo**][demo]
1414

1515
[![Devices Mockup](https://chirpy-img.netlify.app/commons/devices-mockup.png)][demo]
1616

1717
</div>
1818

1919
## Features
2020

21-
<details>
22-
<summary>Click to expand/close details</summary>
23-
&nbsp;
24-
2521
- Dark / Light Theme Mode
2622
- Localized UI language
2723
- Pinned Posts on Home Page
@@ -41,8 +37,6 @@
4137
- Google Analytics
4238
- SEO & Performance Optimization
4339

44-
</details>
45-
4640
## Documentation
4741

4842
To learn how to use, develop, and upgrade the project, please refer to the [Wiki][wiki].
@@ -55,22 +49,18 @@ For details, see the "[Contributing Guidelines][contribute-guide]".
5549

5650
## Credits
5751

58-
This project was built primarily with the [Jekyll][jekyllrb] ecosystem,
59-
[Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib].
60-
The avatar and favicon design from [Clipart Max][image].
52+
### Contributors
6153

62-
Many thanks to the [contributors][contributors] who participated in the development
63-
and to the folks who reported bugs or shared ideas.
54+
Thanks to [all the contributors][contributors] involved in the development of the project!
6455

65-
Last but not least, thanks to [JetBrains][jetbrains] for providing the _Open Source License_.
56+
[![all-contributors](https://contrib.rocks/image?repo=cotes2020/jekyll-theme-chirpy&columns=16)][contributors]
57+
<sub> —— Made with [contrib.rocks](https://contrib.rocks)</sub>
6658

67-
## Sponsoring
59+
### Third-Party Assets
6860

69-
If you like this project or have built something through it, please consider sponsoring it, and your support would be greatly appreciated.
61+
This project is built on the [Jekyll][jekyllrb] ecosystem and some [great libraries][lib], and is developed using [VS Code][vscode] as well as tools provided by [JetBrains][jetbrains] under a non-commercial open-source software license.
7062

71-
[![Ko-fi](https://img.shields.io/badge/Support_Me_on_Ko--fi-ff5e5b?logo=ko-fi&logoColor=white)][ko-fi]&nbsp;
72-
[![Wechat Pay](https://img.shields.io/badge/Support_Me_on_WeChat-brightgreen?logo=wechat&logoColor=white)][donation]&nbsp;
73-
[![Alipay](https://img.shields.io/badge/Support_Me_on_Alipay-blue?logo=alipay&logoColor=white)][donation]
63+
The avatar and favicon for the project's website are from [ClipartMAX][clipartmax].
7464

7565
## License
7666

@@ -81,14 +71,11 @@ This project is published under [MIT License][license].
8171
[codacy]: https://app.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
8272
[license]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE
8373
[jekyllrb]: https://jekyllrb.com/
84-
[bootstrap]: https://getbootstrap.com/
85-
[icons]: https://fontawesome.com/
86-
[image]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/
74+
[clipartmax]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/
8775
[demo]: https://cotes2020.github.io/chirpy-demo/
8876
[wiki]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki
8977
[contribute-guide]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md
9078
[contributors]: https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors
9179
[lib]: https://github.com/cotes2020/chirpy-static-assets
80+
[vscode]: https://code.visualstudio.com/
9281
[jetbrains]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
93-
[ko-fi]: https://ko-fi.com/coteschung/
94-
[donation]: https://sponsor.cotes.page/

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ img_cdn: "https://chirpy-img.netlify.app"
7575
# the avatar on sidebar, support local or CORS resources
7676
avatar: "/commons/avatar.jpg"
7777

78+
# The URL of the site-wide social preview image used in SEO `og:image` meta tag.
79+
# It can be overridden by a customized `page.image` in front matter.
80+
social_preview_image: # string, local or CORS resources
81+
7882
# boolean type, the global switch for TOC in posts.
7983
toc: true
8084

_data/origin/cors.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ bootstrap:
2323
js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js
2424

2525
toc:
26-
css: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/dist/tocbot.min.css
27-
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/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/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
3434

3535
mermaid:
36-
js: https://cdn.jsdelivr.net/npm/mermaid@10.6.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:

_includes/embed/bilibili.html

Lines changed: 10 additions & 0 deletions
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

Lines changed: 28 additions & 21 deletions
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, new %}
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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
{%- comment -%} CND URL {%- endcomment -%}
16+
{% assign prefix = site.img_cdn | default: '' | relative_url %}
17+
18+
{%- comment -%} Add page image path prefix {%- endcomment -%}
19+
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
20+
21+
{% assign url = prefix | append: '/' | append: url | replace: '///', '/' | replace: '//', '/' | replace: ':', ':/' %}
22+
{%- endif -%}
23+
24+
{{- url -}}

0 commit comments

Comments
 (0)