1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| - 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 when 'share' button.share(type="button" title='分享链接' onclick="share()") i.fas.fa-share-nodes when 'refresh' button#refresh-cache(type="button" title='刷新缓存' onclick="refreshCache()") i.fas.fa-refresh.fa-spin
#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','share']
#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
|