mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
feat: snackbar 增加圓角 feat: 增加 flink 標籤外掛 fix: 修復點擊 toc 外圍,控制檯報錯的 bug fix: Facebook Comments 無法使用 #787 fix: chat_btn 聊天按鈕翻譯缺失 #791 fix: local search 的 content 設爲 false, 搜索無法運行的 bug #764 fix: Mermaid 圖表渲染後元素高度過大 #773 fix: 文章頁分享按鈕另開一行時, 導航頁寬度沒有 100% 的 bug #765 improvement: 語義化 toggle 標籤外掛 improvement: darkmode 下 toc 背景顏色更改
60 lines
2.2 KiB
Plaintext
60 lines
2.2 KiB
Plaintext
- const { readmode, translate, darkmode, aside, chat_btn } = theme
|
|
mixin rightsideItem(array)
|
|
each item in array
|
|
case item
|
|
when 'readmode'
|
|
if is_post() && readmode
|
|
button#readmode(type="button" title=_p('rightside.readmode_title'))
|
|
i.fas.fa-book-open
|
|
when 'translate'
|
|
if translate.enable
|
|
button#translateLink(type="button" title=_p('rightside.translate_title'))= translate.default
|
|
when 'darkmode'
|
|
if darkmode.enable && darkmode.button
|
|
button#darkmode(type="button" title=_p('rightside.night_mode_title'))
|
|
i.fas.fa-adjust
|
|
when 'hideAside'
|
|
if aside.enable && aside.button && page.aside !== false
|
|
button#hide-aside-btn(type="button" title=_p('rightside.aside'))
|
|
i.fas.fa-arrows-alt-h
|
|
when 'toc'
|
|
if showToc
|
|
button#mobile-toc-button.close(type="button" title=_p("rightside.toc"))
|
|
i.fas.fa-list-ul
|
|
when 'chat'
|
|
if chat_btn
|
|
button#chat_btn(type="button" title=_p("rightside.chat"))
|
|
i.fas.fa-sms
|
|
when 'comment'
|
|
if commentsJsLoad
|
|
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
|
i.fas.fa-comments
|
|
|
|
#rightside
|
|
- const { enable, hide, show } = theme.rightside_item_order
|
|
- const hideArray = enable ? hide && hide.split(',') : ['readmode','translate','darkmode','hideAside']
|
|
- const showArray = enable ? show && show.split(',') : ['toc','chat','comment']
|
|
|
|
|
|
#rightside-config-hide
|
|
if hideArray
|
|
+rightsideItem(hideArray)
|
|
#rightside-config-show
|
|
if enable
|
|
if hide
|
|
button#rightside_config(type="button" title=_p("rightside.setting"))
|
|
i.fas.fa-cog.fa-spin
|
|
else
|
|
if is_post()
|
|
if (readmode || translate.enable || (darkmode.enable && darkmode.button))
|
|
button#rightside_config(type="button" title=_p("rightside.setting"))
|
|
i.fas.fa-cog.fa-spin
|
|
else if translate.enable || (darkmode.enable && darkmode.button)
|
|
button#rightside_config(type="button" title=_p("rightside.setting"))
|
|
i.fas.fa-cog.fa-spin
|
|
|
|
if showArray
|
|
+rightsideItem(showArray)
|
|
|
|
button#go-up(type="button" title=_p("rightside.back_to_top"))
|
|
i.fas.fa-arrow-up |