Compare commits

...

135 Commits
5.3.1 ... 5.4.2

Author SHA1 Message Date
Jerry
736cd75cda Merge branch 'dev' 2025-07-09 13:25:05 +08:00
Jerry
a61e216452 fix: 修正 abcjs 報錯的 bug 2025-07-09 13:24:42 +08:00
Jerry
1de3507843 Merge branch 'dev' 2025-07-04 23:28:11 +08:00
Jerry
d2eacd2d8a feat: 增加導航欄顯示文章標題的選項,並更新懶加載設置 2025-07-04 23:26:29 +08:00
Jerry
5bfc1da03b feat: 更新版本號並升級多個插件的依賴版本,改善功能和相容性 2025-07-04 23:12:47 +08:00
Jerry
21c238e5c1 Merge branch 'dev' of https://github.com/jerryc127/hexo-theme-butterfly into dev 2025-06-25 16:27:06 +08:00
Jerry
60fa703fd3 feat: 增加導覽欄顯示文章標題的選項 feat: 文章頁增加'返回首頁'文字 improvement: 當 per_page 為 0 時,頁面不顯示導覽列 2025-06-25 16:25:46 +08:00
Jerry Wong
7353de6c2e Merge pull request #1695 from DeepChirp/structured_data
feat(structured_data): 为网站首页添加结构化数据
2025-06-25 15:17:08 +08:00
DeepChirp
a9fe9f5332 feat(structured_data): 为网站首页添加结构化数据 2025-06-12 11:43:32 +08:00
Jerry
73de62a6e1 Merge branch 'dev' of https://github.com/jerryc127/hexo-theme-butterfly into dev 2025-05-09 17:57:40 +08:00
Jerry
cf059bd533 fix: 更新 package.json 和 plugins.yml 中的版本號
fix: 修正 truncateContent 函數, 加密文章不显示自动擷取內容
feat: 增加首頁樣式以支持單詞換行
fix: 修正 truncateContent 函數以正確處理自動擷取內容
fix: 修复 card_archives 计数 bug
fix: 修正分頁順序邏輯
2025-05-09 17:52:01 +08:00
Jerry Wong
8cb726ddaa Merge pull request #1683 from SamirLiu127/dev
feat: Add google tag manager
2025-05-09 17:44:32 +08:00
SamirLiu
baee803689 feat: move noscript to additional-js 2025-05-09 13:28:01 +08:00
SamirLiu
023d82820d feat: update merge_config.js 2025-05-09 13:23:17 +08:00
SamirLiu
b7f1610859 update: DataLayer parameter 2025-05-08 14:03:08 +08:00
SamirLiu
5bac44a284 feat: add dataLayer push event pjaxComplete 2025-05-08 13:51:09 +08:00
SamirLiu
9c5294b40c fix: update analytics.pug for google tag manager under pjax 2025-05-07 19:21:39 +08:00
SamirLiu
a7315b6bfc feat: add google tag manager config 2025-05-07 19:17:39 +08:00
SamirLiu
cb3778c686 feat: add google tag manager noscript 2025-05-07 19:17:39 +08:00
Jerry Wong
2ce969023c Merge pull request #1686 from guozhenyi/dev
chore: 补充缺少的依赖库
2025-05-07 18:28:03 +08:00
gzy
7c697c15e8 chore: 补充缺少的依赖库 2025-04-30 16:56:46 +08:00
Jerry
ca030589fb feat: 更新頁腳配置,增加導航欄和版權信息,改進樣式和結構
fix: 修改 getBgPath 函數以使用 this.url_for 獲取圖片的正確路徑
feat: 增加右側配置按鈕的動畫效果
2025-03-23 23:20:12 +08:00
Jerry
46cf1c4e80 Merge branch 'dev' 2025-03-04 16:19:44 +08:00
Jerry Wong
a3f6b625ed Update package.json 2025-03-04 16:14:26 +08:00
Jerry Wong
4a955f0f05 Merge pull request #1659 from LinkinStars/fix-link
fix(subtitle): fix the wrong subtitle link
2025-03-04 16:05:44 +08:00
LinkinStars
525ed7ac82 fix(subtitle): fix the wrong subtitle link 2025-03-03 15:00:27 +08:00
Jerry
b3ba4c9ac4 Merge branch 'dev' 2025-03-02 15:37:03 +08:00
Jerry
628d1bbe52 Merge branch 'dev' of https://github.com/jerryc127/hexo-theme-butterfly into dev 2025-03-02 15:27:34 +08:00
Jerry
ede4f8bfea update 2025-03-02 15:27:16 +08:00
Jerry Wong
feb3346cf6 Merge pull request #1650 from TephrocactusMYC/dev
feat(score tag): support RenderAbc options
2025-03-02 15:13:15 +08:00
Yuchen Mu
576fa5c80e fix: resolve issues from previous commit about feat(score tag) 2025-03-02 10:23:40 +08:00
Yuchen Mu
6019cc8b7c Merge branch 'jerryc127:dev' into dev 2025-03-02 10:12:00 +08:00
Jerry Wong
7f9409553a Merge pull request #1649 from icemyst/patch-1
Update pjax.pug
2025-03-02 01:06:20 +08:00
Yuchen Mu
2de7d34b2b feat(score tag): support RenderAbc options
Modified the score tag to pass custom options to the abcjs RenderAbc interface.
This enhancement enables proper rendering of guitar tablature with custom
settings such as instrument tuning, labels, and formatting options.
2025-02-24 19:03:46 +08:00
冰梦
4b8a610c08 Update pjax.pug
自定义404.html跳转更平滑,使用 window.location.href = e.request.responseURL 加载,自定义404.html加载速度缓慢,可能会出现loading二次加载
2025-02-20 14:10:13 +08:00
Jerry
0dd4645ece Merge branch 'dev' 2025-02-16 21:27:12 +08:00
Jerry
13720bd94d .DS_Store banished! 2025-02-16 21:26:08 +08:00
Jerry
3028b08526 update 2025-02-16 20:53:10 +08:00
Jerry
f605e6dc89 update 2025-02-16 20:38:17 +08:00
Jerry Wong
8ddc25753e Merge pull request #1639 from jerryc127/dev 2025-01-28 18:59:06 +08:00
Jerry Wong
92913a6193 Merge pull request #1635 from cxyfer/dev 2025-01-17 12:16:06 +08:00
cxyfer
1e20234d74 fix: update addtoany item reference for correct sharing functionality 2025-01-17 02:19:21 +08:00
myw
1f3ea55890 fix: 文章頁分頁不顯示的 bug
improvement: 優化部分插件導致文章頁分頁樣式錯亂的 bug
2025-01-13 00:21:47 +08:00
myw
8a0e14b9b8 Merge branch 'dev' 2025-01-12 15:33:52 +08:00
myw
0dc6aede35 Merge branch 'dev' 2025-01-11 01:26:37 +08:00
myw
a1caed17c7 Merge branch 'master' of https://github.com/jerryc127/hexo-theme-butterfly 2024-12-05 15:19:06 +08:00
myw
a69cb0543f update 2024-11-15 14:52:52 +08:00
Jerry Wong
c8609e8433 Update package.json 2024-11-05 19:12:36 +08:00
myw
997b76b967 fix conflicts 2024-11-05 18:03:47 +08:00
myw
f9aca1cb86 update 2024-11-02 19:47:32 +08:00
myw
0c7b406103 Merge branch 'dev' 2024-11-02 19:39:01 +08:00
myw
d10841f289 Merge branch 'dev' 2024-11-02 19:02:12 +08:00
myw
3704dae397 Merge branch 'dev' 2024-10-20 17:48:58 +08:00
Jerry
f0e147c125 5.0 2024-10-03 17:30:15 +08:00
Jerry
fe1607260e 5.0 2024-10-03 17:29:37 +08:00
Jerry Wong
f5607124fd Merge pull request #1536 from mosuzi/master
fix: 修复 artalk.pug 插值语法错误
2024-07-31 00:11:45 +08:00
mosuzi
ae6bbf345e fix: 修复 artalk.pug 插值语法错误 2024-07-26 18:18:14 +08:00
mosuzi
aab5b2c56d fix: 修复 artalk.pug 插值语法错误 2024-07-26 18:03:38 +08:00
Jerry
6c5d587f64 Merge branch 'dev' 2024-02-22 17:07:56 +08:00
Jerry
e5e3998950 Merge branch 'dev' 2024-02-22 17:04:31 +08:00
Jerry
097ea40a4a Merge branch 'dev' 2023-12-29 23:05:31 +08:00
Jerry
bf14e665d9 Merge branch 'dev' 2023-11-24 16:43:06 +08:00
Jerry
805afb2e70 Merge branch 'dev' 2023-10-09 19:55:30 +08:00
Jerry
c90b00f3dd Merge branch 'dev' 2023-06-06 23:35:08 +08:00
Jerry
6e0b29080d Merge branch 'dev' 2023-05-09 00:43:22 +08:00
Jerry
4e99420568 Merge branch 'dev' 2023-04-10 20:31:17 +08:00
Jerry
a2f02a0b80 Merge branch 'dev' 2023-04-10 16:51:10 +08:00
Jerry
9d22bb82c6 Merge branch 'dev' 2023-02-20 17:24:38 +08:00
Jerry
062641c8ab Merge branch 'dev' 2023-01-18 20:28:07 +08:00
Jerry
b019a1fd33 Merge branch 'dev' 2023-01-15 01:40:13 +08:00
Jerry
c6c58f7620 Merge branch 'dev' 2022-10-31 00:10:50 +08:00
Jerry
859cd4938b Merge branch 'dev' 2022-10-21 18:17:12 +08:00
Jerry
8ee052e93b Merge branch 'dev' 2022-08-18 00:39:29 +08:00
Jerry
7e83095920 Merge branch 'dev' 2022-06-27 01:27:45 +08:00
Jerry
057581b955 fix merge conflict 2022-06-24 02:10:04 +08:00
Jerry Wong
6e58f68f0c fix: 修復首頁文章 valine 評論數只顯示第一篇的 bug
fix: 修復子目錄下,第三方插件本地資源無法加載的 bug closed #908
fix: 評論系統開啟時 busuanzi 的 page_pv 不顯示的 bug closed #902
fix: 修復 pjax 下,使用 mermaid 跳轉會重新加載的 bug
2022-05-19 16:37:01 +08:00
Jerry Wong
004a27decc Merge branch 'dev' 2022-05-19 15:39:05 +08:00
Jerry
fd21969278 Merge branch 'dev' 2022-05-11 00:20:35 +08:00
Jerry
2e133e1cd6 Merge branch 'dev' 2022-05-03 19:06:55 +08:00
Jerry
aa767f6fb5 Merge branch 'dev' 2022-02-13 15:27:10 +08:00
Jerry
241f9b5873 improvement: 優化 pjax 下,右下角按鈕的動畫
fix: 修復頁面設置 aside 爲 true 時,js 報錯的 bug
fix: 修復部分頁面右下角按鈕位置遮擋的 bug
fix: 修復壓縮 html 代碼,友情鏈接頁面壓縮會報錯的 bug
fix: 修復safari上滑動側邊菜單欄會收起的 bug
2022-01-16 00:48:03 +08:00
Jerry
31f17d1c64 label 4.0.0 2022-01-15 00:34:35 +08:00
Jerry
de8e35d0d0 fix: 修復開啟 photofigcaption 後,導致 inlineImg 標籤外掛顯示錯亂的 bug close #667
fix: 修復使用本地搜索時,搜索插件配置為不搜索文章內容會無法使用搜索的 bug close #666
fix: 修復可能導致相關文章鏈接出錯的 bug close #549
improvement: 調整代碼框滾動條顏色 close #651
improvement: 當圖片沒有 figcaption 時,不會添加 figcaption 代碼
2021-09-18 22:10:50 +08:00
Jerry
101cb45b90 fix: Waline 評論系統 設置 avatarCDN 無效的 bug 2021-07-30 01:00:32 +08:00
Jerry
641fb56b22 improvement: 修改配置文件註釋 2021-07-20 23:19:14 +08:00
Jerry
7c859ef66d fix: 修復 footer 在部分瀏覽器沒有顯示在底部的 bug close #616 2021-07-20 23:09:57 +08:00
Jerry
42bc175718 Merge branch 'dev' 2021-07-10 22:32:24 +08:00
Jerry
7b520c62f6 label 3.8.0 2021-07-04 18:40:01 +08:00
Jerry
54c6a509c7 breaking changes: 移除 waline 的 emojiCDN 和 emojiMaps 配置
fix: 修復 升級到 waline 1.x 而出現的 bug
2021-06-05 00:35:23 +08:00
Jerry
f0eaf2d8b0 label 3.7.7 2021-05-11 22:25:04 +08:00
Jerry
c439930786 fix: 修復標題/博客名有 ‘ 時,pjax 會報錯的bug
improvement: css調整
2021-05-09 00:52:09 +08:00
Jerry
f4e5cef399 label: 3.7.5 2021-05-05 23:05:46 +08:00
Jerry
637da0702b fix: 修復 github-issues 最新評論 獲取的url格式 bug
fix: 當標題有符號'時,disqus 和 disqusjs 無法加載的 bug
2021-03-30 01:31:17 +08:00
Jerry
6904850044 Merge branch 'dev' into master 2021-03-19 01:10:22 +08:00
Jerry
4c5abe0cc5 Merge branch 'dev' into master 2021-02-03 15:43:37 +08:00
Jerry
e8cfc6e083 Merge branch 'dev' into master 2021-02-01 16:36:21 +08:00
Jerry
823dc03090 Merge branch 'dev' into master 2021-01-30 16:47:46 +08:00
Jerry
24cf0a11e6 Merge branch 'dev' into master 2020-12-31 16:04:14 +08:00
Jerry
a7e512d764 Merge branch 'dev' into master 2020-12-30 23:34:18 +08:00
Jerry
4a69c623fc fix: 修復開啟gitalk評論數後與toc衝突的bug close #462
fix: 修復jquery在一些介面仍然載入問題
fix: 修復medium zoom 報錯的 bug
2020-12-27 15:51:00 +08:00
Jerry
eb823b0a2d Merge branch 'dev' into master 2020-12-15 18:54:32 +08:00
Jerry
8f412c90da Merge branch 'dev' into master 2020-12-13 17:02:32 +08:00
Jerry
6a1330de84 Merge branch 'dev' into master 2020-11-03 22:21:43 +08:00
Jerry
eb5a356a4e Merge branch 'dev' into master 2020-10-28 14:37:18 +08:00
Jerry
f4b07340f7 label: 3.2.0 2020-09-28 22:02:11 +08:00
Jerry Wong
17d8062968 Merge pull request #360 from jerryc127/revert-358-customized-chang
Revert "Add a flag for allowing to disable aside.card_author.button"
2020-09-12 02:41:46 +08:00
Jerry Wong
d4b69051aa Revert "Add a flag for allowing to disable aside.card_author.button" 2020-09-12 02:41:12 +08:00
Jerry Wong
59f6ce63e3 Merge pull request #358 from gcmiao/customized-chang
Add a flag for allowing to disable aside.card_author.button
2020-09-11 19:02:33 +08:00
gcmiao
cd78f639dd Add a flag for allowing to disable aside.card_author.button 2020-09-10 21:09:23 +02:00
Jerry
8e4c20f6d4 label: 更新 3.1.1
chore: update hexo-renderer-stylus to 2.0.1
2020-09-06 22:13:37 +08:00
Jerry
e984efa35c fix: 修復開啟 prismjs 後, 在低版本的 safari 會出現 js 報錯的 Bugs 2020-09-06 22:11:59 +08:00
Jerry
863cf1e780 Merge branch 'dev' into master 2020-09-04 00:42:50 +08:00
Jerry
85b8a83371 Merge branch 'dev' into master 2020-08-31 13:41:47 +08:00
Jerry
d73960f2a2 Merge branch 'dev' into master 2020-08-11 21:20:01 +08:00
Jerry
fcd430902d Merge branch 'dev' into master 2020-08-05 22:04:47 +08:00
Jerry
ee45f6517f Merge branch 'dev' into master 2020-08-02 23:31:32 +08:00
Jerry
67201ac58d 📝 更改注釋文字 2020-08-01 22:47:34 +08:00
Jerry
315d3b50df Merge branch 'dev' into master 2020-08-01 14:44:06 +08:00
Jerry
727a2d97d9 🐛 修復子目錄下,404頁面的‘回到首頁’鏈接錯誤的bugs 2020-07-18 23:30:37 +08:00
Jerry
54b67987c1 Merge branch 'dev' 2020-06-24 00:52:33 +08:00
Jerry
26df41c772 Merge branch 'dev' 2020-06-20 22:10:55 +08:00
Jerry
4e7051ad77 Merge branch 'dev' 2020-06-20 14:01:45 +08:00
Jerry
955b4bae6a Merge branch 'dev' 2020-06-18 20:13:59 +08:00
Jerry
95ddf28f3b Merge branch 'dev' 2020-06-16 21:19:47 +08:00
Jerry
e901f9ad35 Merge branch 'dev' 2020-06-16 18:43:13 +08:00
Jerry
462422e279 Merge branch 'dev' 2020-05-21 16:29:44 +08:00
Jerry
bad24849bd Merge branch 'dev' 2020-05-01 19:00:12 +08:00
Jerry
eb242f0809 Merge branch 'dev' 2020-04-30 00:36:07 +08:00
Jerry
b1795e3def Merge branch 'dev' 2020-04-28 15:35:58 +08:00
Jerry
54b212ead3 Merge branch 'dev' 2020-04-27 14:45:26 +08:00
Jerry
4bbc035f54 Merge branch 'dev' 2020-04-27 02:40:24 +08:00
Jerry
40ba3bb92f 🏷️ 更新2.3.0 2020-04-26 23:42:52 +08:00
Jerry
e2cb0242bb 🏷️ 2.3.0發佈 2020-04-26 23:37:37 +08:00
Jerry
559afab632 🔖 2.2.5發佈
更新内容請看 https://github.com/jerryc127/hexo-theme-butterfly/releases
2020-03-28 03:20:36 +08:00
Jerry
c134d4fc86 🐛 fix: 修復highlight_shrink設為false時,導致script報錯的bug
🐛 fix: 修復highlight_shrink設為true時,按鈕點擊無反應,沒有打開代碼框的bug
🐛 fix: 修復自動切換darkmode時,切換按鈕icon沒有變更的bug
2020-03-24 19:03:51 +08:00
211 changed files with 16449 additions and 16132 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.DS_Store
node_modules/

