mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
🐛 適配hexo 5.0.0 修復toc點擊不會跳轉的bugs
🐛 適配hexo 5.0.0 修復toc點擊不會跳轉的bugs 🍻 文件整理 🍻 UI微調
This commit is contained in:
@@ -8,8 +8,7 @@ div
|
||||
|
||||
if theme.medium_zoom
|
||||
script(src=url_for(theme.CDN.medium_zoom))
|
||||
|
||||
if theme.fancybox
|
||||
else if theme.fancybox
|
||||
script(src=url_for(theme.CDN.fancybox))
|
||||
|
||||
if theme.instantpage
|
||||
@@ -18,43 +17,16 @@ div
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.CDN.lazyload) async)
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
script(src=url_for(theme.CDN.anime))
|
||||
script(src=url_for(theme.CDN.fireworks))
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
script(src=url_for(theme.CDN.snackbar))
|
||||
|
||||
if theme.pangu && theme.pangu.enable
|
||||
include ./third-party/pangu.pug
|
||||
|
||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
include ./third-party/canvas-ribbon.pug
|
||||
|
||||
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.activate_power_mode.enable
|
||||
script(src=url_for(theme.CDN.activate_power_mode))
|
||||
script.
|
||||
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart
|
||||
script(src=url_for(theme.CDN.click_heart) async)
|
||||
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
script(src=url_for(theme.CDN.ClickShowText) async)
|
||||
!=partial('includes/third-party/pangu.pug', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- search
|
||||
if theme.algolia_search && theme.algolia_search.enable
|
||||
if theme.algolia_search.enable
|
||||
script(src=url_for(theme.CDN.algolia_js))
|
||||
else if theme.local_search && theme.local_search.enable
|
||||
else if theme.local_search.enable
|
||||
script(src=url_for(theme.CDN.local_search))
|
||||
|
||||
if theme.preloader
|
||||
@@ -64,23 +36,22 @@ div
|
||||
if is_home() && theme.subtitle.enable
|
||||
include ./third-party/subtitle.pug
|
||||
|
||||
include ./math/index.pug
|
||||
|
||||
//- mermaid
|
||||
if theme.mermaid.enable
|
||||
include ./third-party/mermaid.pug
|
||||
include ./third-party/math/index.pug
|
||||
|
||||
if commentsJsLoad
|
||||
include ./comments/js.pug
|
||||
include ./third-party/comments/js.pug
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src=url_for(theme.CDN.busuanzi))
|
||||
|
||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.aplayerInject && !config.aplayer.asset_inject
|
||||
if theme.pjax
|
||||
!=partial('includes/third-party/effect', {}, {cache:theme.fragment_cache})
|
||||
|
||||
!=partial('includes/third-party/chat/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.aplayerInject && theme.aplayerInject.enable
|
||||
if theme.pjax || theme.aplayerInject.per_page
|
||||
include ./head/aplayer.pug
|
||||
else if page.aplayer
|
||||
include ./head/aplayer.pug
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
each name in theme.comments.use
|
||||
case name
|
||||
when 'Valine'
|
||||
!=partial('includes/comments/valine', {}, {cache:theme.fragment_cache})
|
||||
when 'Disqus'
|
||||
include ./disqus.pug
|
||||
when 'Disqusjs'
|
||||
include ./disqusjs.pug
|
||||
when 'Livere'
|
||||
!=partial('includes/comments/livere', {}, {cache:theme.fragment_cache})
|
||||
when 'Gitalk'
|
||||
include ./gitalk.pug
|
||||
when 'Utterances'
|
||||
!=partial('includes/comments/utterances', {}, {cache:theme.fragment_cache})
|
||||
when 'Facebook Comments'
|
||||
!=partial('includes/comments/facebook_comments', {}, {cache:theme.fragment_cache})
|
||||
@@ -1,22 +1,23 @@
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
if !Array.isArray(value)
|
||||
.menus_item
|
||||
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||
if value.split('||')[1]
|
||||
i.fa-fw(class=trim(value.split('||')[1]))
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page(href='javascript:void(0);')
|
||||
if label.split('||')[1]
|
||||
i.fa-fw(class=trim(label.split('||')[1]))
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
i.fas.fa-chevron-down.expand
|
||||
ul.menus_item_child
|
||||
each i in value
|
||||
li
|
||||
a.site-page(href=url_for(trim(i.split('||')[1])))
|
||||
if i.split('||')[2]
|
||||
i.fa-fw(class=trim(i.split('||')[2]))
|
||||
span=' '+trim(i.split('||')[0])
|
||||
if theme.menu
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
if !Array.isArray(value)
|
||||
.menus_item
|
||||
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||
if value.split('||')[1]
|
||||
i.fa-fw(class=trim(value.split('||')[1]))
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page(href='javascript:void(0);')
|
||||
if label.split('||')[1]
|
||||
i.fa-fw(class=trim(label.split('||')[1]))
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
i.fas.fa-chevron-down.expand
|
||||
ul.menus_item_child
|
||||
each i in value
|
||||
li
|
||||
a.site-page(href=url_for(trim(i.split('||')[1])))
|
||||
if i.split('||')[2]
|
||||
i.fa-fw(class=trim(i.split('||')[2]))
|
||||
span=' '+trim(i.split('||')[0])
|
||||
@@ -3,7 +3,7 @@ nav#nav
|
||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||
|
||||
span.pull-right.menus
|
||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||
if (theme.algolia_search.enable || theme.local_search.enable)
|
||||
#search_button
|
||||
a.site-page.social-icon.search
|
||||
i.fas.fa-search.fa-fw
|
||||
|
||||
@@ -8,9 +8,6 @@ html(lang=config.language data-theme=theme.display_mode)
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
|
||||
!=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
#body-wrap
|
||||
@@ -41,5 +38,5 @@ html(lang=config.language data-theme=theme.display_mode)
|
||||
!=partial('includes/footer', {}, {cache:theme.fragment_cache})
|
||||
|
||||
include ./rightside.pug
|
||||
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||
!=partial('includes/third-party/search/index', {}, {cache:theme.fragment_cache})
|
||||
include ./additional-js.pug
|
||||
@@ -19,17 +19,17 @@ mixin postUI(posts)
|
||||
if (is_home() && (article.top || article.sticky > 0))
|
||||
span.article-meta
|
||||
i.fas.fa-thumbtack.article-meta__icon.sticky
|
||||
span.sticky.article-meta-label= _p('sticky')
|
||||
span.sticky= _p('sticky')
|
||||
span.article-meta__separator |
|
||||
if (theme.post_meta.page.date_type)
|
||||
span.post-meta-date
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
i.far.fa-calendar-alt
|
||||
span.article-meta-label= _p('post.created')
|
||||
span.article-meta-label=_p('post.created')
|
||||
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date))=date(article.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
i.fas.fa-history
|
||||
span.article-meta-label= _p('post.updated')
|
||||
span.article-meta-label=_p('post.updated')
|
||||
time.post-meta-date-updated(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated))=date(article.updated, config.date_format)
|
||||
else
|
||||
- let data_type_updated = theme.post_meta.page.date_type === 'updated'
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
if (theme.algolia_search.enable)
|
||||
include ./algolia.pug
|
||||
if (theme.local_search)
|
||||
if (!theme.algolia_search.enable && theme.local_search.enable)
|
||||
include ./local-search.pug
|
||||
@@ -1,7 +0,0 @@
|
||||
.post_share
|
||||
if theme.addThis.enable
|
||||
!=partial('includes/share/add-this', {}, {cache:theme.fragment_cache})
|
||||
else if theme.sharejs && theme.sharejs.enable
|
||||
include ./share-js.pug
|
||||
else if theme.addtoany.enable
|
||||
!=partial('includes/share/addtoany', {}, {cache:theme.fragment_cache})
|
||||
@@ -1,4 +0,0 @@
|
||||
if (theme.sharejs && theme.sharejs.enable)
|
||||
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
|
||||
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||
script(src=url_for(theme.CDN.sharejs) defer)
|
||||
1
layout/includes/third-party/canvas-nest.pug
vendored
1
layout/includes/third-party/canvas-nest.pug
vendored
@@ -1 +0,0 @@
|
||||
script#canvas_nest(defer color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count mobile=`${theme.canvas_nest.mobile}` src=url_for(theme.CDN.canvas_nest))
|
||||
@@ -1 +0,0 @@
|
||||
script(defer id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))
|
||||
@@ -1,3 +0,0 @@
|
||||
script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
|
||||
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
|
||||
|
||||
16
layout/includes/third-party/comments/js.pug
vendored
Normal file
16
layout/includes/third-party/comments/js.pug
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
each name in theme.comments.use
|
||||
case name
|
||||
when 'Valine'
|
||||
!=partial('includes/third-party/comments/valine', {}, {cache:theme.fragment_cache})
|
||||
when 'Disqus'
|
||||
include ./disqus.pug
|
||||
when 'Disqusjs'
|
||||
include ./disqusjs.pug
|
||||
when 'Livere'
|
||||
!=partial('includes/third-party/comments/livere', {}, {cache:theme.fragment_cache})
|
||||
when 'Gitalk'
|
||||
include ./gitalk.pug
|
||||
when 'Utterances'
|
||||
!=partial('includes/third-party/comments/utterances', {}, {cache:theme.fragment_cache})
|
||||
when 'Facebook Comments'
|
||||
!=partial('includes/third-party/comments/facebook_comments', {}, {cache:theme.fragment_cache})
|
||||
28
layout/includes/third-party/effect.pug
vendored
Normal file
28
layout/includes/third-party/effect.pug
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
script(src=url_for(theme.CDN.anime))
|
||||
script(src=url_for(theme.CDN.fireworks))
|
||||
|
||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
|
||||
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
|
||||
|
||||
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
||||
script(defer id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))
|
||||
|
||||
if (theme.canvas_nest && theme.canvas_nest.enable)
|
||||
script#canvas_nest(defer color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count mobile=`${theme.canvas_nest.mobile}` src=url_for(theme.CDN.canvas_nest))
|
||||
|
||||
if theme.activate_power_mode.enable
|
||||
script(src=url_for(theme.CDN.activate_power_mode))
|
||||
script.
|
||||
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart
|
||||
script(src=url_for(theme.CDN.click_heart) async)
|
||||
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
script(src=url_for(theme.CDN.ClickShowText) async)
|
||||
@@ -13,3 +13,6 @@ if theme.katex && theme.katex.enable
|
||||
else
|
||||
if page.katex
|
||||
include ./katex.pug
|
||||
|
||||
if theme.mermaid.enable
|
||||
include ./mermaid.pug
|
||||
4
layout/includes/third-party/search/index.pug
vendored
Normal file
4
layout/includes/third-party/search/index.pug
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
if theme.algolia_search.enable
|
||||
include ./algolia.pug
|
||||
else if theme.local_search.enable
|
||||
include ./local-search.pug
|
||||
7
layout/includes/third-party/share/index.pug
vendored
Normal file
7
layout/includes/third-party/share/index.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
.post_share
|
||||
if theme.addThis.enable
|
||||
!=partial('includes/third-party/share/add-this', {}, {cache:theme.fragment_cache})
|
||||
else if theme.sharejs.enable
|
||||
include ./share-js.pug
|
||||
else if theme.addtoany.enable
|
||||
!=partial('includes/third-party/share/addtoany', {}, {cache:theme.fragment_cache})
|
||||
3
layout/includes/third-party/share/share-js.pug
vendored
Normal file
3
layout/includes/third-party/share/share-js.pug
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
|
||||
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||
script(src=url_for(theme.CDN.sharejs) defer)
|
||||
Reference in New Issue
Block a user