From 5d507319a77d395697ef337c31be155c91ebbd15 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Fri, 21 Jun 2024 11:02:19 -0400 Subject: [PATCH 01/37] fix: correct CDN URL format in themeHelpers.js for aliyun source --- scripts/helpers/themeHelpers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/helpers/themeHelpers.js b/scripts/helpers/themeHelpers.js index 51af5d48..7f6e7103 100755 --- a/scripts/helpers/themeHelpers.js +++ b/scripts/helpers/themeHelpers.js @@ -105,7 +105,7 @@ hexo.extend.helper.register("renderJS", function (path) { jsdelivr: "https://cdn.jsdelivr.net/npm/hexo-theme-redefine@:version/source/:path", aliyun: - "https://evan.beee.top/projects/hexo-theme-redefine/:version/source/:path", + "https://evan.beee.top/projects/hexo-theme-redefine@:version/source/:path", npmmirror: "https://registry.npmmirror.com/hexo-theme-redefine/:version/files/source/:path", custom: this.theme.cdn.custom_url, @@ -164,7 +164,7 @@ hexo.extend.helper.register("renderJSModule", function (path) { jsdelivr: "https://cdn.jsdelivr.net/npm/hexo-theme-redefine@:version/source/:path", aliyun: - "https://evan.beee.top/projects/hexo-theme-redefine/:version/source/:path", + "https://evan.beee.top/projects/hexo-theme-redefine@:version/source/:path", npmmirror: "https://registry.npmmirror.com/hexo-theme-redefine/:version/files/source/:path", custom: this.theme.cdn.custom_url, @@ -223,7 +223,7 @@ hexo.extend.helper.register("renderJSPath", function (path) { jsdelivr: "https://cdn.jsdelivr.net/npm/hexo-theme-redefine@:version/source/:path", aliyun: - "https://evan.beee.top/projects/hexo-theme-redefine/:version/source/:path", + "https://evan.beee.top/projects/hexo-theme-redefine@:version/source/:path", npmmirror: "https://registry.npmmirror.com/hexo-theme-redefine/:version/files/source/:path", custom: this.theme.cdn.custom_url, @@ -280,7 +280,7 @@ hexo.extend.helper.register("renderCSS", function (path) { jsdelivr: "https://cdn.jsdelivr.net/npm/hexo-theme-redefine@:version/source/:path", aliyun: - "https://evan.beee.top/projects/hexo-theme-redefine/:version/source/:path", + "https://evan.beee.top/projects/hexo-theme-redefine@:version/source/:path", npmmirror: "https://registry.npmmirror.com/hexo-theme-redefine/:version/files/source/:path", custom: this.theme.cdn.custom_url, From f17bd93e99334f64d6ebc12142ef96ba62f5e0c4 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Fri, 21 Jun 2024 11:25:43 -0400 Subject: [PATCH 02/37] refactor: enhance title rendering for tag and category pages - Add conditional logic for custom titles in tagcloud.ejs and category-list.ejs - Update page.ejs to handle additional page type conditions for tags and categories --- layout/_widgets/tagcloud.ejs | 9 ++++++++- layout/category-list.ejs | 7 ++++++- layout/page.ejs | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/layout/_widgets/tagcloud.ejs b/layout/_widgets/tagcloud.ejs index 3851d01b..f02aeb5d 100755 --- a/layout/_widgets/tagcloud.ejs +++ b/layout/_widgets/tagcloud.ejs @@ -1,7 +1,14 @@ <% if (site.tags.length){ %>
-

<%- __('tags') %>

+

+ <% const useCustomTitle = page.title.toLowerCase() !== "tags" && page.title.toLowerCase() !=="tag" && page.title !=="标签" %> + <% if (useCustomTitle) { %> + <%= page.title %> + <% } else { %> + <%- __('tags') %> + <% } %> +

<% if (theme.page_templates.tags_style == 'cloud') { %> diff --git a/layout/category-list.ejs b/layout/category-list.ejs index c330b494..b5620fad 100755 --- a/layout/category-list.ejs +++ b/layout/category-list.ejs @@ -1,7 +1,12 @@

- <%- __('categories') %> + <% const useCustomTitle = page.title.toLowerCase() !== "categories" && page.title.toLowerCase() !=="category" && page.title !=="分类" %> + <% if (useCustomTitle) { %> + <%= page.title %> + <% } else { %> + <%- __('categories') %> + <% } %>

diff --git a/layout/page.ejs b/layout/page.ejs index c161b4f8..5f828a2c 100755 --- a/layout/page.ejs +++ b/layout/page.ejs @@ -40,10 +40,10 @@ <% } else if (is_tag()) { %> <%- partial('tag-content') %> - <% } else if (page.title === 'category' || page.title === 'categories') { %> + <% } else if (page.title === 'category' || page.title === 'categories' || page.type === "categories" || page.type === "category") { %> <%- partial('category-list') %> - <% } else if (page.title === 'tag' || page.title === 'tags') { %> + <% } else if (page.title === 'tag' || page.title === 'tags' || page.type === "tags" || page.type === "tag") { %> <%- partial('_widgets/tagcloud') %> <% } else if (page.title === 'Page Not Found' || page.title === '404') { %> From 441496b3178f17340f94341161af8c787c472625 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Fri, 21 Jun 2024 11:46:46 -0400 Subject: [PATCH 03/37] style: update archive list styles and remove unnecessary class - Increased dimensions and adjusted positioning in `_partials/archive-list.styl`. - Modified colors and borders for better visual consistency. - Removed `overflow-hidden` class in `archive-list.ejs`. --- layout/_widgets/archive-list.ejs | 2 +- source/css/layout/_partials/archive-list.styl | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/layout/_widgets/archive-list.ejs b/layout/_widgets/archive-list.ejs index 480af08a..14b22853 100755 --- a/layout/_widgets/archive-list.ejs +++ b/layout/_widgets/archive-list.ejs @@ -16,7 +16,7 @@ <% } %>
  • <% } %> - + <%= post.title %> <% previousDate = currentDate; %> diff --git a/source/css/layout/_partials/archive-list.styl b/source/css/layout/_partials/archive-list.styl index a478be22..bafe98ef 100755 --- a/source/css/layout/_partials/archive-list.styl +++ b/source/css/layout/_partials/archive-list.styl @@ -18,12 +18,12 @@ $article-date-font-size = 1rem color var(--third-text-color) &::after - width 10px - height 10px + width 12px + height 12px display block - top 1em + top 20px position absolute - left -6px + left -7px border-radius 10px content '' border 2px solid var(--third-text-color) @@ -35,16 +35,15 @@ $article-date-font-size = 1rem span.article-title position relative - padding-left 15px display block &::after content "" width 7px height 7px - background var(--background-color) - border 2px solid var(--third-text-color) + background var(--fourth-text-color) + border 1px solid var(--border-color) position absolute - left 0 + left -1.79rem top 0.5em border-radius 50px \ No newline at end of file From 6d0f5e9bf5f31554a4b0f370dfe64d7c5b48d450 Mon Sep 17 00:00:00 2001 From: Feiju12138 <49089085+Feiju12138@users.noreply.github.com.> Date: Sun, 23 Jun 2024 15:20:28 +0800 Subject: [PATCH 04/37] code style update: delete duplicate judgments --- layout/article-content.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/article-content.ejs b/layout/article-content.ejs index 47c22675..0a697c6f 100755 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -144,7 +144,7 @@ <% } %> - <% if (theme.comment.enable === true && theme.comment.hasOwnProperty('system') && page.comment !== false && page.comment !== false) { %> + <% if (theme.comment.enable === true && theme.comment.hasOwnProperty('system') && page.comment !== false) { %>
    <%- partial('_partials/comments/comment') %>
    From 6409343d2838467dae133aaabfd94fc3d13923f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=85=E8=B1=86=E9=BE=99?= Date: Sat, 29 Jun 2024 07:58:24 +0800 Subject: [PATCH 05/37] Update ja.yml --- languages/ja.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/languages/ja.yml b/languages/ja.yml index e20867d1..5ec396a7 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -37,6 +37,7 @@ friends: フレンドシップリンク friend: フレンドシップリンク タイムライン: 時間軸 shuoshuo: 話す +status: サービスかんし # ---------------------------------------- # 网站统计 From 914a48e3849f8a518d7bbe8f4a97bda61e78c6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=85=E8=B1=86=E9=BE=99?= Date: Sat, 29 Jun 2024 07:58:27 +0800 Subject: [PATCH 06/37] Update en.yml --- languages/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/en.yml b/languages/en.yml index 04e9442e..2eb3704c 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -34,13 +34,13 @@ sticky: Sticky # ---------------------------------------- about: About changelog: Changelog -status: Status links: Links link: Link friends: Friends friend: Friend timeline: Timeline shuoshuo: Shuoshuo +status: Status # ---------------------------------------- # Website count From df4b5d28ab7b44c4978da1a85d5846eb34f6ab44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=85=E8=B1=86=E9=BE=99?= Date: Sat, 29 Jun 2024 07:59:26 +0800 Subject: [PATCH 07/37] Update zh-TW.yml --- languages/zh-TW.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 3d7e8806..127fe42f 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -24,6 +24,7 @@ comment: 留言 comments: 留言 top: 頂端 sticky: 置頂 +status: 服務監控 # ---------------------------------------- # 菜单翻译 @@ -90,4 +91,4 @@ ago: create_time: 撰寫 update_time: 更新 -expired: "这篇文章最後更新於 %s 天前,內容可能已經過時。" \ No newline at end of file +expired: "这篇文章最後更新於 %s 天前,內容可能已經過時。" From 768494553427ba20a553c0d84304d4b16839d995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=85=E8=B1=86=E9=BE=99?= Date: Sat, 29 Jun 2024 07:59:41 +0800 Subject: [PATCH 08/37] Update zh-CN.yml --- languages/zh-CN.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 50cc6d4b..2d2b47b7 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -38,6 +38,7 @@ friends: 友情链接 friend: 友情链接 timeline: 时间轴 shuoshuo: 说说 +status: 服务监控 # ---------------------------------------- # 网站统计 @@ -91,4 +92,4 @@ ago: create_time: 创建 update_time: 更新 -expired: "这篇文章最后更新于 %s 天前,内容可能已经过时。" \ No newline at end of file +expired: "这篇文章最后更新于 %s 天前,内容可能已经过时。" From 1b35270a374e80f79d3b3757fd284f59cf6ebd6b Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Sat, 29 Jun 2024 17:49:45 +0800 Subject: [PATCH 09/37] Update zh-CN translate and 404 page style --- languages/zh-CN.yml | 2 +- layout/_partials/404-template.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 2d2b47b7..b1e862ba 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -62,7 +62,7 @@ seconds: 秒 optimized_by: 并由 Evan 进行优化 rights: 版权所有 -site_posts: "共 %s 篇文章" +site_posts: "共撰写了 %s 篇文章" site_wordcount: "共 %s 字" # ---------------------------------------- diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index e6a3b231..0eaca600 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -1,6 +1,6 @@
    -

    404 Page Not Found

    +

    404
    Page Not Found

    Go Back Home From c0dfbf2623dfcdea89a8bfe085299cf81728f053 Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Sun, 30 Jun 2024 07:37:38 +0800 Subject: [PATCH 10/37] fix: language translation duplication repair MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复status翻译重复问题,同时修改了中文翻译,使读起来更口语化 --- languages/en.yml | 3 +-- languages/ja.yml | 3 +-- languages/zh-CN.yml | 5 ++--- languages/zh-TW.yml | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/languages/en.yml b/languages/en.yml index 2eb3704c..e22a1877 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -40,7 +40,6 @@ friends: Friends friend: Friend timeline: Timeline shuoshuo: Shuoshuo -status: Status # ---------------------------------------- # Website count @@ -50,7 +49,7 @@ site_pv: TOTAL PAGE VIEWS read_more: Read more wordcount: Words min2read: Mins - +status: Status # ---------------------------------------- # Footer diff --git a/languages/ja.yml b/languages/ja.yml index 5ec396a7..12603d79 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -2,7 +2,7 @@ # 网站翻译 # ---------------------------------------- search: 検索... -toc: このページの目次 +toc: 目次 prev: 前のページ next: 次のページ prev_posts: 前一篇 @@ -37,7 +37,6 @@ friends: フレンドシップリンク friend: フレンドシップリンク タイムライン: 時間軸 shuoshuo: 話す -status: サービスかんし # ---------------------------------------- # 网站统计 diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index b1e862ba..79d9b094 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -1,8 +1,8 @@ # ---------------------------------------- # 网站翻译 # ---------------------------------------- -search: 搜索... -toc: 此页目录 +search: 站内搜索您需要的内容... +toc: 目录 prev: 上一页 next: 下一页 prev_posts: 上一篇 @@ -38,7 +38,6 @@ friends: 友情链接 friend: 友情链接 timeline: 时间轴 shuoshuo: 说说 -status: 服务监控 # ---------------------------------------- # 网站统计 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 127fe42f..c67ed7bd 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -1,8 +1,8 @@ # ---------------------------------------- # 网站翻译 # ---------------------------------------- -search: 搜尋... -toc: 此頁目錄 +search: 站內搜尋您想要的內容... +toc: 目錄 prev: 上一頁 next: 下一頁 prev_posts: 上一篇 @@ -24,7 +24,6 @@ comment: 留言 comments: 留言 top: 頂端 sticky: 置頂 -status: 服務監控 # ---------------------------------------- # 菜单翻译 From 3a89c3b7f2d00f6cf6953da8d0a6a47629161989 Mon Sep 17 00:00:00 2001 From: Smile slime 47 Date: Sat, 6 Jul 2024 01:42:27 +0800 Subject: [PATCH 11/37] feat:sort archive-list by post's title when the date is same --- layout/_widgets/archive-list.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_widgets/archive-list.ejs b/layout/_widgets/archive-list.ejs index 480af08a..1fe20fb7 100755 --- a/layout/_widgets/archive-list.ejs +++ b/layout/_widgets/archive-list.ejs @@ -8,7 +8,7 @@
    <% let previousDate = null; %>
      - <% postYear.postList.forEach(post => { %> + <% postYear.postList.sort((a,b) => a.title.localeCompare(b.title)).forEach(post => { %> <% const currentDate = date(post.date, 'MM-DD'); %> <% if (previousDate !== currentDate) { %> <% if (previousDate) { %> From b69d1404e7c91db26d99e4fba4a919b9eba8aea8 Mon Sep 17 00:00:00 2001 From: Smile slime 47 Date: Sat, 6 Jul 2024 19:59:27 +0800 Subject: [PATCH 12/37] fix:prevent the same dates from being divided into multiple groups due to pre-sorting --- layout/_widgets/archive-list.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_widgets/archive-list.ejs b/layout/_widgets/archive-list.ejs index 1fe20fb7..5d616e77 100755 --- a/layout/_widgets/archive-list.ejs +++ b/layout/_widgets/archive-list.ejs @@ -8,7 +8,7 @@
    <% let previousDate = null; %>
      - <% postYear.postList.sort((a,b) => a.title.localeCompare(b.title)).forEach(post => { %> + <% postYear.postList.sort((a,b) => (a.date > b.date ? -1 : (a.date < b.date ? 1 : a.title.localeCompare(b.title)))).forEach(post => { %> <% const currentDate = date(post.date, 'MM-DD'); %> <% if (previousDate !== currentDate) { %> <% if (previousDate) { %> From f129bac70687ac0c879dce4362a7930a17f0f258 Mon Sep 17 00:00:00 2001 From: Ryou1127 Date: Thu, 18 Jul 2024 21:46:35 +0800 Subject: [PATCH 13/37] =?UTF-8?q?fix:=20=E6=A0=87=E9=A2=98=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E5=8D=95=E5=BC=95=E5=8F=B7=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/css/common/codeblock/highlight.styl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/css/common/codeblock/highlight.styl b/source/css/common/codeblock/highlight.styl index 72c6ecc2..98b612b6 100755 --- a/source/css/common/codeblock/highlight.styl +++ b/source/css/common/codeblock/highlight.styl @@ -28,10 +28,12 @@ code padding 3px 4px word-wrap break-word border-radius $redefine-border-radius-xsmall - font-size 0.875rem !important color var(--code-foreground) background var(--code-background) +.main-content code + font-size: 0.9em + pre @extend $code-block font-size 0.9rem !important From 3d24971e248eeff100282756d02eb13e730dc10e Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Tue, 30 Jul 2024 21:45:25 -0400 Subject: [PATCH 14/37] chore: update contact link --- DONATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DONATION.md b/DONATION.md index 3bfef251..fc57bcb8 100644 --- a/DONATION.md +++ b/DONATION.md @@ -33,7 +33,7 @@ A big thank you to all the friends who have sponsored this project. Your support | ![IMG_0382](https://user-images.githubusercontent.com/68590232/223455834-d2e5ab6e-9d75-4bbf-adfb-2c519d6b4582.JPG) | ![IMG_9570](https://user-images.githubusercontent.com/68590232/223463950-f7276ef8-0198-4070-8541-697ec25e5b9a.png) | ![IMG_0385](https://user-images.githubusercontent.com/68590232/223459896-593e105e-89f3-4631-8cab-cb7798a53bf1.jpg) | -赞助完以后,请各位加我微信 `do-not-go-plzzz` 联系我添加 GitHub 账号和网站链接! +赞助完以后,请各位加我微信,在 [evannotfound.com/contact](https://evannotfound.com/contact) 联系我添加 GitHub 账号和网站链接! After making a donation, if you want to get in touch with me, please add me on Discord with my username `evannotfound`. 感谢! @@ -77,4 +77,4 @@ Thank you! | Oct 16 | 沈*昊 | ¥20.00 | 微信赞赏码 | - | | Oct 24 | Neptune. | ¥14.99 | 微信赞赏码 | - | | Nov 26 | **青 | ¥25.00 | 支付宝 | - | -| Nov 27 | :-) | ¥16.66 | 微信 | - | \ No newline at end of file +| Nov 27 | :-) | ¥16.66 | 微信 | - | From 0f7ac23f89b8048c049fbf32c7acb80f4d8f4ae5 Mon Sep 17 00:00:00 2001 From: oasislzy <150250114+jackgdn@users.noreply.github.com> Date: Fri, 9 Aug 2024 00:11:59 +0800 Subject: [PATCH 15/37] fix: correct time display of shuoshuo Change the time zone of the shuoshuo display to UTC to avoid an 8-hour time error. --- layout/_widgets/essays.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_widgets/essays.ejs b/layout/_widgets/essays.ejs index f0e265da..29171e0a 100644 --- a/layout/_widgets/essays.ejs +++ b/layout/_widgets/essays.ejs @@ -10,7 +10,7 @@
    • <%- image_tag(theme.defaults.avatar, {class: "w-full h-full rounded-[6.2px]"}) %>
      -
      <%- moment(e.date).locale(config.language).calendar() %>
      +
      <%- moment(e.date).utc().locale(config.language).calendar() %>
      <%- markdown(e.content) %>
      From dfe59202f638d28c4c9e27954321d8f539eef32c Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Fri, 9 Aug 2024 11:16:43 +0800 Subject: [PATCH 16/37] Update 404-template.ejs --- layout/_partials/404-template.ejs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index 0eaca600..600a0187 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -3,6 +3,9 @@

      404
      Page Not Found

  • +
    \ No newline at end of file From 67b380561e7468d213fc929c8ee55419794faae3 Mon Sep 17 00:00:00 2001 From: oasislzy <150250114+jackgdn@users.noreply.github.com> Date: Fri, 9 Aug 2024 22:55:50 +0800 Subject: [PATCH 17/37] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A6=96=E9=A1=B5=20Hi?= =?UTF-8?q?tokoto=20=E6=98=BE=E7=A4=BA=E4=BD=9C=E8=80=85=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 1 + source/js/plugins/typed.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index fa2a2431..765f77fb 100755 --- a/_config.yml +++ b/_config.yml @@ -122,6 +122,7 @@ home_banner: text: [] # subtitle text, array hitokoto: # 一言配置 enable: false # Whether to enable hitokoto + show_author: false # Whether to show author api: https://v1.hitokoto.cn # API URL, can add types, see https://developer.hitokoto.cn/sentence/#%E5%8F%A5%E5%AD%90%E7%B1%BB%E5%9E%8B-%E5%8F%82%E6%95%B0 typing_speed: 100 # Typing speed (ms) backing_speed: 80 # Backing speed (ms) diff --git a/source/js/plugins/typed.js b/source/js/plugins/typed.js index 7b8a115e..3977e931 100644 --- a/source/js/plugins/typed.js +++ b/source/js/plugins/typed.js @@ -38,7 +38,11 @@ export default function initTyped(id) { fetch(usrHitokotoAPI) .then((response) => response.json()) .then((data) => { - typing(data.hitokoto); + if (data.from_who && theme.home_banner.subtitle.hitokoto.show_author) { + typing(data.hitokoto + "——" + data.from_who); + } else { + typing(data.hitokoto); + } }) .catch(console.error); } else { From 647b28c1ce5be481e07ac747b8a862b6ec3e1249 Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Wed, 21 Aug 2024 16:32:35 +0800 Subject: [PATCH 18/37] Revert "fix: language translation duplication repair" This reverts commit c0dfbf2623dfcdea89a8bfe085299cf81728f053. --- languages/en.yml | 3 ++- languages/ja.yml | 3 ++- languages/zh-CN.yml | 5 +++-- languages/zh-TW.yml | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/languages/en.yml b/languages/en.yml index e22a1877..2eb3704c 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -40,6 +40,7 @@ friends: Friends friend: Friend timeline: Timeline shuoshuo: Shuoshuo +status: Status # ---------------------------------------- # Website count @@ -49,7 +50,7 @@ site_pv: TOTAL PAGE VIEWS read_more: Read more wordcount: Words min2read: Mins -status: Status + # ---------------------------------------- # Footer diff --git a/languages/ja.yml b/languages/ja.yml index 12603d79..5ec396a7 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -2,7 +2,7 @@ # 网站翻译 # ---------------------------------------- search: 検索... -toc: 目次 +toc: このページの目次 prev: 前のページ next: 次のページ prev_posts: 前一篇 @@ -37,6 +37,7 @@ friends: フレンドシップリンク friend: フレンドシップリンク タイムライン: 時間軸 shuoshuo: 話す +status: サービスかんし # ---------------------------------------- # 网站统计 diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 79d9b094..b1e862ba 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -1,8 +1,8 @@ # ---------------------------------------- # 网站翻译 # ---------------------------------------- -search: 站内搜索您需要的内容... -toc: 目录 +search: 搜索... +toc: 此页目录 prev: 上一页 next: 下一页 prev_posts: 上一篇 @@ -38,6 +38,7 @@ friends: 友情链接 friend: 友情链接 timeline: 时间轴 shuoshuo: 说说 +status: 服务监控 # ---------------------------------------- # 网站统计 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index c67ed7bd..127fe42f 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -1,8 +1,8 @@ # ---------------------------------------- # 网站翻译 # ---------------------------------------- -search: 站內搜尋您想要的內容... -toc: 目錄 +search: 搜尋... +toc: 此頁目錄 prev: 上一頁 next: 下一頁 prev_posts: 上一篇 @@ -24,6 +24,7 @@ comment: 留言 comments: 留言 top: 頂端 sticky: 置頂 +status: 服務監控 # ---------------------------------------- # 菜单翻译 From c35a602c9ca224b9906300d94028115cff8d8aef Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Wed, 21 Aug 2024 16:42:09 +0800 Subject: [PATCH 19/37] Reapply "fix: language translation duplication repair" This reverts commit 647b28c1ce5be481e07ac747b8a862b6ec3e1249. --- languages/en.yml | 3 +-- languages/ja.yml | 3 +-- languages/zh-CN.yml | 5 ++--- languages/zh-TW.yml | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/languages/en.yml b/languages/en.yml index 2eb3704c..e22a1877 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -40,7 +40,6 @@ friends: Friends friend: Friend timeline: Timeline shuoshuo: Shuoshuo -status: Status # ---------------------------------------- # Website count @@ -50,7 +49,7 @@ site_pv: TOTAL PAGE VIEWS read_more: Read more wordcount: Words min2read: Mins - +status: Status # ---------------------------------------- # Footer diff --git a/languages/ja.yml b/languages/ja.yml index 5ec396a7..12603d79 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -2,7 +2,7 @@ # 网站翻译 # ---------------------------------------- search: 検索... -toc: このページの目次 +toc: 目次 prev: 前のページ next: 次のページ prev_posts: 前一篇 @@ -37,7 +37,6 @@ friends: フレンドシップリンク friend: フレンドシップリンク タイムライン: 時間軸 shuoshuo: 話す -status: サービスかんし # ---------------------------------------- # 网站统计 diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index b1e862ba..79d9b094 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -1,8 +1,8 @@ # ---------------------------------------- # 网站翻译 # ---------------------------------------- -search: 搜索... -toc: 此页目录 +search: 站内搜索您需要的内容... +toc: 目录 prev: 上一页 next: 下一页 prev_posts: 上一篇 @@ -38,7 +38,6 @@ friends: 友情链接 friend: 友情链接 timeline: 时间轴 shuoshuo: 说说 -status: 服务监控 # ---------------------------------------- # 网站统计 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 127fe42f..c67ed7bd 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -1,8 +1,8 @@ # ---------------------------------------- # 网站翻译 # ---------------------------------------- -search: 搜尋... -toc: 此頁目錄 +search: 站內搜尋您想要的內容... +toc: 目錄 prev: 上一頁 next: 下一頁 prev_posts: 上一篇 @@ -24,7 +24,6 @@ comment: 留言 comments: 留言 top: 頂端 sticky: 置頂 -status: 服務監控 # ---------------------------------------- # 菜单翻译 From 4eddaf77ab3a55f3d993a56f767a89c4ab387d6f Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Wed, 21 Aug 2024 16:42:14 +0800 Subject: [PATCH 20/37] Revert "Update 404-template.ejs" This reverts commit dfe59202f638d28c4c9e27954321d8f539eef32c. --- layout/_partials/404-template.ejs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index 600a0187..0eaca600 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -3,9 +3,6 @@

    404
    Page Not Found

    - \ No newline at end of file From 2869b81b175a4132cdaafb6162eb83d66fb92fc8 Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Wed, 21 Aug 2024 21:15:13 +0800 Subject: [PATCH 21/37] Update: Make 404 pages support multiple languages, and increase the length of the article summary Previously, 404 pages were only in Chinese, but now translation has been added to make them support all languages of the topic Before, the article summary was very small, resulting in very little information, now increased to 300, the content will be more rich --- languages/en.yml | 1 + languages/ja.yml | 1 + languages/zh-CN.yml | 1 + languages/zh-TW.yml | 1 + layout/_partials/404-template.ejs | 2 +- layout/_partials/home-content.ejs | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/languages/en.yml b/languages/en.yml index e22a1877..7a1eeb03 100755 --- a/languages/en.yml +++ b/languages/en.yml @@ -27,6 +27,7 @@ archive: Archive archives: Archives top: TOP sticky: Sticky +go-back-home: Go Back Home # ---------------------------------------- diff --git a/languages/ja.yml b/languages/ja.yml index 12603d79..49b4ca82 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -24,6 +24,7 @@ comment: コメント comments: コメント top: トップ sticky: 屋根 +go-back-home: トップページに戻ります # ---------------------------------------- # 菜单翻译 diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 79d9b094..92fc95bc 100755 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -24,6 +24,7 @@ comment: 评论 comments: 评论 top: 置顶 sticky: 置顶 +go-back-home: 回到首页 # ---------------------------------------- # 菜单翻译 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index c67ed7bd..c023b968 100755 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -24,6 +24,7 @@ comment: 留言 comments: 留言 top: 頂端 sticky: 置頂 +go-back-home: 回到首頁 # ---------------------------------------- # 菜单翻译 diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index 0eaca600..a9376902 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -3,6 +3,6 @@

    404
    Page Not Found

    \ No newline at end of file diff --git a/layout/_partials/home-content.ejs b/layout/_partials/home-content.ejs index ec589242..89591760 100755 --- a/layout/_partials/home-content.ejs +++ b/layout/_partials/home-content.ejs @@ -43,7 +43,7 @@ <% } else if (post.excerpt && post.excerpt !== "false") { %> <%- render(post.excerpt, "markdown") %> <% } else { %> - <%- truncate(strip_html(post.content), {length: 128}) %> + <%- truncate(strip_html(post.content), {length: 300}) %> <% } %> From 66d3a091cefbc39b9adbd1f4a7f939b686f561d3 Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Thu, 22 Aug 2024 21:05:37 +0800 Subject: [PATCH 22/37] Update 404-template.ejs --- layout/_partials/404-template.ejs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index a9376902..f0357169 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -3,6 +3,13 @@

    404
    Page Not Found

    +<<<<<<< HEAD go-back-home +======= + Return to previous page +
    +
    +

    or Back to homepage.

    +>>>>>>> parent of 4eddaf7 (Revert "Update 404-template.ejs")
    \ No newline at end of file From d87d4f7b212dc446b96a6894d4cf9a715a98bfaf Mon Sep 17 00:00:00 2001 From: Fengyi Chen Date: Sat, 31 Aug 2024 22:22:39 +0800 Subject: [PATCH 23/37] Revert "Update 404-template.ejs" This reverts commit 66d3a091cefbc39b9adbd1f4a7f939b686f561d3. --- layout/_partials/404-template.ejs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index f0357169..a9376902 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -3,13 +3,6 @@

    404
    Page Not Found

    -<<<<<<< HEAD go-back-home -======= - Return to previous page -
    -
    -

    or Back to homepage.

    ->>>>>>> parent of 4eddaf7 (Revert "Update 404-template.ejs")
    \ No newline at end of file From 0c57f400071d6013dfd29198c87c84db4943543d Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 10:37:00 -0400 Subject: [PATCH 24/37] fix: i18n for go-back-home --- layout/_partials/404-template.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/_partials/404-template.ejs b/layout/_partials/404-template.ejs index a9376902..d1529535 100644 --- a/layout/_partials/404-template.ejs +++ b/layout/_partials/404-template.ejs @@ -3,6 +3,6 @@

    404
    Page Not Found

    - \ No newline at end of file + From fba95ea87269356669a565f0896cb58de5fa2216 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 11:03:55 -0400 Subject: [PATCH 25/37] ci: add manual approval step for Vercel preview deployments - Added manual approval step for pull request deployments - Updated workflow trigger to `pull_request_target` - Ensured deployment proceeds only after approval --- .github/workflows/preview-deployment.yml | 25 +++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-deployment.yml b/.github/workflows/preview-deployment.yml index 772bb9e3..869c2351 100644 --- a/.github/workflows/preview-deployment.yml +++ b/.github/workflows/preview-deployment.yml @@ -1,33 +1,52 @@ name: Vercel Preview Deployment + env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + on: workflow_dispatch: push: branches: - dev - pull_request: # Trigger the workflow on pull request activities + pull_request_target: branches: - dev - main jobs: + approval: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request_target' + steps: + - name: Approve deployment + uses: trstringer/manual-approval@v1 + with: + secret: ${{ secrets.GITHUB_TOKEN }} + approvers: EvanNotFound + minimum-approvals: 1 + issue-title: "Approve preview deployment for PR #${{ github.event.pull_request.number }}" + issue-body: "A preview deployment has been requested for PR #${{ github.event.pull_request.number }}. Please review and approve if it's safe to proceed." + exclude-workflow-initiator-as-approver: false + preview-deployment: + needs: approval + if: always() && (github.event_name != 'pull_request_target' || needs.approval.result == 'success') runs-on: ubuntu-latest + environment: preview steps: - id: script uses: actions/github-script@v7 with: script: | - const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName) + const isPr = [ 'pull_request_target' ].includes(context.eventName) core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref) core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name) - name: Checkout theme repository uses: actions/checkout@v4 with: - path: 'theme' # Checkout the theme repository into a directory named 'theme' + path: 'theme' ref: ${{ steps.script.outputs.ref }} repository: ${{ steps.script.outputs.repo }} From a3c56007edae5d5b4b5043e9aa7acd010cb7dc1c Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 11:23:01 -0400 Subject: [PATCH 26/37] ci: remove manual approval step for preview deployment and update env config --- .github/workflows/preview-deployment.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/preview-deployment.yml b/.github/workflows/preview-deployment.yml index 869c2351..8306a41a 100644 --- a/.github/workflows/preview-deployment.yml +++ b/.github/workflows/preview-deployment.yml @@ -15,31 +15,17 @@ on: - main jobs: - approval: - runs-on: ubuntu-latest - if: github.event_name == 'pull_request_target' - steps: - - name: Approve deployment - uses: trstringer/manual-approval@v1 - with: - secret: ${{ secrets.GITHUB_TOKEN }} - approvers: EvanNotFound - minimum-approvals: 1 - issue-title: "Approve preview deployment for PR #${{ github.event.pull_request.number }}" - issue-body: "A preview deployment has been requested for PR #${{ github.event.pull_request.number }}. Please review and approve if it's safe to proceed." - exclude-workflow-initiator-as-approver: false - preview-deployment: - needs: approval - if: always() && (github.event_name != 'pull_request_target' || needs.approval.result == 'success') runs-on: ubuntu-latest - environment: preview + environment: + name: PR Preview + url: ${{ steps.deploy-to-vercel.outputs.preview-url }} steps: - id: script uses: actions/github-script@v7 with: script: | - const isPr = [ 'pull_request_target' ].includes(context.eventName) + const isPr = ['pull_request_target'].includes(context.eventName) core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref) core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name) @@ -117,6 +103,7 @@ jobs: run: echo "HEXO_SITE_DIR=${{ github.workspace }}/hexo-site" >> $GITHUB_ENV - name: Deploy to Vercel Action + id: deploy-to-vercel uses: EvanNotFound/vercel-deployment-for-github-actions@v1.1.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4e6b616f4ae086553e6361bb6046973500cf49c3 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 11:32:27 -0400 Subject: [PATCH 27/37] chore: add .coderabbit.yaml and update _config.yml preloader setting --- .coderabbit.yaml | 15 +++++++++++++++ _config.yml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..43e301ef --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,15 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +language: "en-US" +early_access: false +reviews: + profile: "chill" + request_changes_workflow: false + high_level_summary: true + poem: false + review_status: true + collapse_walkthrough: true + auto_review: + enabled: true + drafts: false +chat: + auto_reply: true diff --git a/_config.yml b/_config.yml index 765f77fb..b87006e6 100755 --- a/_config.yml +++ b/_config.yml @@ -80,7 +80,7 @@ global: # Whether to enable single page experience (using swup). See https://swup.js.org/. similar to pjax single_page: true # Whether to enable Preloader. - preloader: true + preloader: false # Whether to enable open graph open_graph: true # Google Analytics From e677c97ebd38ad4560c1558cb4aad9ad4d908878 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 12:05:08 -0400 Subject: [PATCH 28/37] feat: enhance preloader configuration and customization #416 - Updated preloader logic to support nested configuration. - Added custom message option for preloader in _config.yml. - Adjusted partials to handle new preloader settings. --- _config.yml | 4 +++- layout/_partials/head.ejs | 2 +- layout/_partials/preloader.ejs | 4 +++- layout/_partials/scripts.ejs | 2 +- layout/page.ejs | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/_config.yml b/_config.yml index b87006e6..4314b246 100755 --- a/_config.yml +++ b/_config.yml @@ -80,7 +80,9 @@ global: # Whether to enable single page experience (using swup). See https://swup.js.org/. similar to pjax single_page: true # Whether to enable Preloader. - preloader: false + preloader: + enable: false + custom_message: # Custom message. If empty, the site title will be displayed # Whether to enable open graph open_graph: true # Google Analytics diff --git a/layout/_partials/head.ejs b/layout/_partials/head.ejs index 4dd92b40..b285e8cc 100755 --- a/layout/_partials/head.ejs +++ b/layout/_partials/head.ejs @@ -111,7 +111,7 @@ <% } %> - <% if (theme.global.preloader) { %> + <% if (theme.global.preloader === true || theme.global.preloader.enable === true) { %> <%- renderJS('js/libs/anime.min.js')%> <% } %> diff --git a/layout/_partials/preloader.ejs b/layout/_partials/preloader.ejs index 8adb276f..10415444 100644 --- a/layout/_partials/preloader.ejs +++ b/layout/_partials/preloader.ejs @@ -67,7 +67,9 @@

    - <%= theme.info.title %> + <%= + theme.global.preloader.custom_message || theme.info.title + %>

    + src="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.8.0/gitalk.min.js">
    `; + data.content += ` + +`; data.excerpt = data.more = config.abstract; return data; @@ -142,7 +148,7 @@ hexo.extend.generator.register("hexo-blog-encrypt", () => [ fs.createReadStream( path.resolve(__dirname, "../../source/js/plugins/hbe.js"), ), - path: "lib/hbe.js", + path: "js/plugins/hbe.js", }, ]); diff --git a/source/js/plugins/hbe.js b/source/js/plugins/hbe.js index 2b6bc4aa..769ff4f2 100755 --- a/source/js/plugins/hbe.js +++ b/source/js/plugins/hbe.js @@ -1,12 +1,13 @@ -(() => { - "use strict"; +import { main } from "../main.js"; +import { initTOC } from "../layouts/toc.js"; +export function initHBE() { const cryptoObj = window.crypto || window.msCrypto; const storage = window.localStorage; const storageName = "hexo-blog-encrypt:#" + window.location.pathname; - const keySalt = textToArray("hexo-blog-encrypt的作者们都是大帅比!"); - const ivSalt = textToArray("hexo-blog-encrypt是地表最强Hexo加密插件!"); + const keySalt = textToArray("too young too simple"); + const ivSalt = textToArray("sometimes naive!"); // As we can't detect the wrong password with AES-CBC, // so adding an empty div and check it when decrption. @@ -235,24 +236,9 @@ } }); - // support theme-next refresh - window.NexT && - NexT.boot && - typeof NexT.boot.refresh === "function" && - NexT.boot.refresh(); - - // TOC part - var tocDiv = document.getElementById("toc-div"); - if (tocDiv) { - tocDiv.style.display = "inline"; - } - - var tocDivs = document.getElementsByClassName("toc-div-class"); - if (tocDivs && tocDivs.length > 0) { - for (var idx = 0; idx < tocDivs.length; idx++) { - tocDivs[idx].style.display = "inline"; - } - } + // // load Redefine Page components + main.refresh(); + initTOC(); // trigger event var event = new Event("hexo-blog-decrypt"); @@ -344,4 +330,6 @@ } hbeLoader(); -})(); +} + +// initHBE(); diff --git a/source/js/tools/imageViewer.js b/source/js/tools/imageViewer.js index f23e91b2..095b1071 100644 --- a/source/js/tools/imageViewer.js +++ b/source/js/tools/imageViewer.js @@ -3,14 +3,27 @@ export default function imageViewer() { let scale = 1; let isMouseDown = false; let dragged = false; - let currentImgIndex = 0; + let currentImgIndex = 0; let lastMouseX = 0; let lastMouseY = 0; let translateX = 0; let translateY = 0; const maskDom = document.querySelector(".image-viewer-container"); + if (!maskDom) { + console.warn( + "Image viewer container not found. Exiting imageViewer function.", + ); + return; + } + const targetImg = maskDom.querySelector("img"); + if (!targetImg) { + console.warn( + "Target image not found in image viewer container. Exiting imageViewer function.", + ); + return; + } const showHandle = (isShow) => { document.body.style.overflow = isShow ? "hidden" : "auto"; @@ -48,7 +61,7 @@ export default function imageViewer() { isMouseDown = true; lastMouseX = event.clientX; lastMouseY = event.clientY; - targetImg.style.cursor = 'grabbing'; + targetImg.style.cursor = "grabbing"; }; let lastTime = 0; @@ -68,7 +81,7 @@ export default function imageViewer() { lastMouseX = event.clientX; lastMouseY = event.clientY; targetImg.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scale})`; - dragged = true; + dragged = true; } }; @@ -77,7 +90,7 @@ export default function imageViewer() { event.stopPropagation(); } isMouseDown = false; - targetImg.style.cursor = 'grab'; + targetImg.style.cursor = "grab"; }; targetImg.addEventListener("wheel", zoomHandle, { passive: false }); @@ -87,7 +100,7 @@ export default function imageViewer() { targetImg.addEventListener("mouseleave", dragEndHandle, { passive: false }); maskDom.addEventListener("click", (event) => { - if (!dragged) { + if (!dragged) { isBigImage = false; showHandle(isBigImage); scale = 1; @@ -95,9 +108,9 @@ export default function imageViewer() { translateY = 0; targetImg.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scale})`; } - dragged = false; + dragged = false; }); - + const imgDoms = document.querySelectorAll( ".markdown-body img, .masonry-item img, #shuoshuo-content img", ); @@ -115,42 +128,43 @@ export default function imageViewer() { } }; - imgDoms.forEach((img, index) => { - img.addEventListener("click", () => { - currentImgIndex = index; - isBigImage = true; - showHandle(isBigImage); - targetImg.src = img.src; - document.addEventListener("keydown", escapeKeyListener); + if (imgDoms.length > 0) { + imgDoms.forEach((img, index) => { + img.addEventListener("click", () => { + currentImgIndex = index; + isBigImage = true; + showHandle(isBigImage); + targetImg.src = img.src; + document.addEventListener("keydown", escapeKeyListener); + }); }); - }); - const handleArrowKeys = (event) => { - if (!isBigImage) return; - - if (event.key === "ArrowUp" || event.key === "ArrowLeft") { - currentImgIndex = (currentImgIndex - 1 + imgDoms.length) % imgDoms.length; - } else if (event.key === "ArrowDown" || event.key === "ArrowRight") { - currentImgIndex = (currentImgIndex + 1) % imgDoms.length; - } else { - return; - } - - const currentImg = imgDoms[currentImgIndex]; - let newSrc = currentImg.src; - - if (currentImg.hasAttribute("lazyload")) { - newSrc = currentImg.getAttribute("data-src"); - currentImg.src = newSrc; - currentImg.removeAttribute("lazyload"); - } + const handleArrowKeys = (event) => { + if (!isBigImage) return; - targetImg.src = newSrc; -}; + if (event.key === "ArrowUp" || event.key === "ArrowLeft") { + currentImgIndex = + (currentImgIndex - 1 + imgDoms.length) % imgDoms.length; + } else if (event.key === "ArrowDown" || event.key === "ArrowRight") { + currentImgIndex = (currentImgIndex + 1) % imgDoms.length; + } else { + return; + } + + const currentImg = imgDoms[currentImgIndex]; + let newSrc = currentImg.src; + + if (currentImg.hasAttribute("lazyload")) { + newSrc = currentImg.getAttribute("data-src"); + currentImg.src = newSrc; + currentImg.removeAttribute("lazyload"); + } - document.addEventListener("keydown", handleArrowKeys); + targetImg.src = newSrc; + }; - if (!imgDoms.length && maskDom) { - maskDom.parentNode.removeChild(maskDom); + document.addEventListener("keydown", handleArrowKeys); + } else { + // console.warn("No images found to attach image viewer functionality."); } } From a041a3de980c7e9ab5dcaae0e6822cd1ab21b25a Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 15:36:03 -0400 Subject: [PATCH 32/37] feat: Add custom title font option for navbar and sidebar #398 - Introduce new configuration for custom title fonts in _config.yml - Implement custom title font loading in head.ejs - Apply custom title font to navbar and sidebar elements - Update documentation comments for clarity --- _config.yml | 7 ++++++- layout/_partials/head.ejs | 4 +++- source/css/layout/_partials/navbar.styl | 3 +++ source/css/layout/home-sidebar.styl | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index 9bf1c1ba..32e88eaf 100755 --- a/_config.yml +++ b/_config.yml @@ -46,7 +46,7 @@ colors: # SITE CUSTOMIZATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start # Docs: https://redefine-docs.ohevan.com/basic/global global: - # Custom fonts + # Custom global fonts fonts: # Chinese fonts chinese: @@ -58,6 +58,11 @@ global: enable: false # Whether to enable custom english fonts family: # Font family url: # Font URL to CSS file + # Custom title fonts (navbar, sidebar) + title: + enable: false # Whether to enable custom title fonts + family: # Font family + url: # Font URL to CSS file # Content max width content_max_width: 1000px # Sidebar width diff --git a/layout/_partials/head.ejs b/layout/_partials/head.ejs index 2ef5a5cb..de7be493 100755 --- a/layout/_partials/head.ejs +++ b/layout/_partials/head.ejs @@ -112,7 +112,9 @@ <% if (theme.global.fonts.english.enable) { %> <% } %> - + <% if (theme.global.fonts.title.enable) { %> + + <% } %> <% if (theme.global.preloader === true || theme.global.preloader.enable === true) { %> <%- renderJS('js/libs/anime.min.js')%> <% } %> diff --git a/source/css/layout/_partials/navbar.styl b/source/css/layout/_partials/navbar.styl index 132dd479..85003d9c 100755 --- a/source/css/layout/_partials/navbar.styl +++ b/source/css/layout/_partials/navbar.styl @@ -73,6 +73,9 @@ $logo-image-box-width = 34px line-height 1 color var(--first-text-color) transform translateY(1px) + if hexo-config('global.fonts.title.enable') { + font-family hexo-config('global.fonts.title.family') + } h1 margin 0 diff --git a/source/css/layout/home-sidebar.styl b/source/css/layout/home-sidebar.styl index 8389479a..7b94dd01 100755 --- a/source/css/layout/home-sidebar.styl +++ b/source/css/layout/home-sidebar.styl @@ -77,6 +77,9 @@ color var(--second-text-color) font-family 'Chillax-Variable', sans-serif text-align center + if hexo-config('global.fonts.title.enable') { + font-family hexo-config('global.fonts.title.family') + } .announcement font-size 0.9rem From 76a35c1a4d09b78e11ba6c4d5542ce999f325662 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 15:46:18 -0400 Subject: [PATCH 33/37] feat: Add configurable excerpt length for home page articles #414 - Introduce new `excerpt_length` option in `_config.yml` - Implement dynamic excerpt truncation based on user-defined length - Default to 200 characters if not specified --- _config.yml | 2 ++ layout/_partials/home-content.ejs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 32e88eaf..6b50479e 100755 --- a/_config.yml +++ b/_config.yml @@ -249,6 +249,8 @@ home: # ...... # you can add more # Article date format article_date_format: auto # auto, relative, YYYY-MM-DD, YYYY-MM-DD HH:mm:ss etc. + # Article excerpt length + excerpt_length: 200 # Max length of article excerpt # Article categories visibility categories: enable: true # Whether to enable diff --git a/layout/_partials/home-content.ejs b/layout/_partials/home-content.ejs index 89591760..a349008e 100755 --- a/layout/_partials/home-content.ejs +++ b/layout/_partials/home-content.ejs @@ -43,7 +43,10 @@ <% } else if (post.excerpt && post.excerpt !== "false") { %> <%- render(post.excerpt, "markdown") %> <% } else { %> - <%- truncate(strip_html(post.content), {length: 300}) %> + <% + const excerptLength = theme.home.excerpt_length || 200; + %> + <%- truncate(strip_html(post.content), {length: excerptLength}) %> <% } %>
    From 2f78b390c75fcf20dbac71c6f87eb0f819995214 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 17:13:00 -0400 Subject: [PATCH 34/37] feat: implement configurable code block highlight themes #380 - Add support for multiple light and dark code block highlight themes - Light: github, atom-one-light, default - Dark: github-dark, monokai-sublime, vs2015, night-owl, atom-one-dark, nord, tokyo-night-dark, a11y-dark, agate - Allow users to select themes via _config.yml - Import theme-specific stylus files based on user configuration - Update code-theme mixin to use new theme variables --- _config.yml | 3 + source/css/common/codeblock/code-theme.styl | 86 ++++++++--------- .../codeblock/hljs-themes/dark/a11y-dark.styl | 18 ++++ .../codeblock/hljs-themes/dark/agate.styl | 18 ++++ .../hljs-themes/dark/atom-one-dark.styl | 18 ++++ .../hljs-themes/dark/github-dark.styl | 18 ++++ .../hljs-themes/dark/monokai-sublime.styl | 18 ++++ .../codeblock/hljs-themes/dark/night-owl.styl | 18 ++++ .../codeblock/hljs-themes/dark/nord.styl | 18 ++++ .../hljs-themes/dark/tokyo-night-dark.styl | 18 ++++ .../codeblock/hljs-themes/dark/vs2015.styl | 18 ++++ .../hljs-themes/light/atom-one-light.styl | 94 +++++++++++++++++++ .../codeblock/hljs-themes/light/default.styl | 18 ++++ .../codeblock/hljs-themes/light/github.styl | 18 ++++ 14 files changed, 335 insertions(+), 46 deletions(-) create mode 100644 source/css/common/codeblock/hljs-themes/dark/a11y-dark.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/agate.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/atom-one-dark.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/github-dark.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/monokai-sublime.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/night-owl.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/nord.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/tokyo-night-dark.styl create mode 100644 source/css/common/codeblock/hljs-themes/dark/vs2015.styl create mode 100644 source/css/common/codeblock/hljs-themes/light/atom-one-light.styl create mode 100644 source/css/common/codeblock/hljs-themes/light/default.styl create mode 100644 source/css/common/codeblock/hljs-themes/light/github.styl diff --git a/_config.yml b/_config.yml index 6b50479e..235f6db0 100755 --- a/_config.yml +++ b/_config.yml @@ -295,6 +295,9 @@ articles: code_block: copy: true # Whether to enable code block copy button style: mac # mac | simple + highlight_theme: # Color scheme for highlightjs code highlighting. For preview, see https://highlightjs.org/examples + light: github # light mode theme, support: github, atom-one-light, default + dark: vs2015 # dark mode theme, support: github-dark, monokai-sublime, vs2015, night-owl, atom-one-dark, nord, tokyo-night-dark, a11y-dark, agate font: # Custom font enable: false # Whether to enable family: # Font family diff --git a/source/css/common/codeblock/code-theme.styl b/source/css/common/codeblock/code-theme.styl index 9c0c263e..22b06461 100755 --- a/source/css/common/codeblock/code-theme.styl +++ b/source/css/common/codeblock/code-theme.styl @@ -1,53 +1,47 @@ @import '../variables.styl' -$code-foreground = lighten($default-text-color, 2%) -$code-background = darken($background-color, 5%) -$highlight-foreground = lighten($default-text-color, 2%) -$highlight-background = #fafafa -$highlight-gutter-color = #373D3F -$highlight-gutter-bg-color = #EEEEEE -$highlight-keyword = #d73a49 -$highlight-link = #d73a49 -$highlight-built-in = #6f42c1 -$highlight-number = #005cc5 -$highlight-string = #032f62 -$highlight-regexp = #e36209 -$highlight-subst = #24292e -$highlight-comment = #6a737d -$highlight-doctag = #22863a -$highlight-variable = #005cc5 -$highlight-attr = #22863a -$highlight-bullet = #6f42c1 -$highlight-addition = #abe338 -$highlight-deletion = #ffa07a -$night-code-foreground = lighten($dark-default-text-color, 2%) -$night-code-background = lighten($dark-background-color, 10%) -$night-highlight-foreground = lighten($dark-default-text-color, 2%) -$night-highlight-background = #21252b -$night-highlight-gutter-color = #bebec6 -$night-highlight-gutter-bg-color = #21252b -$dark-highlight-keyword = #569CD6 -$dark-highlight-link = #569CD6 -$dark-highlight-built-in = #4EC9B0 -$dark-highlight-number = #B8D7A3 -$dark-highlight-string = #D69D85 -$dark-highlight-regexp = #9A5334 -$dark-highlight-subst = #DCDCDC -$dark-highlight-comment = #57A64A -$dark-highlight-doctag = #608B4E -$dark-highlight-meta = #9B9B9B -$dark-highlight-variable = #BD63C5 -$dark-highlight-attr = #9CDCFE -$dark-highlight-section = gold -$dark-highlight-bullet = #D7BA7D -$dark-highlight-addition = #144212 -$dark-highlight-deletion = #600 +if (hexo-config('articles.code_block.highlight_theme.light') == 'github') { + @import 'hljs-themes/light/github.styl' +} else if (hexo-config('articles.code_block.highlight_theme.light') == 'atom-one-light') { + @import 'hljs-themes/light/atom-one-light.styl' +} else if (hexo-config('articles.code_block.highlight_theme.light') == 'default') { + @import 'hljs-themes/light/default.styl' +} else { + @import 'hljs-themes/light/github.styl' +} + +if (hexo-config('articles.code_block.highlight_theme.dark') == 'github-dark') { + @import 'hljs-themes/dark/github-dark.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'vs2015') { + @import 'hljs-themes/dark/vs2015.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'atom-one-dark') { + @import 'hljs-themes/dark/atom-one-dark.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'a11y-dark') { + @import 'hljs-themes/dark/a11y-dark.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'agate') { + @import 'hljs-themes/dark/agate.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'monokai-sublime') { + @import 'hljs-themes/dark/monokai-sublime.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'night-owl') { + @import 'hljs-themes/dark/night-owl.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'nord') { + @import 'hljs-themes/dark/nord.styl' +} else if (hexo-config('articles.code_block.highlight_theme.dark') == 'tokyo-night-dark') { + @import 'hljs-themes/dark/tokyo-night-dark.styl' +} else { + @import 'hljs-themes/dark/github-dark.styl' +} + +$highlight-gutter-color = #6a737d +$highlight-gutter-bg-color = #f6f8fa +$dark-highlight-gutter-color = #8b949e +$dark-highlight-gutter-bg-color = #161b22 code-theme(mode) - --code-foreground: mode == 'light' ? $code-foreground : $night-code-foreground - --code-background: mode == 'light' ? $code-background : $night-code-background - --highlight-background: mode == 'light' ? $highlight-background : $night-highlight-background - --highlight-foreground: mode == 'light' ? $highlight-foreground : $night-highlight-foreground + --code-foreground: mode == 'light' ? $highlight-foreground : $dark-code-foreground + --code-background: mode == 'light' ? $highlight-background : $dark-code-background + --highlight-background: mode == 'light' ? $highlight-background : $dark-highlight-background + --highlight-foreground: mode == 'light' ? $highlight-foreground : $dark-highlight-foreground --highlight-keyword: mode == 'light' ? $highlight-keyword : $dark-highlight-keyword --highlight-link: mode == 'light' ? $highlight-link : $dark-highlight-link --highlight-built-in: mode == 'light' ? $highlight-built-in : $dark-highlight-built-in diff --git a/source/css/common/codeblock/hljs-themes/dark/a11y-dark.styl b/source/css/common/codeblock/hljs-themes/dark/a11y-dark.styl new file mode 100644 index 00000000..bcd607b6 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/a11y-dark.styl @@ -0,0 +1,18 @@ +$highlight-foreground = #f8f8f2 +$highlight-background = #2b2b2b +$highlight-keyword = #dcc6e0 +$highlight-link = #f5ab35 +$highlight-built-in = #f5ab35 +$highlight-number = #f5ab35 +$highlight-string = #abe338 +$highlight-regexp = #ffa07a +$highlight-subst = #f8f8f2 +$highlight-comment = #d4d0ab +$highlight-doctag = #dcc6e0 +$highlight-meta = #f5ab35 +$highlight-variable = #ffa07a +$highlight-attr = #ffd700 +$highlight-section = #00e0e0 +$highlight-bullet = #abe338 +$highlight-addition = #abe338 +$highlight-deletion = #ffa07a \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/agate.styl b/source/css/common/codeblock/hljs-themes/dark/agate.styl new file mode 100644 index 00000000..2fe22435 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/agate.styl @@ -0,0 +1,18 @@ +$highlight-foreground = #fff +$highlight-background = #333 +$highlight-keyword = #fcc28c +$highlight-link = #c6b4f0 +$highlight-built-in = #fcc28c +$highlight-number = #d36363 +$highlight-string = #a2fca2 +$highlight-regexp = #c6b4f0 +$highlight-subst = #fff +$highlight-comment = #888 +$highlight-doctag = #fff +$highlight-meta = #fc9b9b +$highlight-variable = #ade5fc +$highlight-attr = #7bd694 +$highlight-section = #62c8f3 +$highlight-bullet = #b8d8a2 +$highlight-addition = #a2fca2 +$highlight-deletion = #fc9b9b \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/atom-one-dark.styl b/source/css/common/codeblock/hljs-themes/dark/atom-one-dark.styl new file mode 100644 index 00000000..c4fdf510 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/atom-one-dark.styl @@ -0,0 +1,18 @@ +$dark-highlight-foreground = #abb2bf +$dark-highlight-background = #282c34 +$dark-highlight-keyword = #c678dd +$dark-highlight-link = #61aeee +$dark-highlight-built-in = #e6c07b +$dark-highlight-number = #d19a66 +$dark-highlight-string = #98c379 +$dark-highlight-regexp = #98c379 +$dark-highlight-subst = #e06c75 +$dark-highlight-comment = #5c6370 +$dark-highlight-doctag = #c678dd +$dark-highlight-meta = #61aeee +$dark-highlight-variable = #d19a66 +$dark-highlight-attr = #d19a66 +$dark-highlight-section = #e06c75 +$dark-highlight-bullet = #61aeee +$dark-highlight-addition = #98c379 +$dark-highlight-deletion = #e06c75 \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/github-dark.styl b/source/css/common/codeblock/hljs-themes/dark/github-dark.styl new file mode 100644 index 00000000..f6fb35e9 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/github-dark.styl @@ -0,0 +1,18 @@ +$dark-highlight-foreground = #c9d1d9 +$dark-highlight-background = #0d1117 +$dark-highlight-keyword = #ff7b72 +$dark-highlight-link = #ff7b72 +$dark-highlight-built-in = #ffa657 +$dark-highlight-number = #79c0ff +$dark-highlight-string = #a5d6ff +$dark-highlight-regexp = #a5d6ff +$dark-highlight-subst = #c9d1d9 +$dark-highlight-comment = #8b949e +$dark-highlight-doctag = #ff7b72 +$dark-highlight-meta = #79c0ff +$dark-highlight-variable = #79c0ff +$dark-highlight-attr = #79c0ff +$dark-highlight-section = #1f6feb +$dark-highlight-bullet = #f2cc60 +$dark-highlight-addition = #aff5b4 +$dark-highlight-deletion = #ffdcd7 \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/monokai-sublime.styl b/source/css/common/codeblock/hljs-themes/dark/monokai-sublime.styl new file mode 100644 index 00000000..05f11dab --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/monokai-sublime.styl @@ -0,0 +1,18 @@ +$dark-highlight-foreground = #f8f8f2 +$dark-highlight-background = #23241f +$dark-highlight-keyword = #f92672 +$dark-highlight-link = #ae81ff +$dark-highlight-built-in = #e6db74 +$dark-highlight-number = #ae81ff +$dark-highlight-string = #e6db74 +$dark-highlight-regexp = #ae81ff +$dark-highlight-subst = #f8f8f2 +$dark-highlight-comment = #75715e +$dark-highlight-doctag = #f92672 +$dark-highlight-meta = #75715e +$dark-highlight-variable = #e6db74 +$dark-highlight-attr = #f92672 +$dark-highlight-section = #a6e22e +$dark-highlight-bullet = #ae81ff +$dark-highlight-addition = #e6db74 +$dark-highlight-deletion = #75715e \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/night-owl.styl b/source/css/common/codeblock/hljs-themes/dark/night-owl.styl new file mode 100644 index 00000000..68666fb8 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/night-owl.styl @@ -0,0 +1,18 @@ +$highlight-foreground = #d6deeb +$highlight-background = #011627 +$highlight-keyword = #c792ea +$highlight-link = #ff869a +$highlight-built-in = #addb67 +$highlight-number = #F78C6C +$highlight-string = #ecc48d +$highlight-regexp = #5ca7e4 +$highlight-subst = #d3423e +$highlight-comment = #637777 +$highlight-doctag = #7fdbca +$highlight-meta = #82aaff +$highlight-variable = #addb67 +$highlight-attr = #7fdbca +$highlight-section = #82b1ff +$highlight-bullet = #d9f5dd +$highlight-addition = #addb67ff +$highlight-deletion = #EF535090 \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/nord.styl b/source/css/common/codeblock/hljs-themes/dark/nord.styl new file mode 100644 index 00000000..f793e054 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/nord.styl @@ -0,0 +1,18 @@ +$dark-highlight-foreground = #D8DEE9 +$dark-highlight-background = #2E3440 +$dark-highlight-keyword = #81A1C1 +$dark-highlight-link = #81A1C1 +$dark-highlight-built-in = #8FBCBB +$dark-highlight-number = #B48EAD +$dark-highlight-string = #A3BE8C +$dark-highlight-regexp = #EBCB8B +$dark-highlight-subst = #D8DEE9 +$dark-highlight-comment = #4C566A +$dark-highlight-doctag = #8FBCBB +$dark-highlight-meta = #5E81AC +$dark-highlight-variable = #D8DEE9 +$dark-highlight-attr = #8FBCBB +$dark-highlight-section = #88C0D0 +$dark-highlight-bullet = #81A1C1 +$dark-highlight-addition = rgba(163, 190, 140, 0.5) +$dark-highlight-deletion = rgba(191, 97, 106, 0.5) \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/tokyo-night-dark.styl b/source/css/common/codeblock/hljs-themes/dark/tokyo-night-dark.styl new file mode 100644 index 00000000..3397b26c --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/tokyo-night-dark.styl @@ -0,0 +1,18 @@ +$highlight-foreground = #9aa5ce +$highlight-background = #1a1b26 +$highlight-keyword = #bb9af7 +$highlight-link = #ff9e64 +$highlight-built-in = #e0af68 +$highlight-number = #ff9e64 +$highlight-string = #9ece6a +$highlight-regexp = #f7768e +$highlight-subst = #7dcfff +$highlight-comment = #565f89 +$highlight-doctag = #f7768e +$highlight-meta = #565f89 +$highlight-variable = #ff9e64 +$highlight-attr = #bb9af7 +$highlight-section = #7aa2f7 +$highlight-bullet = #9ece6a +$highlight-addition = #9ece6a +$highlight-deletion = #f7768e \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/dark/vs2015.styl b/source/css/common/codeblock/hljs-themes/dark/vs2015.styl new file mode 100644 index 00000000..e5620d76 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/dark/vs2015.styl @@ -0,0 +1,18 @@ +$dark-highlight-foreground = #DCDCDC +$dark-highlight-background = #1E1E1E +$dark-highlight-keyword = #569CD6 +$dark-highlight-link = #569CD6 +$dark-highlight-built-in = #4EC9B0 +$dark-highlight-number = #B8D7A3 +$dark-highlight-string = #D69D85 +$dark-highlight-regexp = #9A5334 +$dark-highlight-subst = #DCDCDC +$dark-highlight-comment = #57A64A +$dark-highlight-doctag = #608B4E +$dark-highlight-meta = #9B9B9B +$dark-highlight-variable = #BD63C5 +$dark-highlight-attr = #9CDCFE +$dark-highlight-section = gold +$dark-highlight-bullet = #D7BA7D +$dark-highlight-addition = #144212 +$dark-highlight-deletion = #600 \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl b/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl new file mode 100644 index 00000000..a0949114 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl @@ -0,0 +1,94 @@ +/* + +Atom One Light by Daniel Gamage +Original One Light Syntax theme from https://github.com/atom/one-light-syntax + +base: #fafafa +mono-1: #383a42 +mono-2: #686b77 +mono-3: #a0a1a7 +hue-1: #0184bb +hue-2: #4078f2 +hue-3: #a626a4 +hue-4: #50a14f +hue-5: #e45649 +hue-5-2: #c91243 +hue-6: #986801 +hue-6-2: #c18401 + +*/ + +.hljs { + color: #383a42; + background: #fafafa; +} + +.hljs-comment, +.hljs-quote { + color: #a0a1a7; + font-style: italic; +} + +.hljs-doctag, +.hljs-keyword, +.hljs-formula { + color: #a626a4; +} + +.hljs-section, +.hljs-name, +.hljs-selector-tag, +.hljs-deletion, +.hljs-subst { + color: #e45649; +} + +.hljs-literal { + color: #0184bb; +} + +.hljs-string, +.hljs-regexp, +.hljs-addition, +.hljs-attribute, +.hljs-meta .hljs-string { + color: #50a14f; +} + +.hljs-attr, +.hljs-variable, +.hljs-template-variable, +.hljs-type, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-number { + color: #986801; +} + +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-meta, +.hljs-selector-id, +.hljs-title { + color: #4078f2; +} + +.hljs-built_in, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #c18401; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link { + text-decoration: underline; +} \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/light/default.styl b/source/css/common/codeblock/hljs-themes/light/default.styl new file mode 100644 index 00000000..1f30c173 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/light/default.styl @@ -0,0 +1,18 @@ +$highlight-foreground = #444 +$highlight-background = #F3F3F3 +$highlight-keyword = #444 +$highlight-link = #ab5656 +$highlight-built-in = #397300 +$highlight-number = #880000 +$highlight-string = #880000 +$highlight-regexp = #ab5656 +$highlight-subst = #444 +$highlight-comment = #697070 +$highlight-doctag = #444 +$highlight-meta = #1f7199 +$highlight-variable = #ab5656 +$highlight-attr = #444 +$highlight-section = #880000 +$highlight-bullet = #397300 +$highlight-addition = #397300 +$highlight-deletion = #880000 \ No newline at end of file diff --git a/source/css/common/codeblock/hljs-themes/light/github.styl b/source/css/common/codeblock/hljs-themes/light/github.styl new file mode 100644 index 00000000..db36afa9 --- /dev/null +++ b/source/css/common/codeblock/hljs-themes/light/github.styl @@ -0,0 +1,18 @@ +$highlight-foreground = #24292e +$highlight-background = #fdfdfd +$highlight-keyword = #d73a49 +$highlight-link = #d73a49 /* Following the pattern, link should have the same color as keyword */ +$highlight-built-in = #e36209 +$highlight-number = #005cc5 +$highlight-string = #032f62 +$highlight-regexp = #032f62 +$highlight-subst = #24292e +$highlight-comment = #6a737d +$highlight-doctag = #d73a49 +$highlight-meta = #005cc5 /* Mapped based on the pattern for constant */ +$highlight-variable = #005cc5 +$highlight-attr = #005cc5 +$highlight-section = #005cc5 +$highlight-bullet = #735c0f +$highlight-addition = #22863a +$highlight-deletion = #b31d28 \ No newline at end of file From e3f73d3d061e4710e57ecaf32dfc4b54de5c01ab Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 17:15:26 -0400 Subject: [PATCH 35/37] refactor: Convert atom-one-light theme to Stylus variables - Replace CSS rules with Stylus variables for easier customization - Simplify code structure by removing redundant selectors and comments - Maintain original color scheme for consistency --- .../hljs-themes/light/atom-one-light.styl | 112 +++--------------- 1 file changed, 18 insertions(+), 94 deletions(-) diff --git a/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl b/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl index a0949114..088adf9c 100644 --- a/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl +++ b/source/css/common/codeblock/hljs-themes/light/atom-one-light.styl @@ -1,94 +1,18 @@ -/* - -Atom One Light by Daniel Gamage -Original One Light Syntax theme from https://github.com/atom/one-light-syntax - -base: #fafafa -mono-1: #383a42 -mono-2: #686b77 -mono-3: #a0a1a7 -hue-1: #0184bb -hue-2: #4078f2 -hue-3: #a626a4 -hue-4: #50a14f -hue-5: #e45649 -hue-5-2: #c91243 -hue-6: #986801 -hue-6-2: #c18401 - -*/ - -.hljs { - color: #383a42; - background: #fafafa; -} - -.hljs-comment, -.hljs-quote { - color: #a0a1a7; - font-style: italic; -} - -.hljs-doctag, -.hljs-keyword, -.hljs-formula { - color: #a626a4; -} - -.hljs-section, -.hljs-name, -.hljs-selector-tag, -.hljs-deletion, -.hljs-subst { - color: #e45649; -} - -.hljs-literal { - color: #0184bb; -} - -.hljs-string, -.hljs-regexp, -.hljs-addition, -.hljs-attribute, -.hljs-meta .hljs-string { - color: #50a14f; -} - -.hljs-attr, -.hljs-variable, -.hljs-template-variable, -.hljs-type, -.hljs-selector-class, -.hljs-selector-attr, -.hljs-selector-pseudo, -.hljs-number { - color: #986801; -} - -.hljs-symbol, -.hljs-bullet, -.hljs-link, -.hljs-meta, -.hljs-selector-id, -.hljs-title { - color: #4078f2; -} - -.hljs-built_in, -.hljs-title.class_, -.hljs-class .hljs-title { - color: #c18401; -} - -.hljs-emphasis { - font-style: italic; -} - -.hljs-strong { - font-weight: bold; -} - -.hljs-link { - text-decoration: underline; -} \ No newline at end of file +$highlight-foreground = #383a42 +$highlight-background = #fafafa +$highlight-keyword = #a626a4 +$highlight-link = #4078f2 +$highlight-built-in = #c18401 +$highlight-number = #986801 +$highlight-string = #50a14f +$highlight-regexp = #50a14f +$highlight-subst = #e45649 +$highlight-comment = #a0a1a7 +$highlight-doctag = #a626a4 +$highlight-meta = #4078f2 +$highlight-variable = #986801 +$highlight-attr = #986801 +$highlight-section = #e45649 +$highlight-bullet = #4078f2 +$highlight-addition = #50a14f +$highlight-deletion = #e45649 \ No newline at end of file From 2143135955a58e8de5c0596b5003fc0707468e1b Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 17:23:11 -0400 Subject: [PATCH 36/37] chore: bump version to 2.7.0 - Update package.json to increment version from 2.6.4 to 2.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a32f45fb..6f65aa9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-redefine", - "version": "2.6.4", + "version": "2.7.0", "private": false, "description": "Redefine your writing with Hexo Theme Redefine.", "scripts": { From 0a1c561f287fa91753673400f30bad408a1f4e41 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 31 Aug 2024 17:23:37 -0400 Subject: [PATCH 37/37] chore: bump version to 2.7.0 - Update package-lock.json with new version number - Increment version from 2.6.4 to 2.7.0 --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 110aad19..0211e462 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hexo-theme-redefine", - "version": "2.6.4", + "version": "2.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hexo-theme-redefine", - "version": "2.6.4", + "version": "2.7.0", "license": "AGPL-3.0", "dependencies": { "postcss": "^8.4.28"