Skip to content

Commit 825f90b

Browse files
committed
2 parents 156a6f5 + 9ca7519 commit 825f90b

28 files changed

+152
-104
lines changed

.devcontainer/devcontainer.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "Jekyll",
3+
"image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
4+
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
5+
"postCreateCommand": "bash .devcontainer/post-create.sh",
6+
"customizations": {
7+
"vscode": {
8+
"settings": {
9+
"terminal.integrated.defaultProfile.linux": "zsh"
10+
},
11+
"extensions": [
12+
// Liquid tags auto-complete
13+
"killalau.vscode-liquid-snippets",
14+
// Liquid syntax highlighting and formatting
15+
"Shopify.theme-check-vscode",
16+
// Shell
17+
"timonwong.shellcheck",
18+
"mkhl.shfmt",
19+
// Common formatter
20+
"EditorConfig.EditorConfig",
21+
"esbenp.prettier-vscode",
22+
"stylelint.vscode-stylelint",
23+
"yzhang.markdown-all-in-one",
24+
// Git
25+
"mhutchie.git-graph"
26+
]
27+
}
28+
}
29+
}

.devcontainer/post-create.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
if [ -f package.json ]; then
4+
bash -i -c "nvm install --lts && nvm install-latest-npm"
5+
npm i
6+
npm run build
7+
fi
8+
9+
# Install dependencies for shfmt extension
10+
curl -sS https://webi.sh/shfmt | sh &>/dev/null
11+
12+
# Add OMZ plugins
13+
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
14+
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
15+
sed -i -E "s/^(plugins=\()(git)(\))/\1\2 zsh-syntax-highlighting zsh-autosuggestions\3/" ~/.zshrc
16+
17+
# Avoid git log use less
18+
echo -e "\nunset LESS" >>~/.zshrc

.github/workflows/cd.yml

+3
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ jobs:
3535
publish:
3636
needs: release
3737
uses: ./.github/workflows/publish.yml
38+
secrets:
39+
GH_PAT: ${{ secrets.GH_PAT }}
40+
BUILDER: ${{ secrets.BUILDER }}

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- "master"
6+
- "hotfix/**"
67
paths-ignore:
78
- ".github/**"
89
- "!.github/workflows/ci.yml"
@@ -41,4 +42,4 @@ jobs:
4142
run: npm i && npm run build
4243

4344
- name: Test Site
44-
run: bash tools/test
45+
run: bash tools/test.sh

.github/workflows/publish.yml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches:
66
- docs
77
workflow_call:
8+
secrets:
9+
GH_PAT:
10+
required: true
11+
BUILDER:
12+
required: true
813

914
jobs:
1015
launch:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Gemfile.lock
1717
.jekyll-cache
1818
.jekyll-metadata
1919
_site
20+
_app
2021

2122
# RubyGems
2223
*.gem
@@ -27,6 +28,6 @@ package-lock.json
2728