View File

@@ -13,6 +13,7 @@ nav:
# Navigation bar logo image # Navigation bar logo image
logo: logo:
display_title: true display_title: true
display_post_title: true
# Whether to fix navigation bar # Whether to fix navigation bar
fixed: false fixed: false
@@ -158,7 +159,7 @@ subtitle:
# Choose: false/1/2/3 # Choose: false/1/2/3
# false - disable the function # false - disable the function
# 1 - hitokoto.cn # 1 - hitokoto.cn
# 2 - yijuzhan.com # 2 - https://api.aa1.cn/doc/yiyan.html
# 3 - jinrishici.com # 3 - jinrishici.com
source: false source: false
# If you close the typewriter effect, the subtitle will only show the first line of sub # If you close the typewriter effect, the subtitle will only show the first line of sub
@@ -254,12 +255,15 @@ noticeOutdate:
# Footer Settings # Footer Settings
# -------------------------------------- # --------------------------------------
footer: footer:
nav:
owner: owner:
enable: true enable: true
since: 2019 since: 2025
custom_text:
# Copyright of theme and framework # Copyright of theme and framework
copyright: true copyright:
enable: true
version: true
custom_text:
# -------------------------------------- # --------------------------------------
# Aside Settings # Aside Settings
@@ -399,6 +403,9 @@ rightside_item_order:
# Default: toc,chat,comment # Default: toc,chat,comment
show: show:
# Animation for the bottom right config button
rightside_config_animation: true
# -------------------------------------- # --------------------------------------
# Global Settings # Global Settings
# -------------------------------------- # --------------------------------------
@@ -696,6 +703,12 @@ umami_analytics:
# Umami Cloud (API key) / self-hosted Umami (token) # Umami Cloud (API key) / self-hosted Umami (token)
token: token:
# https://www.googletagmanager.com/
google_tag_manager:
tag_id:
# optional
domain:
# -------------------------------------- # --------------------------------------
# Advertisement # Advertisement
# -------------------------------------- # --------------------------------------
@@ -987,6 +1000,8 @@ instantpage: false
# https://github.com/verlok/vanilla-lazyload # https://github.com/verlok/vanilla-lazyload
lazyload: lazyload:
enable: false enable: false
# Use browser's native lazyload instead of vanilla-lazyload
native: false
# Specify the field to use lazyload (site or post) # Specify the field to use lazyload (site or post)
field: site field: site
placeholder: placeholder:

