mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:40:55 +08:00
1. Feature: 可設置内联代码块样式 #26
2. Feature: 可設置夜間模式作爲默認樣式 3. Feature: 可設置是否顯示code language名稱 4. Feature: 可設置是否展開或關閉代碼框 5. Feature: 可設置背景圖片/顔色 6. Feature: 可設置是否顯示footer背景 7. Feature: 增加 canvas-nest.js 8. Feature: 頭像可設置效果(轉圈圈) 9. Feature: menu可設置分組 9. Fix: 優化打賞和搜索打開特效 10. Fix: 優化sidebar的打開特效,避免與文章頁特效不同步 11. Fix: 適配**hexo-blog-encrypt**,現在可以顯示toc 12. Fix: 修復設置不顯示評論時,直達評論按鈕沒有消失的bug 13. Fix: 修復post頁底欄,當沒有顯示評論,不顯示TOC,評論和toc都不顯示 這三種狀態下按鈕的bug 14. Fix: 修復代碼框左右滑動時,代碼名字跟著滑動的bug 15. Fix: 其他page頁標題的字體顯示 16. Fix: 修復當設置開啓canvas_ribbons,進入網站會先顯示canvas_ribbons的bug 17. Fix: 完善夜間模式下,字體顯示問題 18. Fix: 修復代碼框 複製 和 代碼名 z-index bug #25 19. Fix: 完善阅读模式
This commit is contained in:
@@ -22,6 +22,9 @@ if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
||||
include ./third-party/canvas-ribbon-piao.pug
|
||||
|
||||
if (theme.canvas_nest && theme.canvas_nest.enable)
|
||||
include ./third-party/canvas-nest.pug
|
||||
|
||||
if theme.baidu_push && theme.baidu_push.enable
|
||||
script(src=url_for('js/baidupush.js'))
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ script.
|
||||
localSearch: !{localSearch},
|
||||
translate: !{translate},
|
||||
highlight_copy: '!{theme.highlight_copy}',
|
||||
highlight_lang: '!{theme.highlight_lang}',
|
||||
highlight_shrink: '!{theme.highlight_shrink}',
|
||||
copy: {
|
||||
success: '!{_p("copy.success")}',
|
||||
error: '!{_p("copy.error")}',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#footer.layout
|
||||
#footer
|
||||
- var now = new Date()
|
||||
- var nowYear = now.getFullYear()
|
||||
if theme.since && theme.since != nowYear
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
span.pull-right.menus
|
||||
.mobile_author_icon
|
||||
img.lozad(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
img.lozad.avatar_img(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
.mobile_post_data
|
||||
if site.posts.length
|
||||
.mobile_data_item.text-center
|
||||
@@ -35,11 +35,27 @@
|
||||
.length_num= site.categories.length
|
||||
|
||||
hr
|
||||
.menus_item
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
a.site-page(href=value.split('||')[0])
|
||||
i.fa-fw(class=value.split('||')[1])
|
||||
span=' '+label
|
||||
if !Array.isArray(value)
|
||||
.menus_item
|
||||
a.site-page(href=value.split('||')[0])
|
||||
i.fa-fw(class=value.split('||')[1])
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page
|
||||
i.fa-fw(class=label.split('||')[1] aria-hidden="true")
|
||||
span=' '+label.split('||')[0]
|
||||
i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
|
||||
ul.menus_item_child
|
||||
each i in value
|
||||
li
|
||||
a.site-page(href=i.split('||')[1])
|
||||
i.fa-fw(class=i.split('||')[2])
|
||||
span=' '+i.split('||')[0]
|
||||
|
||||
|
||||
script.
|
||||
document.body.addEventListener('touchstart', function(){ });
|
||||
span.pull-right
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var body_class = theme.display_mode == 'night' ? 'night-mode' : ''
|
||||
|
||||
|
||||
doctype html
|
||||
html(lang=config.language)
|
||||
@@ -44,9 +46,11 @@ html(lang=config.language)
|
||||
link(rel='stylesheet', href=item)
|
||||
include ./head.pug
|
||||
include ./config.pug
|
||||
body
|
||||
body(class=body_class)
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
if theme.background
|
||||
#web_bg
|
||||
if (is_post() && page.toc != false && theme.toc.enable)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
||||
include ./sidebar.pug
|
||||
@@ -66,7 +70,9 @@ html(lang=config.language)
|
||||
div!= body
|
||||
else
|
||||
block content
|
||||
footer
|
||||
|
||||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||||
footer(style=footer_bg)
|
||||
include ./footer.pug
|
||||
i.fa.fa-arrow-up#go-up(aria-hidden="true")
|
||||
include ./rightside.pug
|
||||
|
||||
@@ -7,7 +7,8 @@ else
|
||||
|
||||
|
||||
if is_home()
|
||||
nav#nav.full_page(style=bg_img)
|
||||
nav#nav.full_page
|
||||
.nav_bg(style=bg_img)
|
||||
include ./header.pug
|
||||
#site-info
|
||||
#site-title
|
||||
@@ -25,7 +26,8 @@ if is_home()
|
||||
i.fa.fa-angle-down.scroll-down-effects
|
||||
|
||||
else
|
||||
nav#nav.bg_local(style=bg_img)
|
||||
nav#nav.not_index_bg
|
||||
.nav_bg(style=bg_img)
|
||||
include ./header.pug
|
||||
#page_site-info
|
||||
#site-title
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
#post_bottom
|
||||
- var no_comment_show = page.comments !== false ? '' : 'no_comment_show'
|
||||
- var no_toc_show = (is_post() && page.toc != false && theme.toc.enable) ? '' : 'no_toc_show'
|
||||
#post_bottom(class= no_comment_show + ' ' + no_toc_show)
|
||||
#post_bottom_items
|
||||
a#mobile_to_comment(href="#post-comment")
|
||||
i.mobile_scroll_to_comment.fa.fa-comments
|
||||
i#mobile_toc.fa.fa-list
|
||||
#toc_mobile
|
||||
.toc_mobile_headline= _p('sidebar.catalog')
|
||||
!=toc(page.content,{"class":"toc_mobile_items"})
|
||||
if page.comments !== false
|
||||
a#mobile_to_comment(href="#post-comment")
|
||||
i.mobile_scroll_to_comment.fa.fa-comments
|
||||
|
||||
if (is_post() && page.toc != false && theme.toc.enable)
|
||||
i#mobile_toc.fa.fa-list
|
||||
#toc_mobile
|
||||
.toc_mobile_headline= _p('sidebar.catalog')
|
||||
if (page.encrypt == true)
|
||||
.toc-div-class(style="display:none")!=toc(page.origin,{"class":"toc_mobile_items"})
|
||||
else
|
||||
!=toc(page.content,{"class":"toc_mobile_items"})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
section#rightside.rightside
|
||||
if is_post()
|
||||
if is_post() && page.comments !== false
|
||||
a#to_comment(href="#post-comment")
|
||||
i.scroll_to_comment.fa.fa-comments
|
||||
if theme.readmode.enable && is_post()
|
||||
@@ -9,4 +9,5 @@ section#rightside.rightside
|
||||
if theme.translate && theme.translate.enable
|
||||
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title'))= theme.translate.default
|
||||
if theme.nightshift.enable
|
||||
i#nightshift.fa.fa-moon-o.nightshift(title=_p('rightside.night_mode_title'))
|
||||
- var display_mode = theme.display_mode == 'night'? 'fa fa-sun-o' : 'fa fa-moon-o'
|
||||
i#nightshift.nightshift(class=display_mode title=_p('rightside.night_mode_title'))
|
||||
|
||||
@@ -16,5 +16,9 @@
|
||||
span.progress-notice= _p('sidebar.have_read')
|
||||
span.progress-num 0
|
||||
span.progress-percentage %
|
||||
div.sidebar-toc__progress-bar
|
||||
div.sidebar-toc__content!=toc(page.content, {list_number: tocNumber})
|
||||
div.sidebar-toc__progress-bar
|
||||
if (page.encrypt == true)
|
||||
div.sidebar-toc__content.toc-div-class(style="display:none")!=toc(page.origin, {list_number: tocNumber})
|
||||
else
|
||||
div.sidebar-toc__content!=toc(page.content, {list_number: tocNumber})
|
||||
|
||||
1
layout/includes/third-party/canvas-nest.pug
vendored
Normal file
1
layout/includes/third-party/canvas-nest.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
script(color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count src=url_for(theme.canvas_nest.script))
|
||||
@@ -2,7 +2,7 @@
|
||||
.card-content
|
||||
.post_data
|
||||
.data-item.text-center
|
||||
img.lozad(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
img.lozad.avatar_img(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
p.author-info__name.text-center= config.author
|
||||
p.author-info__description.text-center= config.description
|
||||
|
||||
|
||||
Reference in New Issue
Block a user