breaking changes: anchor設置更改,可單獨設置按鈕和自動更新anchor是否開啟,可設置button圖標,可設置button 總是顯示 closed #1025

improvement: 本地預覽,友情鏈接頁面刷新,內容不會重複顯示
This commit is contained in:
Jerry
2022-09-03 15:55:18 +08:00
parent c866315b87
commit 13cf15c369
7 changed files with 46 additions and 35 deletions

View File

@@ -168,8 +168,12 @@ index_post_content:
length: 500 # if you set method to 2 or 3, the length need to config length: 500 # if you set method to 2 or 3, the length need to config
# anchor # anchor
# when you scroll in post, the URL will update according to header id. anchor:
anchor: false 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 # Post
# -------------------------------------- # --------------------------------------

View File

@@ -120,5 +120,5 @@ script.
}, },
isPhotoFigcaption: !{theme.photofigcaption}, isPhotoFigcaption: !{theme.photofigcaption},
islazyload: !{theme.lazyload.enable}, islazyload: !{theme.lazyload.enable},
isAnchor: !{theme.anchor} isAnchor: !{theme.anchor.auto_update}
} }

View File

@@ -1,5 +1,6 @@
#article-container #article-container
.flink .flink
- let pageContent = page.content
if page.flink_url if page.flink_url
script. script.
(()=>{ (()=>{
@@ -63,6 +64,6 @@
- result += `${className}${classDesc} <div class="flink-list">${listResult}</div>` - result += `${className}${classDesc} <div class="flink-list">${listResult}</div>`
- page.content = result + page.content - pageContent = result + pageContent
!= page.content != pageContent

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "4.4.0", "version": "4.5.0-b1",
"description": "A Simple and Card UI Design theme for Hexo", "description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {

View File

@@ -5,7 +5,7 @@ algolia_search_v4:
instantsearch_v4: instantsearch_v4:
name: instantsearch.js name: instantsearch.js
file: dist/instantsearch.production.min.js file: dist/instantsearch.production.min.js
version: 4.44.0 version: 4.45.0
pjax: pjax:
name: pjax name: pjax
file: pjax.min.js file: pjax.min.js
@@ -13,11 +13,11 @@ pjax:
gitalk: gitalk:
name: gitalk name: gitalk
file: dist/gitalk.min.js file: dist/gitalk.min.js
version: 1.7.2 version: 1.8.0
gitalk_css: gitalk_css:
name: gitalk name: gitalk
file: dist/gitalk.css file: dist/gitalk.css
version: 1.7.2 version: 1.8.0
blueimp_md5: blueimp_md5:
name: blueimp-md5 name: blueimp-md5
file: js/md5.min.js file: js/md5.min.js
@@ -29,15 +29,15 @@ valine:
disqusjs: disqusjs:
name: disqusjs name: disqusjs
file: dist/browser/disqusjs.es2015.umd.min.js file: dist/browser/disqusjs.es2015.umd.min.js
version: 3.0.1 version: 3.0.2
disqusjs_css: disqusjs_css:
name: disqusjs name: disqusjs
file: dist/browser/styles/disqusjs.css file: dist/browser/styles/disqusjs.css
version: 3.0.1 version: 3.0.2
twikoo: twikoo:
name: twikoo name: twikoo
file: dist/twikoo.all.min.js file: dist/twikoo.all.min.js
version: 1.6.5 version: 1.6.7
waline_js: waline_js:
name: '@waline/client' name: '@waline/client'
file: dist/waline.js file: dist/waline.js
@@ -64,16 +64,16 @@ katex:
name: katex name: katex
file: dist/katex.min.css file: dist/katex.min.css
other_name: KaTeX other_name: KaTeX
version: 0.16.0 version: 0.16.2
katex_copytex: katex_copytex:
name: katex name: katex
file: dist/contrib/copy-tex.min.js file: dist/contrib/copy-tex.min.js
other_name: KaTeX other_name: KaTeX
version: 0.16.0 version: 0.16.2
mermaid: mermaid:
name: mermaid name: mermaid
file: dist/mermaid.min.js file: dist/mermaid.min.js
version: 9.1.5 version: 9.1.6
canvas_ribbon: canvas_ribbon:
name: butterfly-extsrc name: butterfly-extsrc
file: dist/canvas-ribbon.min.js file: dist/canvas-ribbon.min.js
@@ -105,7 +105,7 @@ ClickShowText:
lazyload: lazyload:
name: vanilla-lazyload name: vanilla-lazyload
file: dist/lazyload.iife.min.js file: dist/lazyload.iife.min.js
version: 17.3.1 version: 17.8.3
instantpage: instantpage:
name: instant.page name: instant.page
file: instantpage.js file: instantpage.js
@@ -144,7 +144,7 @@ fontawesomeV6:
name: '@fortawesome/fontawesome-free' name: '@fortawesome/fontawesome-free'
file: css/all.min.css file: css/all.min.css
other_name: font-awesome other_name: font-awesome
version: 6.1.2 version: 6.2.0
flickr_justified_gallery_js: flickr_justified_gallery_js:
name: flickr-justified-gallery name: flickr-justified-gallery
file: dist/fjGallery.min.js file: dist/fjGallery.min.js
@@ -169,17 +169,17 @@ prismjs_js:
name: prismjs name: prismjs
file: prism.js file: prism.js
other_name: prism other_name: prism
version: 1.28.0 version: 1.29.0
prismjs_lineNumber_js: prismjs_lineNumber_js:
name: prismjs name: prismjs
file: plugins/line-numbers/prism-line-numbers.min.js file: plugins/line-numbers/prism-line-numbers.min.js
other_name: prism other_name: prism
version: 1.28.0 version: 1.29.0
prismjs_autoloader: prismjs_autoloader:
name: prismjs name: prismjs
file: plugins/autoloader/prism-autoloader.min.js file: plugins/autoloader/prism-autoloader.min.js
other_name: prism other_name: prism
version: 1.28.0 version: 1.29.0
artalk_js: artalk_js:
name: artalk name: artalk
file: dist/Artalk.js file: dist/Artalk.js

View File

@@ -102,31 +102,35 @@ beautify()
font-family: Monaco, 'Ubuntu Mono', monospace font-family: Monaco, 'Ubuntu Mono', monospace
line-height: 1em line-height: 1em
if hexo-config('anchor') if hexo-config('anchor.button.enable')
a.headerlink a.headerlink
&:after &:after
@extend .fontawesomeIcon @extend .fontawesomeIcon
float: right float: right
color: var(--headline-presudo) color: var(--headline-presudo)
content: '\f0c1' content: $archor-button-icon
font-size: .95em font-size: .95em
opacity: 0
transition: all .3s transition: all .3s
&:hover &:hover
&:after &:after
color: var(--pseudo-hover) color: var(--pseudo-hover)
h1, if !hexo-config('anchor.button.always_show')
h2, a.headerlink
h3, &:after
h4, opacity: 0
h5,
h6 h1,
&:hover h2,
a.headerlink h3,
&:after h4,
opacity: 1 h5,
h6
&:hover
a.headerlink
&:after
opacity: 1
ol, ol,
ul ul

View File

@@ -71,7 +71,7 @@ $button-hover-color = $themeColorEnable && hexo-config('theme_color.button_hover
$button-bg = $theme-color $button-bg = $theme-color
$pseudo-hover = $button-hover-color $pseudo-hover = $button-hover-color
// scrollbar // 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
$table-thead-bg = #99a9bf $table-thead-bg = #99a9bf
// reward // reward
@@ -181,3 +181,5 @@ $tab-button-active-bg = $card-bg
$tab-to-top-color = #99a9bf $tab-to-top-color = #99a9bf
// Tag Plugins - timeline // Tag Plugins - timeline
$timeline-default-color = $theme-color $timeline-default-color = $theme-color
// archor
$archor-button-icon = hexo-config('anchor.button.icon') ? hexo-config('anchor.button.icon') : '\f0c1'