View File

@@ -32,6 +32,7 @@ post:
copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.' copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.'
recommend: Related Articles recommend: Related Articles
edit: Edit edit: Edit
back_to_home: Back to Home
search: search:
title: Search title: Search

View File

@@ -32,6 +32,7 @@ post:
copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.' copyright_content: 'All articles on this blog are licensed under <a href="%s">%s</a> unless otherwise stated.'
recommend: Related Articles recommend: Related Articles
edit: Edit edit: Edit
back_to_home: Back to Home
search: search:
title: Search title: Search

View File

@@ -32,6 +32,7 @@ post:
copyright_content: 'このブログのすべての記事は、<a href="%s">%s</a> ライセンスの下で提供されており、特に明記されていない限り、すべての権利を留保します。転載時には出典を明記してください: <a href="%s">%s</a>。' copyright_content: 'このブログのすべての記事は、<a href="%s">%s</a> ライセンスの下で提供されており、特に明記されていない限り、すべての権利を留保します。転載時には出典を明記してください: <a href="%s">%s</a>。'
recommend: 関連記事 recommend: 関連記事
edit: 編集 edit: 編集
back_to_home: ホームに戻る
search: search:
title: 検索 title: 検索

View File

@@ -32,6 +32,7 @@ post:
copyright_content: '이 블로그의 모든 글은 <a href="%s">%s</a> 라이선스를 따르며, 별도로 명시되지 않는 한 모든 권리를 보유합니다. 재배포 시 출처를 명시해 주세요: <a href="%s">%s</a>.' copyright_content: '이 블로그의 모든 글은 <a href="%s">%s</a> 라이선스를 따르며, 별도로 명시되지 않는 한 모든 권리를 보유합니다. 재배포 시 출처를 명시해 주세요: <a href="%s">%s</a>.'
recommend: 관련 글 recommend: 관련 글
edit: 편집 edit: 편집
back_to_home: 홈으로 돌아가기
search: search:
title: 검색 title: 검색

View File

@@ -33,6 +33,7 @@ post:
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来源 <a href="%s" target="_blank">%s</a>' <a href="%s" target="_blank">%s</a> 许可协议。转载请注明来源 <a href="%s" target="_blank">%s</a>'
recommend: 相关推荐 recommend: 相关推荐
edit: 编辑 edit: 编辑
back_to_home: 返回首页
search: search:
title: 搜索 title: 搜索

View File

@@ -32,6 +32,7 @@ post:
copyright_content: '除特別聲明外,本博客所有文章均採用<a href="%s">%s</a> 授權協議。轉載請註明出處:<a href="%s">%s</a>。' copyright_content: '除特別聲明外,本博客所有文章均採用<a href="%s">%s</a> 授權協議。轉載請註明出處:<a href="%s">%s</a>。'
recommend: 相關文章 recommend: 相關文章
edit: 編輯 edit: 編輯
back_to_home: 返回首頁
search: search:
title: 搜尋 title: 搜尋

View File

@@ -32,6 +32,7 @@ post:
copyright_content: '本部落格所有文章除特別聲明外,均採用<a href="%s" target="_blank">%s</a> 授權協議。轉載請註明來源 <a href="%s" target="_blank">%s</a>' copyright_content: '本部落格所有文章除特別聲明外,均採用<a href="%s" target="_blank">%s</a> 授權協議。轉載請註明來源 <a href="%s" target="_blank">%s</a>'
recommend: 相關推薦 recommend: 相關推薦
edit: 編輯 edit: 編輯
back_to_home: 返回首頁
search: search:
title: 搜尋 title: 搜尋

View File

@@ -55,3 +55,7 @@ div
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js') script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
!= partial('includes/third-party/search/index', {}, { cache: true }) != partial('includes/third-party/search/index', {}, { cache: true })
if theme.google_tag_manager && theme.google_tag_manager.tag_id
noscript
iframe(src=`${theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/ns.html?id=${theme.google_tag_manager.tag_id}` height="0" width="0" style="display:none;visibility:hidden")

View File

@@ -1,18 +1,39 @@
#footer-wrap - const { nav, owner, copyright, custom_text } = theme.footer
if theme.footer.owner.enable
if nav
.footer-flex
for block in nav
.footer-flex-items(style=`${ block.width ? 'flex-grow:' + block.width : '' }`)
for blockItem in block.content
.footer-flex-item
.footer-flex-title= blockItem.title
.footer-flex-content
for subitem in blockItem.item
if subitem.html
div!= subitem.html
else if subitem.url
a(href=url_for(subitem.url), target='_blank' title=subitem.title)= subitem.title
else if subitem.title
div!= subitem.title
.footer-other
.footer-copyright
if owner.enable
- const currentYear = new Date().getFullYear() - const currentYear = new Date().getFullYear()
- const sinceYear = theme.footer.owner.since - const sinceYear = owner.since
.copyright span.copyright
if sinceYear && sinceYear != currentYear if sinceYear && sinceYear != currentYear
!= `&copy;${sinceYear} - ${currentYear} By ${config.author}` != `&copy;${sinceYear} - ${currentYear} By ${config.author}`
else else
!= `&copy;${currentYear} By ${config.author}` != `&copy;${currentYear} By ${config.author}`
if theme.footer.copyright if copyright.enable
.framework-info - const v = copyright.version ? getVersion() : false
span.framework-info
if owner.enable && nav
span.footer-separator |
span= _p('footer.framework') + ' ' span= _p('footer.framework') + ' '
a(href='https://hexo.io')= 'Hexo' a(href='https://hexo.io')= `Hexo${ v ? ' ' + v.hexo : '' }`
span.footer-separator | span.footer-separator |
span= _p('footer.theme') + ' ' span= _p('footer.theme') + ' '
a(href='https://github.com/jerryc127/hexo-theme-butterfly')= 'Butterfly' a(href='https://github.com/jerryc127/hexo-theme-butterfly')= `Butterfly${ v ? ' ' + v.theme : '' }`
if theme.footer.custom_text if theme.footer.custom_text
.footer_custom_text!= theme.footer.custom_text .footer_custom_text!= theme.footer.custom_text

