<% if (is_home()) { %> - <%- partial('home-content') %> + <%- partial('_page/home') %> <% } else if (is_archive()) { %> - <%- partial('archive-content') %> + <%- partial('_page/archive') %> <% } else if (is_post()) { %> - <%- partial('post-content') %> + <%- partial('_page/post') %> <% } else if (is_category()) { %> - <%- partial('category-content') %> + <%- partial('_page/category-archive') %> <% } else if (is_tag()) { %> - <%- partial('tag-content') %> + <%- partial('_page/tag-archive') %> <% } else if (page_title === 'category' || page_title === 'categories') { %> - <%- partial('category-list') %> + <%- partial('_page/category') %> <% } else if (page_title === 'tag' || page_title === 'tags') { %> - <%- partial('_partial/tagcloud') %> + <%- partial('_page/tag') %> <% } else if (page_type === '404') { %> - <%- partial('404') %> + <%- partial('_page/404') %> <% } else { %> diff --git a/layout/tag.ejs b/layout/tag.ejs deleted file mode 100644 index da62077cc..000000000 --- a/layout/tag.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('page') %> \ No newline at end of file diff --git a/layout/tags.ejs b/layout/tags.ejs deleted file mode 100644 index da62077cc..000000000 --- a/layout/tags.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('page') %> \ No newline at end of file diff --git a/source/css/layout/404.styl b/source/css/layout/_page/404.styl similarity index 100% rename from source/css/layout/404.styl rename to source/css/layout/_page/404.styl diff --git a/source/css/layout/archive-content.styl b/source/css/layout/_page/archive.styl similarity index 100% rename from source/css/layout/archive-content.styl rename to source/css/layout/_page/archive.styl diff --git a/source/css/layout/category-content.styl b/source/css/layout/_page/category-archive.styl similarity index 93% rename from source/css/layout/category-content.styl rename to source/css/layout/_page/category-archive.styl index 8e321922b..48c5275a7 100644 --- a/source/css/layout/category-content.styl +++ b/source/css/layout/_page/category-archive.styl @@ -1,6 +1,6 @@ $category-name-font-size = 1.5rem -.category-container { +.category-archive-container { keep-container(1, 2rem, 2rem) diff --git a/source/css/layout/category-list.styl b/source/css/layout/_page/category.styl similarity index 98% rename from source/css/layout/category-list.styl rename to source/css/layout/_page/category.styl index 468fcb241..73dd9c7f4 100644 --- a/source/css/layout/category-list.styl +++ b/source/css/layout/_page/category.styl @@ -1,7 +1,7 @@ $left-gap = 1.6rem $spacing-padding = 0.6rem -.category-list-container { +.category-page-container { keep-container(1, 2rem, 0) diff --git a/source/css/layout/home-content.styl b/source/css/layout/_page/home.styl similarity index 100% rename from source/css/layout/home-content.styl rename to source/css/layout/_page/home.styl diff --git a/source/css/layout/post-content.styl b/source/css/layout/_page/post.styl similarity index 99% rename from source/css/layout/post-content.styl rename to source/css/layout/_page/post.styl index 258e884df..f463a28b2 100644 --- a/source/css/layout/post-content.styl +++ b/source/css/layout/_page/post.styl @@ -1,4 +1,4 @@ -@import "../common/stylus-variables.styl" +@import "../../common/stylus-variables.styl" $avatar-width = 3.2rem $arrow-icon-width = 1rem diff --git a/source/css/layout/tag-content.styl b/source/css/layout/_page/tag-archive.styl similarity index 94% rename from source/css/layout/tag-content.styl rename to source/css/layout/_page/tag-archive.styl index 58f77fda2..2e710164e 100644 --- a/source/css/layout/tag-content.styl +++ b/source/css/layout/_page/tag-archive.styl @@ -1,6 +1,6 @@ $tag-name-font-size = 1.5rem -.tag-container { +.tag-archive-container { keep-container(1, 2rem, 2rem) diff --git a/source/css/layout/_partial/tagcloud.styl b/source/css/layout/_page/tag.styl similarity index 89% rename from source/css/layout/_partial/tagcloud.styl rename to source/css/layout/_page/tag.styl index ff9cdaf56..13a660ec0 100644 --- a/source/css/layout/_partial/tagcloud.styl +++ b/source/css/layout/_page/tag.styl @@ -1,4 +1,4 @@ -.tagcloud-container { +.tag-page-container { keep-container(1, 2rem, 0) diff --git a/source/css/style.styl b/source/css/style.styl index 6d16778b0..3636f0539 100644 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -19,20 +19,20 @@ @import "layout/_partial/paginator.styl" @import "layout/_partial/first-screen.styl" @import "layout/_partial/image-mask.styl" -@import "layout/category-list.styl" @import "layout/_partial/post-meta-info.styl" @import "layout/_partial/post/post-copyright-info.styl" -@import "layout/home-content.styl" -@import "layout/archive-content.styl" -@import "layout/post-content.styl" -@import "layout/category-content.styl" -@import "layout/tag-content.styl" -@import "layout/404.styl" +@import "layout/_page/home.styl" +@import "layout/_page/archive.styl" +@import "layout/_page/post.styl" +@import "layout/_page/category.styl" +@import "layout/_page/category-archive.styl" +@import "layout/_page/tag.styl" +@import "layout/_page/tag-archive.styl" +@import "layout/_page/404.styl" @import "layout/_template/page-template.styl" @import "layout/_template/friends-link.styl" @import "layout/_template/photo-album.styl" @import "layout/_template/tools-nav.styl" -@import "layout/_partial/tagcloud.styl" @import "layout/_partial/common/empty-content.styl" @import "layout/_partial/post/post-share.styl" @import "layout/_partial/post/reward-author.styl" From 2d6bfb6be7321dfcbf862d355e5e6564939d5dd2 Mon Sep 17 00:00:00 2001 From: XPoet Date: Mon, 13 May 2024 21:32:40 +0800 Subject: [PATCH 2/8] ui: add display format to tag page (#303) --- layout/_page/tag.ejs | 22 +++++++++++------- source/css/layout/_page/tag.styl | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/layout/_page/tag.ejs b/layout/_page/tag.ejs index f3c692ef5..13d4a0441 100644 --- a/layout/_page/tag.ejs +++ b/layout/_page/tag.ejs @@ -1,14 +1,20 @@
<% if (site.tags.length){ %> -
- <%- tagcloud({ - min_font: 1, - max_font: 1.6, - unit: 'rem', - amount: 100 - }) %> -
+ <% if (page?.tag_cloud === false){ %> +
+ <%- list_tags() %> +
+ <% } else { %> +
+ <%- tagcloud({ + min_font: 1, + max_font: 1.6, + unit: 'rem', + amount: 100 + }) %> +
+ <% } %> <% } else { %> <%- partial('_partial/common/empty-content') %> <% } %> diff --git a/source/css/layout/_page/tag.styl b/source/css/layout/_page/tag.styl index 13a660ec0..479890c2f 100644 --- a/source/css/layout/_page/tag.styl +++ b/source/css/layout/_page/tag.styl @@ -12,4 +12,43 @@ padding 0.68rem 0.5rem } } + + + .tag-list-content { + .tag-list { + position relative + display flex + flex-wrap wrap + gap 0.82rem + justify-content flex-start + box-sizing border-box + + .tag-list-item { + position relative + box-sizing border-box + overflow hidden + border-radius 0.3rem + + + .tag-list-link { + display inline-block + padding 0.4rem 0.6rem + color var(--text-color-3) + background var(--background-color-2) + + &:hover { + color var(--primary-color) + } + } + + + .tag-list-count { + display inline-block + padding 0.4rem 0.6rem + color var(--text-color-3) + background var(--background-color-3) + } + } + } + } } From c2c92322814a926464fb74197a7e6f86c8f28b37 Mon Sep 17 00:00:00 2001 From: XPoet Date: Tue, 14 May 2024 15:18:04 +0800 Subject: [PATCH 3/8] refactor(footer): support fill in more record information (#316) --- _config.yml | 24 ++-- layout/_partial/footer.ejs | 162 ++++++++--------------- source/css/layout/_partial/footer.styl | 170 +++++++------------------ source/js/main.js | 2 - source/js/utils.js | 4 +- 5 files changed, 111 insertions(+), 251 deletions(-) diff --git a/_config.yml b/_config.yml index e06b46a2d..4d6b86c1e 100644 --- a/_config.yml +++ b/_config.yml @@ -309,30 +309,22 @@ pjax: # Docs: https://keep-docs.xpoet.cn/basis/configuration-guide/footer.html # --------------------------------------------------------------------------------------- footer: - since: 2020 # The starting year of your website, Can be null - word_count: false # Option values: true | false - - icp: - enable: false # Option values: true | false - record_code: # ICP record code of your website - url: https://beian.miit.gov.cn # Your ICP link url, Can be null + since: 2020 # The starting year of your website, Can be null + word_count: false # Option values: true | false site_deploy: enable: false # Option values: true | false provider: github # Option values: github | vercel | netlify | cloudflare | gitee | aliyun | tencent_cloud | upyun url: # Your deployment provider url, Can be null - # When the footer style is shields, you can customize the shields configuration - # See: https://shields.io - shields_style: + record: enable: false # Option values: true | false - custom: - - link_url: # Your link url, Can be null - img_url: # Shields image url + list: + - code: # record code of your website + link: # record link of your website, Can be null # e.g. - # - link_url: https://github.com/XPoet/hexo-theme-keep - # img_url: https://img.shields.io/badge/Hexo-Keep%20v3.7.3-blue?style=flat-square&logo=hexo - # - ... + # - code: ICP 001 + # - link: https://beian.miit.gov.cn # --------------------------------------------------------------------------------------- diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs index f77030ae3..580b49901 100644 --- a/layout/_partial/footer.ejs +++ b/layout/_partial/footer.ejs @@ -1,136 +1,86 @@ <% const { since: f_since, - icp: f_icp, + record: f_record, site_deploy: f_site_deploy } = theme?.footer || {} const { author: bi_author } = theme?.base_info || {} const { author: hexo_author } = config const { site_uv: bsz_site_uv, site_pv: bsz_site_pv, enable: bsz_enable } = theme?.website_count?.busuanzi_count || {} -const footer_style_type = theme.footer?.shields_style?.enable === true ? 'shields' : 'default' -const shields_style = 'flat-square' -const shields_color_list = ['dodgerblue', 'dodgerblue', 'dodgerblue', 'dodgerblue', 'dodgerblue', 'dodgerblue'] const web_master = bi_author || hexo_author %>
-
diff --git a/source/css/layout/_partial/footer.styl b/source/css/layout/_partial/footer.styl index 3eea1fd7b..3588311aa 100644 --- a/source/css/layout/_partial/footer.styl +++ b/source/css/layout/_partial/footer.styl @@ -1,6 +1,10 @@ $shields-style-height = 22px .footer { + display flex + flex-direction column + align-items center + justify-content center padding 1rem 0 color var(--text-color-4) font-size 1rem @@ -18,160 +22,76 @@ $shields-style-height = 22px } - .website-info-box { + .info-item { + position relative display flex - flex-direction column + flex-wrap wrap align-items center justify-content center + box-sizing border-box + margin 0.2rem 0 + color var(--text-color-4) + &.count-info { + display flex - &.shields { - padding 0 1rem - - img { - height $shields-style-height !important + .count-item { + &.uv + &.pv { + display none + } } + } - a { - position relative - display inline-flex - box-sizing border-box - text-decoration none - } + &.deploy-info { + display flex - .shields-item - .count-box { - margin 0.3rem 0.2rem - user-select none + a + .tooltip { + display flex + align-items center } - } - - +keep-mobile() { - &.shields { - .shields-item - .count-box { - margin 0.12rem -0.3rem - transform scale(0.9) - transform-origin center center - } + img { + height 1.08rem + margin 0 0.4rem } } - .info-item { - position relative - display flex - flex-wrap wrap - align-items center - justify-content center - box-sizing border-box - color var(--text-color-4) - - - &.shields { - .count-box { - display flex - justify-content flex-start - height $shields-style-height - color #f2f2f2 - font-size 12.6px - - - .item-type - .item-value { - display flex - align-items center - height 100% - padding 0 6px - } - - - .item-type { - margin-right 0 - background #555555 - } + &.count-info + &.record-info { - .item-value { + .count-item + .record-item { + margin-right 15px - &.uv { - background coral - } - - &.pv { - background orange - } - - &.word { - background indianred - } - } + &::before { + position absolute + top 50% + left -10px + box-sizing border-box + transform translateY(-56%) + content '|' } - } - - &.default { - margin 0.2rem 0 - - .count-box { - margin-right 15px + &:first-child { &::before { - position absolute - top 50% - left -10px - box-sizing border-box - transform translateY(-55%) - content '|' - } - - - &:first-child { - &::before { - display none - } - } - - - &:last-child { - margin-right 0 - } - - - .item-type { - margin-right 4px - } - } - } - - - &.count-item { - display flex - - .count-box { - &.uv - &.pv { display none } } - } - - &.deploy-info { - display flex - - a - .tooltip { - display flex - align-items center + &:last-child { + margin-right 0 } - img { - height 1.08rem - margin 0 0.4rem + + .item-type { + margin-right 4px } } } diff --git a/source/js/main.js b/source/js/main.js index ea15ab3d0..a0a8abd71 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -29,8 +29,6 @@ window.addEventListener('DOMContentLoaded', () => { KEEP.setFooterVersion = () => { const vd = document.querySelector('.footer .keep-version') vd && (vd.innerHTML = KEEP.themeInfo.theme) - const vd2 = document.querySelector('.footer .shields-keep-version') - vd2 && (vd2.src = vd2.src.replace('Keep', KEEP.themeInfo.theme)) } // set styleStatus to localStorage diff --git a/source/js/utils.js b/source/js/utils.js index 7e4e4eca3..dda1571e5 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -545,8 +545,8 @@ KEEP.initUtils = () => { getText('#busuanzi_value_site_pv') || getText('#busuanzi_value_page_pv') ) { - const tmpDom1 = document.querySelector('.footer .count-item .uv') - const tmpDom2 = document.querySelector('.footer .count-item .pv') + const tmpDom1 = document.querySelector('.footer .count-info .uv') + const tmpDom2 = document.querySelector('.footer .count-info .pv') const tmpDom3 = document.querySelector('.post-meta-info .post-pv') tmpDom1 && (tmpDom1.style.display = 'flex') tmpDom2 && (tmpDom2.style.display = 'flex') From 414592613f79ffe10f2f392d5abf3a7c57cef399 Mon Sep 17 00:00:00 2001 From: XPoet Date: Tue, 14 May 2024 18:00:43 +0800 Subject: [PATCH 4/8] perf(comment): support Waline v3 (#322) --- layout/_partial/comment/plugins/waline.ejs | 98 +++++++++++++------ .../css/layout/_partial/comment/waline.styl | 4 + 2 files changed, 71 insertions(+), 31 deletions(-) diff --git a/layout/_partial/comment/plugins/waline.ejs b/layout/_partial/comment/plugins/waline.ejs index cff40d3d8..f376d9a3a 100644 --- a/layout/_partial/comment/plugins/waline.ejs +++ b/layout/_partial/comment/plugins/waline.ejs @@ -6,10 +6,15 @@ let { reaction: waline_reaction, options: waline_options = {} } = theme?.comment?.waline || {} + if (!waline_version) { waline_version = '2' } + +const esm_load = String(waline_version) === '3' + let cdn_css = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline.css` let cdn_css_meta = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline-meta.css` let cdn_js = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline.js` + const { enable: t_cdn_enable, provider: t_cdn_provider } = theme?.cdn || {} if (t_cdn_enable === true) { @@ -33,40 +38,71 @@ if (t_cdn_enable === true) {
- - - window.KeepCommentPlugin.initWaline = () => { - if (window?.Waline) { - window.KeepCommentPlugin.walineOptions.el = '#waline-comment' - window.KeepCommentPlugin.walineOptions.comment = '.post-comments-count' - window.KeepCommentPlugin.walineOptions.serverURL = '<%= waline_env_server_url %>' - window.KeepCommentPlugin.walineOptions.lang = '<%= config.language %>' || 'zh-CN' - window.KeepCommentPlugin.walineOptions.reaction = '<%= waline_reaction %>' === 'true' - window.Waline.init(window.KeepCommentPlugin.walineOptions) - window.KeepCommentPlugin.hideLoading() - } else { - setTimeout(() => { - window.KeepCommentPlugin.initWaline() - }, 1000) - } - } + <% if (!esm_load) { %> + + + if ('<%= pjax_enable %>' === 'true') { + setTimeout(() => { + window.KeepCommentPlugin.initWaline() + }, 1200) + } else { + window.addEventListener('DOMContentLoaded', window.KeepCommentPlugin.initWaline) + } + + <% } %> + + <% if (esm_load) { %> + + <% } %>
<% } else { %> <%- partial('../config-error', { comment_plugin: 'Waline' }) %> diff --git a/source/css/layout/_partial/comment/waline.styl b/source/css/layout/_partial/comment/waline.styl index 9bf73fa15..4be72abcc 100644 --- a/source/css/layout/_partial/comment/waline.styl +++ b/source/css/layout/_partial/comment/waline.styl @@ -4,11 +4,15 @@ --waline-active-color var(--primary-color-light-1) --waline-color var(--text-color-3) --waline-bgcolor var(--background-color-1) + --waline-bg-color var(--background-color-1) --waline-border-color var(--border-color) --waline-disable-bgcolor var(--background-color-2) + --waline-disable-bg-color var(--background-color-2) --waline-disable-color var(--text-color-3) --waline-code-bgcolor rgba(40, 44, 52, 0.9) + --waline-code-bg-color rgba(40, 44, 52, 0.9) --waline-info-bgcolor var(--background-color-3) + --waline-info-bg-color var(--background-color-3) --waline-info-color var(--text-color-3) --waline-border 1px solid var(--waline-border-color) --waline-dark-grey var(--text-color-3) From 1529ba0068888e64eba536476bce009ef4cd2279 Mon Sep 17 00:00:00 2001 From: XPoet Date: Tue, 14 May 2024 21:39:43 +0800 Subject: [PATCH 5/8] perf(toc): support encrypted article display toc (#323) --- layout/_partial/toc.ejs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/layout/_partial/toc.ejs b/layout/_partial/toc.ejs index 9b5ab63c8..b1bba7a1c 100644 --- a/layout/_partial/toc.ejs +++ b/layout/_partial/toc.ejs @@ -1,11 +1,12 @@
+ <%- toc( - page.content, - { - class: 'nav', - list_number: theme?.toc?.number || false - } + page?.encrypt === true ? page.origin : page.content, + { + class: 'nav', + list_number: theme?.toc?.number || false + } ) %>
From 43cd77bfe7309c8848edf0da146a7194a615ab9e Mon Sep 17 00:00:00 2001 From: XPoet Date: Tue, 14 May 2024 22:04:01 +0800 Subject: [PATCH 6/8] ui: optimize markdown style --- source/css/common/markdown.styl | 70 ++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/source/css/common/markdown.styl b/source/css/common/markdown.styl index 07ede3043..ff245f053 100644 --- a/source/css/common/markdown.styl +++ b/source/css/common/markdown.styl @@ -153,32 +153,41 @@ h5 h6 { position relative + display flex + justify-content space-between + order 0 box-sizing border-box padding-top 0.4rem padding-bottom 0.2rem overflow hidden color var(--text-color-2) - line-height 1.5 - white-space nowrap - text-overflow ellipsis + line-height 1.6 border-bottom 1px solid var(--post-h-bottom-border-color) + +keep-tablet() { - line-height 1.25 + line-height 1.4 + } + + + +keep-mobile() { + line-height 1.3 } + &:hover { a.headerlink { visibility visible } } + a.headerlink { position relative - float right + order 1 box-sizing border-box - margin-left 0.32rem - padding-top 0.25rem + margin-left 0.4rem + padding-top 0.2rem color var(--text-color-4) font-size 1.2rem text-decoration none @@ -190,6 +199,7 @@ color var(--text-color-3) } + &::before { font-weight 600 font-family 'Font Awesome 6 Free' @@ -204,7 +214,11 @@ font-size 1.8rem +keep-tablet() { - font-size 1.7rem + font-size 1.6rem + } + + +keep-mobile() { + line-height 1.5rem } } @@ -214,7 +228,11 @@ font-size 1.7rem +keep-tablet() { - font-size 1.6rem + font-size 1.5rem + } + + +keep-mobile() { + line-height 1.4rem } } @@ -224,27 +242,47 @@ font-size 1.6rem +keep-tablet() { - font-size 1.5rem + font-size 1.4rem + } + + +keep-mobile() { + line-height 1.3rem } } h4 { font-weight 550 - font-size 1.5rem + font-size 1.4rem +keep-tablet() { - font-size 1.4rem + font-size 1.2rem + } + + +keep-mobile() { + line-height 1.1rem + } + + a.headerlink { + font-size 1.1rem } } h5 { font-weight 500 - font-size 1.28rem + font-size 1.3rem +keep-tablet() { - font-size 1.18rem + font-size 1.2rem + } + + +keep-mobile() { + line-height 1.1rem + } + + a.headerlink { + font-size 1.1rem } } @@ -258,6 +296,10 @@ font-size 1.1rem line-height 1.1 } + + a.headerlink { + font-size 1rem + } } From c8140e6797208e1cc7f9bea10d928ec666dde9e5 Mon Sep 17 00:00:00 2001 From: XPoet Date: Tue, 14 May 2024 22:06:53 +0800 Subject: [PATCH 7/8] ci: update ISSUE_TEMPLATE --- .github/ISSUE_TEMPLATE/bug-report.yml | 4 ++-- .github/ISSUE_TEMPLATE/feature-request.yml | 2 +- .github/ISSUE_TEMPLATE/other.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index eceb7c5fd..1e2594e53 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -20,7 +20,7 @@ body: I made sure I checked 我确认我已经检查过了 options: - - label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本) + - label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本) required: true - label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn)) required: true @@ -31,7 +31,7 @@ body: id: expected-behavior attributes: label: Expected behavior | 预期行为 - description: | + description: | Please provide a detailed description of what you consider expected behavior. 请仔细描述你认为的预期行为 validations: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index a8512df03..3f29665e8 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -20,7 +20,7 @@ body: I made sure I checked 我确认我已经检查过了 options: - - label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本) + - label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本) required: true - label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn)) required: true diff --git a/.github/ISSUE_TEMPLATE/other.yml b/.github/ISSUE_TEMPLATE/other.yml index 4a5dca70f..09aa35d14 100644 --- a/.github/ISSUE_TEMPLATE/other.yml +++ b/.github/ISSUE_TEMPLATE/other.yml @@ -20,7 +20,7 @@ body: I made sure I checked 我确认我已经检查过了 options: - - label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本) + - label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本) required: true - label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn)) required: true From 1c2895bec72fdb9f1f1b6e1828514b362b8e2b47 Mon Sep 17 00:00:00 2001 From: XPoet Date: Wed, 15 May 2024 09:53:35 +0800 Subject: [PATCH 8/8] perf(comment): optimize version matching of waline --- _config.yml | 2 +- layout/_partial/comment/plugins/waline.ejs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/_config.yml b/_config.yml index 4d6b86c1e..c3fda5b6a 100644 --- a/_config.yml +++ b/_config.yml @@ -249,7 +249,7 @@ comment: waline: server_url: # Server URL reaction: false # Post reactions, Option values: true | false - version: 2 # Waline version, default use v2 + version: 3 # Waline version, default use v3 # Giscus # See: https://github.com/giscus/giscus diff --git a/layout/_partial/comment/plugins/waline.ejs b/layout/_partial/comment/plugins/waline.ejs index f376d9a3a..417047210 100644 --- a/layout/_partial/comment/plugins/waline.ejs +++ b/layout/_partial/comment/plugins/waline.ejs @@ -7,9 +7,11 @@ let { options: waline_options = {} } = theme?.comment?.waline || {} -if (!waline_version) { waline_version = '2' } +waline_version = String(waline_version).trim() -const esm_load = String(waline_version) === '3' +if (!waline_version) { waline_version = '3' } + +const esm_load = waline_version === '3' || /^3\..*/.test(waline_version) let cdn_css = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline.css` let cdn_css_meta = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline-meta.css`