From 13cf15c3697d3c3492d521af97ee987fffd4cba7 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 3 Sep 2022 15:55:18 +0800 Subject: [PATCH] =?UTF-8?q?breaking=20changes:=20anchor=E8=A8=AD=E7=BD=AE?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=8C=E5=8F=AF=E5=96=AE=E7=8D=A8=E8=A8=AD?= =?UTF-8?q?=E7=BD=AE=E6=8C=89=E9=88=95=E5=92=8C=E8=87=AA=E5=8B=95=E6=9B=B4?= =?UTF-8?q?=E6=96=B0anchor=E6=98=AF=E5=90=A6=E9=96=8B=E5=95=9F=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=A8=AD=E7=BD=AEbutton=E5=9C=96=E6=A8=99=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=A8=AD=E7=BD=AEbutton=20=E7=B8=BD=E6=98=AF=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA=20closed=20#1025=20improvement:=20=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=A0=90=E8=A6=BD=EF=BC=8C=E5=8F=8B=E6=83=85=E9=8F=88=E6=8E=A5?= =?UTF-8?q?=E9=A0=81=E9=9D=A2=E5=88=B7=E6=96=B0=EF=BC=8C=E5=85=A7=E5=AE=B9?= =?UTF-8?q?=E4=B8=8D=E6=9C=83=E9=87=8D=E8=A4=87=E9=A1=AF=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 8 ++++++-- layout/includes/head/config.pug | 2 +- layout/includes/page/flink.pug | 5 +++-- package.json | 2 +- plugins.yml | 28 ++++++++++++++-------------- source/css/_layout/post.styl | 30 +++++++++++++++++------------- source/css/var.styl | 6 ++++-- 7 files changed, 46 insertions(+), 35 deletions(-) diff --git a/_config.yml b/_config.yml index 20eadd5..1c4b09f 100644 --- a/_config.yml +++ b/_config.yml @@ -168,8 +168,12 @@ index_post_content: length: 500 # if you set method to 2 or 3, the length need to config # anchor -# when you scroll in post, the URL will update according to header id. -anchor: false +anchor: + button: + enable: false + always_show: false + icon: # the unicode value of Font Awesome icon, such as '\3423' + auto_update: false # when you scroll in post, the URL will update according to header id. # Post # -------------------------------------- diff --git a/layout/includes/head/config.pug b/layout/includes/head/config.pug index 61f62d0..4bcff8f 100644 --- a/layout/includes/head/config.pug +++ b/layout/includes/head/config.pug @@ -120,5 +120,5 @@ script. }, isPhotoFigcaption: !{theme.photofigcaption}, islazyload: !{theme.lazyload.enable}, - isAnchor: !{theme.anchor} + isAnchor: !{theme.anchor.auto_update} } diff --git a/layout/includes/page/flink.pug b/layout/includes/page/flink.pug index e63eb68..8ec4ed6 100644 --- a/layout/includes/page/flink.pug +++ b/layout/includes/page/flink.pug @@ -1,5 +1,6 @@ #article-container .flink + - let pageContent = page.content if page.flink_url script. (()=>{ @@ -63,6 +64,6 @@ - result += `${className}${classDesc} ` - - page.content = result + page.content - != page.content + - pageContent = result + pageContent + != pageContent diff --git a/package.json b/package.json index bbe96e7..b3f420c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "4.4.0", + "version": "4.5.0-b1", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/plugins.yml b/plugins.yml index 82892dd..d38dd76 100644 --- a/plugins.yml +++ b/plugins.yml @@ -5,7 +5,7 @@ algolia_search_v4: instantsearch_v4: name: instantsearch.js file: dist/instantsearch.production.min.js - version: 4.44.0 + version: 4.45.0 pjax: name: pjax file: pjax.min.js @@ -13,11 +13,11 @@ pjax: gitalk: name: gitalk file: dist/gitalk.min.js - version: 1.7.2 + version: 1.8.0 gitalk_css: name: gitalk file: dist/gitalk.css - version: 1.7.2 + version: 1.8.0 blueimp_md5: name: blueimp-md5 file: js/md5.min.js @@ -29,15 +29,15 @@ valine: disqusjs: name: disqusjs file: dist/browser/disqusjs.es2015.umd.min.js - version: 3.0.1 + version: 3.0.2 disqusjs_css: name: disqusjs file: dist/browser/styles/disqusjs.css - version: 3.0.1 + version: 3.0.2 twikoo: name: twikoo file: dist/twikoo.all.min.js - version: 1.6.5 + version: 1.6.7 waline_js: name: '@waline/client' file: dist/waline.js @@ -64,16 +64,16 @@ katex: name: katex file: dist/katex.min.css other_name: KaTeX - version: 0.16.0 + version: 0.16.2 katex_copytex: name: katex file: dist/contrib/copy-tex.min.js other_name: KaTeX - version: 0.16.0 + version: 0.16.2 mermaid: name: mermaid file: dist/mermaid.min.js - version: 9.1.5 + version: 9.1.6 canvas_ribbon: name: butterfly-extsrc file: dist/canvas-ribbon.min.js @@ -105,7 +105,7 @@ ClickShowText: lazyload: name: vanilla-lazyload file: dist/lazyload.iife.min.js - version: 17.3.1 + version: 17.8.3 instantpage: name: instant.page file: instantpage.js @@ -144,7 +144,7 @@ fontawesomeV6: name: '@fortawesome/fontawesome-free' file: css/all.min.css other_name: font-awesome - version: 6.1.2 + version: 6.2.0 flickr_justified_gallery_js: name: flickr-justified-gallery file: dist/fjGallery.min.js @@ -169,17 +169,17 @@ prismjs_js: name: prismjs file: prism.js other_name: prism - version: 1.28.0 + version: 1.29.0 prismjs_lineNumber_js: name: prismjs file: plugins/line-numbers/prism-line-numbers.min.js other_name: prism - version: 1.28.0 + version: 1.29.0 prismjs_autoloader: name: prismjs file: plugins/autoloader/prism-autoloader.min.js other_name: prism - version: 1.28.0 + version: 1.29.0 artalk_js: name: artalk file: dist/Artalk.js diff --git a/source/css/_layout/post.styl b/source/css/_layout/post.styl index aebae8d..4915ee6 100644 --- a/source/css/_layout/post.styl +++ b/source/css/_layout/post.styl @@ -102,31 +102,35 @@ beautify() font-family: Monaco, 'Ubuntu Mono', monospace line-height: 1em - if hexo-config('anchor') + if hexo-config('anchor.button.enable') a.headerlink &:after @extend .fontawesomeIcon float: right color: var(--headline-presudo) - content: '\f0c1' + content: $archor-button-icon font-size: .95em - opacity: 0 transition: all .3s &:hover &:after color: var(--pseudo-hover) - h1, - h2, - h3, - h4, - h5, - h6 - &:hover - a.headerlink - &:after - opacity: 1 + if !hexo-config('anchor.button.always_show') + a.headerlink + &:after + opacity: 0 + + h1, + h2, + h3, + h4, + h5, + h6 + &:hover + a.headerlink + &:after + opacity: 1 ol, ul diff --git a/source/css/var.styl b/source/css/var.styl index 545b0a7..9675db0 100644 --- a/source/css/var.styl +++ b/source/css/var.styl @@ -71,7 +71,7 @@ $button-hover-color = $themeColorEnable && hexo-config('theme_color.button_hover $button-bg = $theme-color $pseudo-hover = $button-hover-color // scrollbar -$scrollbar-color= $themeColorEnable && hexo-config('theme_color.scrollbar_color') ? convert(hexo-config('theme_color.scrollbar_color')) : $theme-color +$scrollbar-color = $themeColorEnable && hexo-config('theme_color.scrollbar_color') ? convert(hexo-config('theme_color.scrollbar_color')) : $theme-color // table $table-thead-bg = #99a9bf // reward @@ -180,4 +180,6 @@ $tab-active-border-color = $theme-color $tab-button-active-bg = $card-bg $tab-to-top-color = #99a9bf // Tag Plugins - timeline -$timeline-default-color = $theme-color \ No newline at end of file +$timeline-default-color = $theme-color +// archor +$archor-button-icon = hexo-config('anchor.button.icon') ? hexo-config('anchor.button.icon') : '\f0c1' \ No newline at end of file