View File

@@ -32,3 +32,14 @@ if theme.microsoft_clarity
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "!{theme.microsoft_clarity}"); })(window, document, "clarity", "script", "!{theme.microsoft_clarity}");
if (theme.google_tag_manager && theme.google_tag_manager.tag_id)
script.
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
"!{theme.google_tag_manager.domain ? theme.google_tag_manager.domain : 'https://www.googletagmanager.com'}/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','!{theme.google_tag_manager.tag_id}');
btf.addGlobalFn('pjaxComplete', () => {
dataLayer.push({'event': 'pjaxComplete', 'page_title': document.title, 'page_location': location.href, 'page_path': window.location.pathname})
}, 'google_tag_manager')

View File

@@ -1,6 +1,7 @@
if theme.structured_data && page.layout === 'post' if theme.structured_data
if page.layout === 'post'
- -
// use json-ld to add structured data // https://developers.google.com/search/docs/appearance/structured-data/article
const title = page.title const title = page.title
const url = page.permalink const url = page.permalink
@@ -9,8 +10,8 @@ if theme.structured_data && page.layout === 'post'
const datePublished = page.date.toISOString() const datePublished = page.date.toISOString()
const dateModified = (page.updated || page.date).toISOString() const dateModified = (page.updated || page.date).toISOString()
const author = page.copyright_author || config.author const author = page.copyright_author || config.author
const authorHrefVal = page.copyright_author_href || theme.post_copyright.author_href || site.url; const authorHrefVal = page.copyright_author_href || theme.post_copyright.author_href || config.url
const authorHref = full_url_for(authorHrefVal); const authorHref = full_url_for(authorHrefVal)
const jsonLd = { const jsonLd = {
"@context": "https://schema.org", "@context": "https://schema.org",
@@ -25,9 +26,29 @@ if theme.structured_data && page.layout === 'post'
"name": author, "name": author,
"url": authorHref "url": authorHref
}] }]
}; }
jsonLdScript = JSON.stringify(jsonLd, null, 2); jsonLdScript = JSON.stringify(jsonLd, null, 2)
-
else if is_home() && (!page.current || page.current === 1)
-
// https://developers.google.com/search/docs/appearance/site-names#website
const baseUrl = config.url;
const currentPath = url_for('/');
const isRootOrSubdomain = currentPath.split('/').filter(Boolean).length === 0;
if (isRootOrSubdomain) {
const jsonLd = {
"@context": "https://schema.org",
"@type": "WebSite",
"name": config.title,
"url": full_url_for('/'),
}
jsonLdScript = JSON.stringify(jsonLd, null, 2)
}
- -
script(type="application/ld+json"). script(type="application/ld+json").

View File

@@ -5,9 +5,13 @@ nav#nav
img.site-icon(src=url_for(theme.nav.logo) alt='Logo') img.site-icon(src=url_for(theme.nav.logo) alt='Logo')
if theme.nav.display_title if theme.nav.display_title
span.site-name=config.title span.site-name=config.title
if globalPageType === 'post' if globalPageType === 'post' && theme.nav.display_post_title
a.nav-page-title(href=url_for('/')) a.nav-page-title(href=url_for('/'))
span.site-name=(page.title || config.title) span.site-name=(page.title || config.title)
span.site-name
i.fa-solid.fa-circle-arrow-left
span= ' ' + _p('post.back_to_home')
#menus #menus
if theme.search.use if theme.search.use
#search-button #search-button

View File

@@ -1,3 +1,4 @@
if page.total !== 1
- -
var options = { var options = {
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>', prev_text: '<i class="fas fa-chevron-left fa-fw"></i>',
@@ -7,7 +8,7 @@
} }
if globalPageType === 'post' if globalPageType === 'post'
- let paginationOrder = theme.post_pagination === 1 ? { prev: page.prev, next: page.next } : { prev: page.next, next: page.prev } - let paginationOrder = theme.post_pagination === 2 ? { prev: page.prev, next: page.next } : { prev: page.next, next: page.prev }
nav#pagination.pagination-post nav#pagination.pagination-post
each direction, key in paginationOrder each direction, key in paginationOrder

View File

@@ -1,4 +1,5 @@
- const { readmode, translate, darkmode, aside, chat } = theme - const { readmode, translate, darkmode, aside, chat } = theme
mixin rightsideItem(array) mixin rightsideItem(array)
each item in array each item in array
case item case item
@@ -30,30 +31,22 @@ mixin rightsideItem(array)
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment")) a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
i.fas.fa-comments i.fas.fa-comments
#rightside
- const { enable, hide, show } = theme.rightside_item_order - const { enable, hide, show } = theme.rightside_item_order
- const hideArray = enable ? hide && hide.split(',') : ['readmode','translate','darkmode','hideAside'] - const hideArray = enable && hide ? hide.split(',') : ['readmode','translate','darkmode','hideAside']
- const showArray = enable ? show && show.split(',') : ['toc','chat','comment'] - const showArray = enable && show ? show.split(',') : ['toc','chat','comment']
- const needCogBtn = (enable && hide) || (!enable && ((globalPageType === 'post' && (readmode || translate.enable || (darkmode.enable && darkmode.button))) || (translate.enable || (darkmode.enable && darkmode.button))))
#rightside
#rightside-config-hide #rightside-config-hide
if hideArray if hideArray.length
+rightsideItem(hideArray) +rightsideItem(hideArray)
#rightside-config-show
if enable
if hide
button#rightside-config(type="button" title=_p("rightside.setting"))
i.fas.fa-cog.fa-spin
else
if globalPageType === 'post'
if (readmode || translate.enable || (darkmode.enable && darkmode.button))
button#rightside-config(type="button" title=_p("rightside.setting"))
i.fas.fa-cog.fa-spin
else if translate.enable || (darkmode.enable && darkmode.button)
button#rightside-config(type="button" title=_p("rightside.setting"))
i.fas.fa-cog.fa-spin
if showArray #rightside-config-show
if needCogBtn
button#rightside-config(type="button" title=_p("rightside.setting"))
i.fas.fa-cog(class=theme.rightside_config_animation ? 'fa-spin' : '')
if showArray.length
+rightsideItem(showArray) +rightsideItem(showArray)
button#go-up(type="button" title=_p("rightside.back_to_top")) button#go-up(type="button" title=_p("rightside.back_to_top"))

View File

@@ -1,17 +1,46 @@
script. script.
(() => { (() => {
const abcjsInit = () => { const abcjsInit = () => {
const abcjsFn = () => setTimeout(() => { const abcjsFn = () => {
document.querySelectorAll(".abc-music-sheet").forEach(ele => { setTimeout(() => {
if (ele.children.length > 0) return const sheets = document.querySelectorAll(".abc-music-sheet")
ABCJS.renderAbc(ele, ele.innerHTML, {responsive: 'resize'}) for (let i = 0; i < sheets.length; i++) {
}) const ele = sheets[i]
}, 100) if (ele.children.length > 0) continue
typeof ABCJS === 'object' ? abcjsFn() // Parse parameters from data-params attribute
: btf.getScript('!{url_for(theme.asset.abcjs_basic_js)}').then(abcjsFn) let params = {}
const dp = ele.getAttribute("data-params")
if (dp) {
try {
params = JSON.parse(dp)
} catch (e) {
console.error("Failed to parse data-params:", e)
}
} }
window.pjax ? abcjsInit() : window.addEventListener('load', abcjsInit) // Merge parsed parameters with the responsive option
btf.addGlobalFn('encrypt', abcjsInit, 'abcjs') // Ensures params content appears before responsive
const options = { ...params, responsive: "resize" }
// Render the music score using ABCJS.renderAbc
ABCJS.renderAbc(ele, ele.innerHTML, options)
}
}, 100)
}
if (typeof ABCJS === "object") {
abcjsFn()
} else {
btf.getScript("!{url_for(theme.asset.abcjs_basic_js)}").then(abcjsFn)
}
}
if (window.pjax) {
abcjsInit()
} else {
window.addEventListener("load", abcjsInit)
}
btf.addGlobalFn("encrypt", abcjsInit, "abcjs")
})() })()

View File