2829
# IDE configurations
2930
.idea
30-
.vscode
31+
.vscode/*
3132
!.vscode/settings.json
3233
!.vscode/extensions.json

.husky/commit-msg

100755100644
+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx --no -- commitlint --edit ${1}
1+
npx --no -- commitlint --edit $1

.vscode/extensions.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
{
2-
"recommendations": [
3-
// Liquid tags auto-complete
4-
"killalau.vscode-liquid-snippets",
5-
// Liquid syntax highlighting and formatting
6-
"Shopify.theme-check-vscode",
7-
// Common formatter
8-
"esbenp.prettier-vscode",
9-
"foxundermoon.shell-format",
10-
"stylelint.vscode-stylelint",
11-
"yzhang.markdown-all-in-one"
12-
]
2+
"recommendations": ["ms-vscode-remote.remote-containers"]
133
}

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"editor.defaultFormatter": "Shopify.theme-check-vscode"
1616
},
1717
"[shellscript]": {
18-
"editor.defaultFormatter": "foxundermoon.shell-format"
18+
"editor.defaultFormatter": "mkhl.shfmt"
1919
},
2020
// Disable vscode built-in stylelint
2121
"css.validate": false,

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44

55
使用之前请先参考原版 Chirpy 的[使用教程](https://chirpy.cotes.page/posts/getting-started/)
66

7+
<<<<<<< HEAD
78
与原版 Chirpy 不同的点在于:
9+
=======
10+
[![Open in Dev Containers](https://img.shields.io/badge/Dev_Containers-Open-deepskyblue?logo=visualstudiocode)][open-container]&nbsp;
11+
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?&logo=RubyGems&logoColor=ghostwhite&label=gem&color=tomato)][gem]&nbsp;
12+
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy)][license]&nbsp;
13+
[![CI](https://img.shields.io/github/actions/workflow/status/cotes2020/jekyll-theme-chirpy/ci.yml?logo=github)][ci]&nbsp;
14+
[![Codacy Badge](https://img.shields.io/codacy/grade/4e556876a3c54d5e8f2d2857c4f43894?logo=codacy)][codacy]
15+
>>>>>>> 9ca7519239d878258300814a5b201fd5b926a192
816
917
* 在原版支持的评论系统 [Disqus](https://disqus.com/)[Utterances](https://utteranc.es/)[Giscus](https://giscus.app/zh-CN) 外,增加对 [Waline](https://waline.js.org/) 评论系统的支持,参见 `_config.yml` 里的 `comments.waline`
1018
* 使用[知乎式 404 界面](https://404.life/564.html),可以返回首页或者返回上一页。

_config.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ collections:
197197
tabs:
198198
output: true
199199
sort_by: order
200+
app:
201+
output: true
202+
permalink: /:name
200203

201204
defaults:
202205
- scope:
@@ -224,10 +227,6 @@ defaults:
224227
values:
225228
layout: page
226229
permalink: /:title/
227-
- scope:
228-
path: assets/js/dist
229-
values:
230-
swcache: true
231230

232231
sass:
233232
style: compressed

_data/contact.yml

+4
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@
2626
# - type: stack-overflow
2727
# icon: "iconfont icon-stack-overflow"
2828
# url: "" # 填入你的 stackoverflow 主页
29+
#
30+
# - type: bluesky
31+
# icon: "iconfont icon-bluesky"
32+
# url: "" # 填入你的 Bluesky 主页链接

_data/origin/cors.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Sour
2020
# Libraries
2121

2222
toc:
23-
css: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.css
24-
js: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.js
23+
css: https://cdn.jsdelivr.net/npm/tocbot@4.27.20/dist/tocbot.min.css
24+
js: https://cdn.jsdelivr.net/npm/tocbot@4.27.20/dist/tocbot.min.js
2525

2626
fontawesome:
27-
css: https://cdn.jsdelivr.net/npm/@fortawesome/[email protected].1/css/all.min.css
27+
css: https://cdn.jsdelivr.net/npm/@fortawesome/[email protected].2/css/all.min.css
2828

2929
search:
3030
js: https://cdn.jsdelivr.net/npm/[email protected]/dest/simple-jekyll-search.min.js
3131

3232
mermaid:
33-
js: https://cdn.jsdelivr.net/npm/mermaid@10.8.0/dist/mermaid.min.js
33+
js: https://cdn.jsdelivr.net/npm/mermaid@10.9.0/dist/mermaid.min.js
3434

3535
dayjs:
3636
js:
37-
common: https://cdn.jsdelivr.net/npm/[email protected].10/dayjs.min.js
38-
locale: https://cdn.jsdelivr.net/npm/[email protected].10/locale/:LOCALE.min.js
39-
relativeTime: https://cdn.jsdelivr.net/npm/[email protected].10/plugin/relativeTime.min.js
40-
localizedFormat: https://cdn.jsdelivr.net/npm/[email protected].10/plugin/localizedFormat.min.js
37+
common: https://cdn.jsdelivr.net/npm/[email protected].11/dayjs.min.js
38+
locale: https://cdn.jsdelivr.net/npm/[email protected].11/locale/:LOCALE.min.js
39+
relativeTime: https://cdn.jsdelivr.net/npm/[email protected].11/plugin/relativeTime.min.js
40+
localizedFormat: https://cdn.jsdelivr.net/npm/[email protected].11/plugin/localizedFormat.min.js
4141

4242
glightbox:
4343
css: https://cdn.jsdelivr.net/npm/[email protected]/dist/css/glightbox.min.css
@@ -73,6 +73,6 @@ waline:
7373
iconfont:
7474
css:
7575
# 此 css 包含以 'icon-' 为前缀的图标,为模板的核心图标,请勿删除。
76-
- https://at.alicdn.com/t/c/font_2440352_flilaejlkj.css
76+
- https://at.alicdn.com/t/c/font_2440352_ghdnrco5gj6.css
7777
# 添加你的 Iconfont 图标链接
7878
# -

_data/share.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ platforms:
4444
# - label: fosstodon.org
4545
# link: "https://fosstodon.org/"
4646
# - label: photog.social
47-
# link: "https://photog.social/"
47+
# link: "https://photog.social/"
48+
#
49+
# - type: Bluesky
50+
# icon: "iconfont icon-bluesky"
51+
# link: "https://bsky.app/intent/compose?text=TITLE%20URL"

_includes/comments/giscus.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
initTheme = darkTheme;
1818
}
1919

20+
let lang = '{{ site.comments.giscus.lang | default: lang }}';
21+
{%- comment -%} https://github.com/giscus/giscus/tree/main/locales {%- endcomment -%}
22+
if (lang.length > 2 && !lang.startsWith('zh')) {
23+
lang = lang.slice(0, 2);
24+
}
25+
2026
let giscusAttributes = {
2127
src: 'https://giscus.app/client.js',
2228
'data-repo': '{{ site.comments.giscus.repo}}',
@@ -29,7 +35,7 @@
2935
'data-emit-metadata': '0',
3036
'data-theme': initTheme,
3137
'data-input-position': '{{ site.comments.giscus.input_position | default: 'bottom' }}',
32-
'data-lang': '{{ site.comments.giscus.lang | default: lang }}',
38+
'data-lang': lang,
3339
'data-loading': 'lazy',
3440
crossorigin: 'anonymous',
3541
async: ''

_includes/embed/audio.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{% unless src contains '://' %}
66
{%- capture src -%}
7-
{% include media-url.html src=src %}
7+
{% include media-url.html src=src subpath=page.media_subpath %}
88
{%- endcapture -%}
99
{% endunless %}
1010

_includes/embed/video.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
{% unless video_url contains '://' %}
77
{%- capture video_url -%}
8-
{% include media-url.html src=video_url %}
8+
{% include media-url.html src=video_url subpath=page.media_subpath %}
99
{%- endcapture -%}
1010
{% endunless %}
1111

_includes/js-selector.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
<!-- layout specified -->
88

9-
{% assign js_dist = '/assets/js/dist/' %}
10-
119
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
1210
{% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].js %}
1311

@@ -62,7 +60,8 @@
6260
{% assign js = 'commons' %}
6361
{% endcase %}
6462

65-
{% capture script %}{{ js_dist }}{{ js }}.min.js{% endcapture %}
63+
{% capture script %}/assets/js/dist/{{ js }}.min.js{% endcapture %}
64+
6665
<script src="{{ script | relative_url }}"></script>
6766

6867
{% if page.math %}
@@ -93,7 +92,7 @@
9392
{% if jekyll.environment == 'production' %}
9493
<!-- PWA -->
9594
{% if site.pwa.enabled %}
96-
<script defer src="{{ 'app.min.js' | prepend: js_dist | relative_url }}"></script>
95+
<script defer src="{{ 'app.min.js' | relative_url }}"></script>
9796
{% endif %}
9897

9998
<!-- Web Analytics -->

_includes/pageviews/goatcounter.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
fetch(url)
1010
.then((response) => response.json())
1111
.then((data) => {
12-
pv.innerText = new Intl.NumberFormat().format(data.count);
12+
const count = data.count.replace(/\s/g, '');
13+
pv.innerText = new Intl.NumberFormat().format(count);
1314
})
1415
.catch((error) => {
1516
pv.innerText = '1';

_javascript/_copyright

-1
This file was deleted.

_javascript/pwa/_frontmatter

-3
This file was deleted.

jekyll-theme-chirpy.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |spec|
44
spec.name = "jekyll-theme-chirpy"
5-
spec.version = "7.0.0"
5+
spec.version = "7.0.1"
66
spec.authors = ["Cotes Chung"]
77
spec.email = ["[email protected]"]
88

@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
1111
spec.license = "MIT"
1212

1313
spec.files = `git ls-files -z`.split("\x0").select { |f|
14-
f.match(%r!^((_(includes|layouts|sass|(data\/(locales|origin)))|assets)\/|README|LICENSE)!i)
14+
f.match(%r!^((_(includes|layouts|sass|app|(data\/(locales|origin)))|assets)\/|README|LICENSE)!i)
1515
}
1616

1717
spec.metadata = {

package.json

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "jekyll-theme-chirpy",
3-
"version": "7.0.0",
3+
"version": "7.0.1",
44
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/cotes2020/jekyll-theme-chirpy.git"
88
},
99
"author": "Cotes Chung",
1010
"license": "MIT",
11+
"since": 2019,
1112
"bugs": {
1213
"url": "https://github.com/cotes2020/jekyll-theme-chirpy/issues"
1314
},
@@ -19,16 +20,17 @@
1920
"watch:js": "rollup -c --bundleConfigAsCjs -w",
2021
"lint:scss": "stylelint _sass/**/*.scss",
2122
"lint:fix:scss": "npm run lint:scss -- --fix",
22-
"test": "npm run lint:scss"
23+
"test": "npm run lint:scss",
24+
"prepare": "husky"
2325
},
2426
"dependencies": {
2527
"@popperjs/core": "^2.11.8",
2628
"bootstrap": "^5.3.3"
2729
},
2830
"devDependencies": {
29-
"@babel/core": "^7.24.5",
30-
"@babel/plugin-transform-class-properties": "^7.24.1",
31-
"@babel/preset-env": "^7.24.5",
31+
"@babel/core": "^7.24.6",
32+
"@babel/plugin-transform-class-properties": "^7.24.6",
33+
"@babel/preset-env": "^7.24.6",
3234
"@commitlint/cli": "^19.3.0",
3335
"@commitlint/config-conventional": "^19.2.2",
3436
"@rollup/plugin-babel": "^6.0.4",
@@ -39,13 +41,12 @@
3941
"@semantic-release/exec": "^6.0.3",
4042
"@semantic-release/git": "^10.0.1",
4143
"concurrently": "^8.2.2",
42-
"conventional-changelog-conventionalcommits": "^7.0.2",
44+
"conventional-changelog-conventionalcommits": "^8.0.0",
4345
"husky": "^9.0.11",
4446
"purgecss": "^6.0.0",
45-
"rollup": "^4.17.2",
46-
"rollup-plugin-license": "^3.3.1",
47-
"semantic-release": "^23.1.1",
48-
"stylelint": "^16.5.0",
47+
"rollup": "^4.18.0",
48+
"semantic-release": "^24.0.0",
49+
"stylelint": "^16.6.1",
4950
"stylelint-config-standard-scss": "^13.1.0"
5051
},
5152
"prettier": {
@@ -156,8 +157,8 @@
156157
[
157158
"@semantic-release/exec",
158159
{
159-
"prepareCmd": "bash tools/release --prepare",
160-
"publishCmd": "bash tools/release"
160+
"prepareCmd": "bash tools/release.sh --prepare",
161+
"publishCmd": "bash tools/release.sh"
161162
}
162163
],
163164
[

0 commit comments

Comments
 (0)