@@ -18,7 +18,9 @@ script.
includeReply: false includeReply: false
}).then(function (res) { }).then(function (res) {
document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => { document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => {
if (res[index]) {
item.textContent = res[index].count item.textContent = res[index].count
}
}) })
}).catch(function (err) { }).catch(function (err) {
console.log(err) console.log(err)

View File

@@ -3,7 +3,7 @@
script. script.
(() => { (() => {
const isShuoshuo = GLOBAL_CONFIG_SITE.pageType === 'shuoshuo' const isShuoshuo = GLOBAL_CONFIG_SITE.pageType === 'shuoshuo'
const option = !{JSON.stringify(option)} const options = !{JSON.stringify(option)}
const loadScript = src => { const loadScript = src => {
const script = document.createElement('script') const script = document.createElement('script')
@@ -42,8 +42,8 @@ script.
host: '!{host}', host: '!{host}',
site_id: '!{siteId}', site_id: '!{siteId}',
theme: document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light', theme: document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light',
...option, ...options,
url: isShuoshuo ? window.location.origin + path : (option && option.url) || window.location.origin + window.location.pathname url: isShuoshuo ? window.location.origin + path : (options && options.url) || window.location.origin + window.location.pathname
} }
if (window.REMARK42) { if (window.REMARK42) {

View File

@@ -7,10 +7,12 @@ if theme.pjax.exclude
- let choose = theme.comments.use - let choose = theme.comments.use
if choose if choose
if theme.Open_Graph_meta.enable && (choose.includes('Livere') || choose.includes('Utterances') || choose.includes('Giscus')) if choose.includes('Livere') || choose.includes('Utterances') || choose.includes('Giscus')
- pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
if choose.includes('Utterances') || choose.includes('Giscus')
- pjaxSelectors.unshift('link[rel="canonical"]') - pjaxSelectors.unshift('link[rel="canonical"]')
if theme.Open_Graph_meta.enable
- pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]', 'meta[property="og:description"]')
else
- pjaxSelectors.unshift('meta[name="description"]')
script(src=url_for(theme.asset.pjax)) script(src=url_for(theme.asset.pjax))
script. script.
@@ -57,7 +59,10 @@ script.
document.addEventListener('pjax:error', e => { document.addEventListener('pjax:error', e => {
if (e.request.status === 404) { if (e.request.status === 404) {
pjax.loadUrl('!{url_for("/404.html")}') const usePjax = !{theme.pjax && theme.pjax.enable}
!{theme.error_404 && theme.error_404.enable}
? (usePjax ? pjax.loadUrl('!{url_for("/404.html")}') : window.location.href = '!{url_for("/404.html")}')
: window.location.href = e.request.responseURL
} }
}) })
})() })()

View File

@@ -1,6 +1,6 @@
.addtoany .addtoany
.a2a_kit.a2a_kit_size_32.a2a_default_style .a2a_kit.a2a_kit_size_32.a2a_default_style
- let addtoanyItem = theme.addtoany.item.split(',') - let addtoanyItem = theme.share.addtoany.item.split(',')
each name in addtoanyItem each name in addtoanyItem
a(class="a2a_button_" + name) a(class="a2a_button_" + name)

View File

@@ -22,6 +22,26 @@ script.
} else { } else {
subtitleType() subtitleType()
} }
},
processSubtitle: (content, extraContents = []) => {
if (!{effect}) {
const sub = !{JSON.stringify(subContent)}.slice()
if (extraContents.length > 0) {
sub.unshift(...extraContents)
}
if (typeof content === 'string') {
sub.unshift(content)
} else if (Array.isArray(content)) {
sub.unshift(...content)
}
sub.length > 0 && typedJSFn.init(sub)
} else {
document.getElementById('subtitle').textContent = typeof content === 'string' ? content :
(Array.isArray(content) && content.length > 0 ? content[0] : '')
}
} }
} }
btf.addGlobalFn('pjaxSendOnce', () => { typed.destroy() }, 'typedDestroy') btf.addGlobalFn('pjaxSendOnce', () => { typed.destroy() }, 'typedDestroy')
@@ -33,14 +53,12 @@ case source
fetch('https://v1.hitokoto.cn') fetch('https://v1.hitokoto.cn')
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
if (!{effect}) {
const from = '出自 ' + data.from const from = '出自 ' + data.from
const sub = !{JSON.stringify(subContent)} typedJSFn.processSubtitle(data.hitokoto, [from])
sub.unshift(data.hitokoto, from) })
typedJSFn.init(sub) .catch(err => {
} else { console.error('Failed to get the Hitokoto API:', err)
document.getElementById('subtitle').textContent = data.hitokoto typedJSFn.processSubtitle(!{JSON.stringify(subContent)})
}
}) })
} }
typedJSFn.run(subtitleType) typedJSFn.run(subtitleType)
@@ -48,46 +66,48 @@ case source
when 2 when 2
script. script.
function subtitleType () { function subtitleType () {
btf.getScript('https://yijuzhan.com/api/word.php?m=js').then(() => { fetch('https://v.api.aa1.cn/api/yiyan/index.php')
const con = str[0] .then(response => response.text())
if (!{effect}) { .then(data => {
const from = '出自 ' + str[1] const reg = /<p>(.*?)<\/p>/g
const sub = !{JSON.stringify(subContent)} const result = reg.exec(data)
sub.unshift(con, from) if (result && result[1]) {
typedJSFn.init(sub) typedJSFn.processSubtitle(result[1])
} else { } else {
document.getElementById('subtitle').textContent = con throw new Error('Failed to parse the return value of the Yiyan API')
} }
}) })
.catch(err => {
console.error('Failed to get the Yiyan API:', err)
typedJSFn.processSubtitle(!{JSON.stringify(subContent.length)})
})
} }
typedJSFn.run(subtitleType) typedJSFn.run(subtitleType)
when 3 when 3
script. script.
function subtitleType () { function subtitleType () {
btf.getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js').then(() => { btf.getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js')
.then(() => {
jinrishici.load(result => { jinrishici.load(result => {
if (!{effect}) { if (result && result.data && result.data.content) {
const sub = !{JSON.stringify(subContent)} typedJSFn.processSubtitle(result.data.content)
const content = result.data.content
sub.unshift(content)
typedJSFn.init(sub)
} else { } else {
document.getElementById('subtitle').textContent = result.data.content throw new Error('Failed to parse the return value of Jinrishici API')
} }
}) })
}) })
.catch(err => {
console.error('Failed to get the Jinrishici API:', err)
typedJSFn.processSubtitle(!{JSON.stringify(subContent.length)})
})
} }
typedJSFn.run(subtitleType) typedJSFn.run(subtitleType)
default default
- subContent = subContent.length ? subContent : new Array(config.subtitle) if subContent.length > 0
script. script.
function subtitleType () { function subtitleType () {
if (!{effect}) { typedJSFn.processSubtitle(!{JSON.stringify(subContent)})
typedJSFn.init(!{JSON.stringify(subContent)})
} else {
document.getElementById("subtitle").textContent = !{JSON.stringify(subContent[0])}
}
} }
typedJSFn.run(subtitleType) typedJSFn.run(subtitleType)

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "5.3.1", "version": "5.4.2",
"description": "A Simple and Card UI Design theme for Hexo", "description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {
@@ -23,8 +23,10 @@
"email": "my@crazywong.com" "email": "my@crazywong.com"
}, },
"dependencies": { "dependencies": {
"hexo-renderer-pug": "^3.0.0",
"hexo-renderer-stylus": "^3.0.1", "hexo-renderer-stylus": "^3.0.1",
"hexo-renderer-pug": "^3.0.0" "hexo-util": "^3.3.0",
"moment-timezone": "^0.5.48"
}, },
"homepage": "https://butterfly.js.org/", "homepage": "https://butterfly.js.org/",
"author": "Jerry <my@crazywong.com>", "author": "Jerry <my@crazywong.com>",

View File

@@ -1,7 +1,7 @@
abcjs_basic_js: abcjs_basic_js:
name: abcjs name: abcjs
file: dist/abcjs-basic-min.js file: dist/abcjs-basic-min.js
version: 6.4.4 version: 6.5.1
activate_power_mode: activate_power_mode:
name: butterfly-extsrc name: butterfly-extsrc
file: dist/activate-power-mode.min.js file: dist/activate-power-mode.min.js
@@ -9,7 +9,7 @@ activate_power_mode:
algolia_search: algolia_search:
name: algoliasearch name: algoliasearch
file: dist/lite/builds/browser.umd.js file: dist/lite/builds/browser.umd.js
version: 5.19.0 version: 5.30.0
aplayer_css: aplayer_css:
name: aplayer name: aplayer
file: dist/APlayer.min.css file: dist/APlayer.min.css
@@ -45,7 +45,7 @@ canvas_ribbon:
chartjs: chartjs:
name: chart.js name: chart.js
file: dist/chart.umd.js file: dist/chart.umd.js
version: 4.4.7 version: 4.5.0
clickShowText: clickShowText:
name: butterfly-extsrc name: butterfly-extsrc
file: dist/click-show-text.min.js file: dist/click-show-text.min.js
@@ -57,21 +57,21 @@ click_heart:
disqusjs: disqusjs:
name: disqusjs name: disqusjs
file: dist/browser/disqusjs.es2015.umd.min.js file: dist/browser/disqusjs.es2015.umd.min.js
version: 3.0.2 version: 3.1.0
disqusjs_css: disqusjs_css:
name: disqusjs name: disqusjs
file: dist/browser/styles/disqusjs.css file: dist/browser/styles/disqusjs.css
version: 3.0.2 version: 3.1.0
docsearch_css: docsearch_css:
name: '@docsearch/css' name: '@docsearch/css'
other_name: docsearch-css other_name: docsearch-css
file: dist/style.css file: dist/style.css
version: 3.8.2 version: 3.9.0
docsearch_js: docsearch_js:
name: '@docsearch/js' name: '@docsearch/js'
other_name: docsearch-js other_name: docsearch-js
file: dist/umd/index.js file: dist/umd/index.js
version: 3.8.2 version: 3.9.0
egjs_infinitegrid: egjs_infinitegrid:
name: '@egjs/infinitegrid' name: '@egjs/infinitegrid'
other_name: egjs-infinitegrid other_name: egjs-infinitegrid
@@ -80,12 +80,12 @@ egjs_infinitegrid:
fancybox: fancybox:
name: '@fancyapps/ui' name: '@fancyapps/ui'
file: dist/fancybox/fancybox.umd.js file: dist/fancybox/fancybox.umd.js
version: 5.0.36 version: 6.0.7
other_name: fancyapps-ui other_name: fancyapps-ui
fancybox_css: fancybox_css:
name: '@fancyapps/ui' name: '@fancyapps/ui'
file: dist/fancybox/fancybox.css file: dist/fancybox/fancybox.css
version: 5.0.36 version: 6.0.7
other_name: fancyapps-ui other_name: fancyapps-ui
fireworks: fireworks:
name: butterfly-extsrc name: butterfly-extsrc
@@ -111,17 +111,17 @@ instantpage:
instantsearch: instantsearch:
name: instantsearch.js name: instantsearch.js
file: dist/instantsearch.production.min.js file: dist/instantsearch.production.min.js
version: 4.75.7 version: 4.79.0
katex: katex:
name: katex name: katex
file: dist/katex.min.css file: dist/katex.min.css
other_name: KaTeX other_name: KaTeX
version: 0.16.19 version: 0.16.22
katex_copytex: katex_copytex:
name: katex name: katex
file: dist/contrib/copy-tex.min.js file: dist/contrib/copy-tex.min.js
other_name: KaTeX other_name: KaTeX
version: 0.16.19 version: 0.16.22
lazyload: lazyload:
name: vanilla-lazyload name: vanilla-lazyload
file: dist/lazyload.iife.min.js file: dist/lazyload.iife.min.js
@@ -137,7 +137,7 @@ medium_zoom:
mermaid: mermaid:
name: mermaid name: mermaid
file: dist/mermaid.min.js file: dist/mermaid.min.js
version: 11.4.1 version: 11.8.0
meting_js: meting_js:
name: butterfly-extsrc name: butterfly-extsrc
file: metingjs/dist/Meting.min.js file: metingjs/dist/Meting.min.js
@@ -160,17 +160,17 @@ prismjs_autoloader:
name: prismjs name: prismjs
file: plugins/autoloader/prism-autoloader.min.js file: plugins/autoloader/prism-autoloader.min.js
other_name: prism other_name: prism
version: 1.29.0 version: 1.30.0
prismjs_js: prismjs_js:
name: prismjs name: prismjs
file: prism.js file: prism.js
other_name: prism other_name: prism
version: 1.29.0 version: 1.30.0
prismjs_lineNumber_js: prismjs_lineNumber_js:
name: prismjs name: prismjs
file: plugins/line-numbers/prism-line-numbers.min.js file: plugins/line-numbers/prism-line-numbers.min.js
other_name: prism other_name: prism
version: 1.29.0 version: 1.30.0
sharejs: sharejs:
name: butterfly-extsrc name: butterfly-extsrc
file: sharejs/dist/js/social-share.min.js file: sharejs/dist/js/social-share.min.js
@@ -190,7 +190,7 @@ snackbar_css:
twikoo: twikoo:
name: twikoo name: twikoo
file: dist/twikoo.all.min.js file: dist/twikoo.all.min.js
version: 1.6.41 version: 1.6.44
typed: typed:
name: typed.js name: typed.js
file: dist/typed.umd.js file: dist/typed.umd.js
@@ -203,9 +203,9 @@ waline_css:
name: '@waline/client' name: '@waline/client'
file: dist/waline.css file: dist/waline.css
other_name: waline other_name: waline
version: 3.4.3 version: 3.5.7
waline_js: waline_js:
name: '@waline/client' name: '@waline/client'
file: dist/waline.js file: dist/waline.js
other_name: waline other_name: waline
version: 3.4.3 version: 3.5.7

View File

@@ -3,13 +3,14 @@
const { stripHTML, truncate } = require('hexo-util') const { stripHTML, truncate } = require('hexo-util')
// Truncates the given content to a specified length, removing HTML tags and replacing newlines with spaces. // Truncates the given content to a specified length, removing HTML tags and replacing newlines with spaces.
const truncateContent = (content, length) => { const truncateContent = (content, length, encrypt = false) => {
return truncate(stripHTML(content), { length, separator: ' ' }).replace(/\n/g, ' ') if (!content || encrypt) return ''
return truncate(stripHTML(content).replace(/\n/g, ' '), { length })
} }
// Generates a post description based on the provided data and theme configuration. // Generates a post description based on the provided data and theme configuration.
const postDesc = (data, hexo) => { const postDesc = (data, hexo) => {
const { description, content, postDesc } = data const { description, content, postDesc, encrypt } = data
if (postDesc) return postDesc if (postDesc) return postDesc
@@ -23,10 +24,10 @@ const postDesc = (data, hexo) => {
result = description result = description
break break
case 2: case 2:
result = description || truncateContent(content, length) result = description || truncateContent(content, length, encrypt)
break break
default: default:
result = truncateContent(content, length) result = truncateContent(content, length, encrypt)
} }
data.postDesc = result data.postDesc = result

View File

@@ -5,6 +5,7 @@ hexo.extend.filter.register('before_generate', () => {
nav: { nav: {
logo: null, logo: null,
display_title: true, display_title: true,
display_post_title: true,
fixed: false fixed: false
}, },
menu: null, menu: null,
@@ -119,12 +120,16 @@ hexo.extend.filter.register('before_generate', () => {
message_next: 'days since the last update, the content of the article may be outdated.' message_next: 'days since the last update, the content of the article may be outdated.'
}, },
footer: { footer: {
nav: null,
owner: { owner: {
enable: true, enable: true,
since: 2019 since: 2024
}, },
custom_text: null, copyright: {
copyright: true enable: true,
version: true
},
custom_text: null
}, },
aside: { aside: {
enable: true, enable: true,
@@ -223,6 +228,7 @@ hexo.extend.filter.register('before_generate', () => {
hide: null, hide: null,
show: null show: null
}, },
rightside_config_animation: true,
anchor: { anchor: {
auto_update: false, auto_update: false,
click_to_scroll: false click_to_scroll: false
@@ -383,6 +389,10 @@ hexo.extend.filter.register('before_generate', () => {
crisp: { crisp: {
website_id: null website_id: null
}, },
google_tag_manager: {
tag_id: null,
domain: 'https://www.googletagmanager.com'
},
baidu_analytics: null, baidu_analytics: null,
google_analytics: null, google_analytics: null,
cloudflare_analytics: null, cloudflare_analytics: null,

View File

@@ -29,7 +29,6 @@ hexo.extend.generator.register('post', locals => {
previousIndexes.shift() previousIndexes.shift()
} }
console.log(defaultCover[index])
return defaultCover[index] return defaultCover[index]
} }
@@ -64,9 +63,20 @@ hexo.extend.generator.register('post', locals => {
return data return data
} }
return locals.posts.sort('date').map(post => ({ // https://github.com/hexojs/hexo/blob/master/lib%2Fplugins%2Fgenerator%2Fpost.ts
const posts = locals.posts.sort('date').toArray()
const { length } = posts
return posts.map((post, i) => {
if (i) post.prev = posts[i - 1]
if (i < length - 1) post.next = posts[i + 1]
post.__post = true
return {
data: handleImg(post), data: handleImg(post),
layout: 'post', layout: 'post',
path: post.path path: post.path
})) }
})
}) })

View File

@@ -2,11 +2,7 @@
hexo.extend.helper.register('aside_archives', function (options = {}) { hexo.extend.helper.register('aside_archives', function (options = {}) {
const { config, page, site, url_for, _p } = this const { config, page, site, url_for, _p } = this
const { const { archive_dir: archiveDir, timezone, language } = config
archive_dir: archiveDir,
timezone,
language
} = config
// Destructure and set default options with object destructuring // Destructure and set default options with object destructuring
const { const {
@@ -22,7 +18,8 @@ hexo.extend.helper.register('aside_archives', function (options = {}) {
const lang = toMomentLocale(page.lang || page.language || language) const lang = toMomentLocale(page.lang || page.language || language)
// Memoize comparison function to improve performance // Memoize comparison function to improve performance
const compareFunc = type === 'monthly' const compareFunc =
type === 'monthly'
? (yearA, monthA, yearB, monthB) => yearA === yearB && monthA === monthB ? (yearA, monthA, yearB, monthB) => yearA === yearB && monthA === monthB
: (yearA, yearB) => yearA === yearB : (yearA, yearB) => yearA === yearB
@@ -30,9 +27,7 @@ hexo.extend.helper.register('aside_archives', function (options = {}) {
if (!site.posts.length) return '' if (!site.posts.length) return ''
// Use reduce for more efficient data processing // Use reduce for more efficient data processing
const data = site.posts const data = site.posts.sort('date', order).reduce((acc, post) => {
.sort('date', order)
.reduce((acc, post) => {
let date = post.date.clone() let date = post.date.clone()
if (timezone) date = date.tz(timezone) if (timezone) date = date.tz(timezone)
@@ -43,12 +38,22 @@ hexo.extend.helper.register('aside_archives', function (options = {}) {
// Find or create archive entry // Find or create archive entry
const lastEntry = acc[acc.length - 1] const lastEntry = acc[acc.length - 1]
if (!lastEntry || !compareFunc(
lastEntry.year, if (type === 'yearly') {
lastEntry.month, const existingYearIndex = acc.findIndex(entry => entry.year === year)
if (existingYearIndex !== -1) {
acc[existingYearIndex].count++
} else {
// 否則創建新條目
acc.push({
name: date.format(format),
year, year,
month month,
)) { count: 1
})
}
} else {
if (!lastEntry || !compareFunc(lastEntry.year, lastEntry.month, year, month)) {
acc.push({ acc.push({
name: date.format(format), name: date.format(format),
year, year,
@@ -58,6 +63,7 @@ hexo.extend.helper.register('aside_archives', function (options = {}) {
} else { } else {
lastEntry.count++ lastEntry.count++
} }
}
return acc return acc
}, []) }, [])
@@ -72,39 +78,41 @@ hexo.extend.helper.register('aside_archives', function (options = {}) {
} }
// Limit results efficiently // Limit results efficiently
const limitedData = limit > 0 const limitedData = limit > 0 ? data.slice(0, Math.min(data.length, limit)) : data
? data.slice(0, Math.min(data.length, limit))
: data
// Use template literal for better readability // Use template literal for better readability
const archiveHeader = ` const archiveHeader = `
<div class="item-headline"> <div class="item-headline">
<i class="fas fa-archive"></i> <i class="fas fa-archive"></i>
<span>${_p('aside.card_archives')}</span> <span>${_p('aside.card_archives')}</span>
${data.length > limitedData.length ${
data.length > limitedData.length
? `<a class="card-more-btn" href="${url_for(archiveDir)}/" ? `<a class="card-more-btn" href="${url_for(archiveDir)}/"
title="${_p('aside.more_button')}"> title="${_p('aside.more_button')}">
<i class="fas fa-angle-right"></i> <i class="fas fa-angle-right"></i>
</a>` </a>`
: ''} : ''
}
</div> </div>
` `
// Use map for generating list items, join for performance // Use map for generating list items, join for performance
const archiveList = ` const archiveList = `
<ul class="card-archive-list"> <ul class="card-archive-list">
${limitedData.map(item => ` ${limitedData
.map(
item => `
<li class="card-archive-list-item"> <li class="card-archive-list-item">
<a class="card-archive-list-link" href="${createArchiveLink(item)}"> <a class="card-archive-list-link" href="${createArchiveLink(item)}">
<span class="card-archive-list-date"> <span class="card-archive-list-date">
${transform ? transform(item.name) : item.name} ${transform ? transform(item.name) : item.name}
</span> </span>
${showCount ${showCount ? `<span class="card-archive-list-count">${item.count}</span>` : ''}
? `<span class="card-archive-list-count">${item.count}</span>`
: ''}
</a> </a>
</li> </li>
`).join('')} `
)
.join('')}
</ul> </ul>
` `

View File

@@ -81,7 +81,7 @@ hexo.extend.helper.register('findArchivesTitle', function (page, menu, date) {
return loop(menu) || defaultTitle return loop(menu) || defaultTitle
}) })
hexo.extend.helper.register('getBgPath', path => { hexo.extend.helper.register('getBgPath', function(path) {
if (!path) return '' if (!path) return ''
const absoluteUrlPattern = /^(?:[a-z][a-z\d+.-]*:)?\/\//i const absoluteUrlPattern = /^(?:[a-z][a-z\d+.-]*:)?\/\//i
@@ -91,7 +91,7 @@ hexo.extend.helper.register('getBgPath', path => {
if (colorPattern.test(path)) { if (colorPattern.test(path)) {
return `background-color: ${path};` return `background-color: ${path};`
} else if (absoluteUrlPattern.test(path) || relativeUrlPattern.test(path)) { } else if (absoluteUrlPattern.test(path) || relativeUrlPattern.test(path)) {
return `background-image: url(${path});` return `background-image: url(${this.url_for(path)});`
} else { } else {
return `background: ${path};` return `background: ${path};`
} }
@@ -145,3 +145,8 @@ hexo.extend.helper.register('getPageType', (page, isHome) => {
if (isHome) return 'home' if (isHome) return 'home'
return 'post' return 'post'
}) })
hexo.extend.helper.register('getVersion', () => {
const { version } = require('../../package.json')
return { hexo: hexo.version, theme: version }
})

View File

@@ -6,17 +6,45 @@
'use strict' 'use strict'
const score = (args, content) => { const score = (args, content) => {
// Escape HTML tags and some special characters, including curly braces
const escapeHtmlTags = s => { const escapeHtmlTags = s => {
const lookup = { const lookup = {
'&': '&amp;', '&': '&amp;',
'"': '&quot;', '"': '&quot;',
'\'': '&apos;', "'": '&apos;',
'<': '&lt;', '<': '&lt;',
'>': '&gt;' '>': '&gt;',
'{': '&#123;',
'}': '&#125;'
} }
return s.replace(/[&"'<>]/g, c => lookup[c]) return s.replace(/[&"'<>{}]/g, c => lookup[c])
}
return `<div class="abc-music-sheet">${escapeHtmlTags(content)}</div>`
} }
hexo.extend.tag.register('score', score, { ends: true }) const trimmed = content.trim()
// Split content using six dashes as a delimiter
const parts = trimmed.split('------')
if (parts.length < 2) {
// If no delimiter is found, treat the entire content as the score
return `<div class="abc-music-sheet">${escapeHtmlTags(trimmed)}</div>`
}
// First part is parameters (JSON string), the rest is the score content
const paramPart = parts[0].trim()
const scorePart = parts.slice(1).join('------').trim()
let paramsObj = {}
try {
paramsObj = JSON.parse(paramPart)
} catch (e) {
console.error("Failed to parse JSON in score tag:", e)
}
// Use double quotes for data-params attribute value,
// ensuring JSON internal double quotes are escaped
return `<div class="abc-music-sheet" data-params="${escapeHtmlTags(JSON.stringify(paramsObj))}">
${escapeHtmlTags(scorePart)}
</div>`
}
hexo.extend.tag.register("score", score, { ends: true })

View File

@@ -10,8 +10,8 @@
--preloader-bg: $preloader-bg --preloader-bg: $preloader-bg
--preloader-color: $preloader-word-color --preloader-color: $preloader-word-color
--tab-border-color: $tab-border-color --tab-border-color: $tab-border-color
--tab-botton-bg: $tab-botton-bg --tab-button-bg: $tab-button-bg
--tab-botton-color: $tab-botton-color --tab-button-color: $tab-button-color
--tab-button-hover-bg: $tab-button-hover-bg --tab-button-hover-bg: $tab-button-hover-bg
--tab-button-active-bg: $tab-button-active-bg --tab-button-active-bg: $tab-button-active-bg
--card-bg: $card-bg --card-bg: $card-bg

View File

@@ -13,17 +13,16 @@
background-color: var(--mark-bg) background-color: var(--mark-bg)
content: '' content: ''
#footer-wrap & > *
position: relative position: relative
padding: 40px 20px
color: var(--light-grey) color: var(--light-grey)
text-align: center
a a
color: var(--light-grey) color: var(--light-grey)
transition: all .3s ease-in-out
&:hover &:hover
text-decoration: underline color: $light-blue
.footer-separator .footer-separator
margin: 0 4px margin: 0 4px
@@ -33,3 +32,56 @@
max-height: 1.4em max-height: 1.4em
width: auto width: auto
vertical-align: text-bottom vertical-align: text-bottom
.footer-flex
display: flex
flex-direction: row
flex-wrap: wrap
justify-content: space-between
margin: 0 auto
padding: 40px 60px
max-width: 1200px
width: 100%
text-align: left
gap: 13px
+maxWidth768()
padding: 30px
gap: 10px
.footer-flex-items
flex-shrink: 0
min-width: 100px
text-align: left
white-space: nowrap
.footer-flex-title
margin-bottom: 5px
white-space: nowrap
font-weight: 600
font-size: 1.4em
.footer-flex-item
margin: 10px 0
white-space: nowrap
a
display: block
white-space: nowrap
.footer-other
padding: 40px 20px
width: 100%
text-align: center
if hexo-config('footer.nav')
padding: 10px 8px
background-color: rgba(0, 0, 0, .1)
.copyright,
.framework-info,
.footer_custom_text
font-size: .9em
else
.framework-info
display: block

View File

@@ -436,3 +436,28 @@
&:hover &:hover
&:after &:after
width: 100% width: 100%
.nav-page-title
position: relative
overflow: hidden
& > :first-child,
& > :last-child
display: inline-block
transition: all .3s ease-in-out
& > :last-child
position: absolute
top: 50%
left: 0
opacity: 0
transform: translateY(-50%) translateY(-10px)
&:hover
& > :last-child
opacity: 1
transform: translateY(-50%) translateY(0)
& > :first-child
opacity: 0
transform: translateY(10px)

View File

@@ -12,11 +12,10 @@
width: 100% !important width: 100% !important
.pagination-related .pagination-related
width: 50%
height: 150px height: 150px
+maxWidth768() +minWidth768()
width: 100% flex: 1
.info-1 .info-1
.info-item-2 .info-item-2
@@ -31,6 +30,10 @@
margin-top: 40px margin-top: 40px
width: 100% width: 100%
addBorderRadius() addBorderRadius()
display: flex
+maxWidth768()
flex-direction: column
.layout .layout
.pagination .pagination

View File

@@ -10,8 +10,8 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
--preloader-bg: darken(#121212, 2) --preloader-bg: darken(#121212, 2)
--preloader-color: alpha(#FFFFFF, .7) --preloader-color: alpha(#FFFFFF, .7)
--tab-border-color: #2c2c2c --tab-border-color: #2c2c2c
--tab-botton-bg: #2c2c2c --tab-button-bg: #2c2c2c
--tab-botton-color: alpha(#FFFFFF, .7) --tab-button-color: alpha(#FFFFFF, .7)
--tab-button-hover-bg: lighten(#121212, 15) --tab-button-hover-bg: lighten(#121212, 15)
--tab-button-active-bg: #121212 --tab-button-active-bg: #121212
--card-bg: #121212 --card-bg: #121212

View File

@@ -172,3 +172,4 @@ $indexEnable = hexo-config('cover.index_enable')
& > .content & > .content
@extend .limit-more-line @extend .limit-more-line
-webkit-line-clamp: 2 -webkit-line-clamp: 2
word-break: break-word

View File

@@ -14,14 +14,14 @@
flex-wrap: wrap flex-wrap: wrap
margin: 0 margin: 0
padding: 0 padding: 0
background: var(--tab-botton-bg) background: var(--tab-button-bg)
> .tab > .tab
flex-grow: 1 flex-grow: 1
padding: 8px 18px padding: 8px 18px
border-top: 2px solid var(--tab-border-color) border-top: 2px solid var(--tab-border-color)
background: var(--tab-botton-bg) background: var(--tab-button-bg)
color: var(--tab-botton-color) color: var(--tab-button-color)
line-height: 2 line-height: 2
transition: all .4s transition: all .4s

View File

@@ -14,18 +14,18 @@ $code-background = $themeColorEnable && hexo-config('theme_color.code_background
$theme-toc-color = $themeColorEnable && hexo-config('theme_color.toc_color') ? convert(hexo-config('theme_color.toc_color')) : $strong-cyan $theme-toc-color = $themeColorEnable && hexo-config('theme_color.toc_color') ? convert(hexo-config('theme_color.toc_color')) : $strong-cyan
// font // font
$chinseFont = $language == 'zh-CN' ? 'Microsoft YaHei' : 'Microsoft JhengHei' $chineseFont = $language == 'zh-CN' ? 'Microsoft YaHei' : 'Microsoft JhengHei'
$dafault-font-family = -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Lato, Roboto, 'PingFang SC', $chinseFont, sans-serif $default-font-family = -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Lato, Roboto, 'PingFang SC', $chineseFont, sans-serif
$dafault-code-font = consolas, Menlo, monospace, 'PingFang SC', $chinseFont, sans-serif $default-code-font = consolas, Menlo, monospace, 'PingFang SC', $chineseFont, sans-serif
$font-family = hexo-config('font.font_family') ? unquote(hexo-config('font.font_family')) : $dafault-font-family $font-family = hexo-config('font.font_family') ? unquote(hexo-config('font.font_family')) : $default-font-family
$code-font-family = hexo-config('font.code_font_family') ? unquote(hexo-config('font.code_font_family')) : $dafault-code-font $code-font-family = hexo-config('font.code_font_family') ? unquote(hexo-config('font.code_font_family')) : $default-code-font
$site-name-font = hexo-config('blog_title_font.font_family') && unquote(hexo-config('blog_title_font.font_family')) $site-name-font = hexo-config('blog_title_font.font_family') && unquote(hexo-config('blog_title_font.font_family'))
// hr // hr
$hrEnable = hexo-config('hr_icon') && hexo-config('hr_icon.enable') $hrEnable = hexo-config('hr_icon') && hexo-config('hr_icon.enable')
$hr-icon = $hrEnable && hexo-config('hr_icon.icon') ? hexo-config('hr_icon.icon') : '\f0c4' $hr-icon = $hrEnable && hexo-config('hr_icon.icon') ? hexo-config('hr_icon.icon') : '\f0c4'
$hr-icon-top = $hrEnable && hexo-config('hr_icon.icon_top') ? convert(hexo-config('hr_icon.icon_top')) : -10px $hr-icon-top = $hrEnable && hexo-config('hr_icon.icon_top') ? convert(hexo-config('hr_icon.icon_top')) : -10px
// page beatutify // page beautify
$beautifyEnable = hexo-config('beautify.enable') $beautifyEnable = hexo-config('beautify.enable')
$title-prefix-icon = $beautifyEnable && hexo-config('beautify.title_prefix_icon') ? hexo-config('beautify.title_prefix_icon') : '\f0c1' $title-prefix-icon = $beautifyEnable && hexo-config('beautify.title_prefix_icon') ? hexo-config('beautify.title_prefix_icon') : '\f0c1'
$title-prefix-icon-color = $beautifyEnable && hexo-config('beautify.title_prefix_icon_color') ? convert(hexo-config('beautify.title_prefix_icon_color')) : $light-red $title-prefix-icon-color = $beautifyEnable && hexo-config('beautify.title_prefix_icon_color') ? convert(hexo-config('beautify.title_prefix_icon_color')) : $light-red
@@ -175,8 +175,8 @@ $tagsP-purple-color = #6f42c1
$tagsP-green-color = #5cb85c $tagsP-green-color = #5cb85c
// Tag Plugins - Tab // Tag Plugins - Tab
$tab-border-color = #f0f0f0 $tab-border-color = #f0f0f0
$tab-botton-bg = #f0f0f0 $tab-button-bg = #f0f0f0
$tab-botton-color = $font-color $tab-button-color = $font-color
$tab-button-hover-bg = darken($tab-border-color, 8) $tab-button-hover-bg = darken($tab-border-color, 8)
$tab-active-border-color = $theme-color $tab-active-border-color = $theme-color
$tab-button-active-bg = $card-bg $tab-button-active-bg = $card-bg

View File

@@ -186,6 +186,7 @@
if (service === 'medium_zoom') { if (service === 'medium_zoom') {
mediumZoom(ele, { background: 'var(--zoom-bg)' }) mediumZoom(ele, { background: 'var(--zoom-bg)' })
return
} }
if (service === 'fancybox') { if (service === 'fancybox') {
@@ -198,7 +199,9 @@
}) })
if (!window.fancyboxRun) { if (!window.fancyboxRun) {
Fancybox.bind('[data-fancybox]', { let options = ''
if (Fancybox.version < '6') {
options = {
Hash: false, Hash: false,
Thumbs: { Thumbs: {
showOnStart: false showOnStart: false
@@ -226,7 +229,41 @@
right: ['slideshow', 'thumbs', 'close'] right: ['slideshow', 'thumbs', 'close']
} }
} }
}) }
} else {
options = {
Hash: false,
Carousel: {
transition: 'slide',
Thumbs: {
showOnStart: false
},
Toolbar: {
display: {
left: ['counter'],
middle: [
'zoomIn',
'zoomOut',
'toggle1to1',
'rotateCCW',
'rotateCW',
'flipX',
'flipY',
"reset"
],
right: ['autoplay', 'thumbs', 'close']
}
},
Zoomable: {
Panzoom: {
maxScale: 4
}
}
}
}
}
Fancybox.bind('[data-fancybox]', options)
window.fancyboxRun = true window.fancyboxRun = true
} }
} }