mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:40:55 +08:00
fix bugs
This commit is contained in:
@@ -9,6 +9,9 @@ if (theme.katex && theme.katex.enable)
|
||||
if (theme.local_search && theme.local_search.enable)
|
||||
script(async src=url_for('/js/search/local-search.js'))
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
script(src='https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js')
|
||||
script(src=url_for('/js/third-party/fireworks.js'))
|
||||
|
||||
if theme.nightshift.enable
|
||||
script(src=url_for('js/nightshift.js'))
|
||||
@@ -19,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.baidu_push && theme.baidu_push.enable
|
||||
script(src=url_for('js/baidupush.js'))
|
||||
|
||||
if theme.activate_power_mode.enable
|
||||
script(src=url_for('js/activate-power-mode.js'))
|
||||
script.
|
||||
@@ -79,6 +85,7 @@ if is_home()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
||||
|
||||
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
||||
|
||||
@@ -65,5 +65,5 @@ if theme.valine && theme.valine.enable
|
||||
guest_info:guest_info,
|
||||
pageSize:'#{theme.valine.pageSize}',
|
||||
lang:'#{theme.valine.lang}',
|
||||
visitor: true
|
||||
recordIP: true
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var translate = 'undefined';
|
||||
if (theme.translate && theme.translate.enable){
|
||||
var defaultEncoding;
|
||||
translate = JSON.stringify({
|
||||
@@ -58,7 +58,9 @@ script.
|
||||
title: '!{_p("bookmark.title")}',
|
||||
message_prev: '!{_p("bookmark.message_prev")}',
|
||||
message_next: '!{_p("bookmark.message_next")}'
|
||||
}
|
||||
},
|
||||
runtime_unit: '!{_p("runtime_unit")}'
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -104,9 +104,10 @@ if theme.qihu_site_verification
|
||||
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
||||
|
||||
|
||||
if (is_archive())
|
||||
- var preload_img = theme.archive_img ||theme.top_img || config.top_img
|
||||
- var preload_archive_img = theme.archive_img ||theme.top_img || config.top_img
|
||||
- var preload_img = page.top_img || theme.top_img || config.top_img
|
||||
|
||||
if (is_archive() && preload_archive_img)
|
||||
link(rel="preload" href=preload_img as="image" )
|
||||
else if (!is_post())
|
||||
- var preload_img = page.top_img||theme.top_img || config.top_img
|
||||
else if (!is_post() && preload_img)
|
||||
link(rel="preload" href=preload_img as="image" )
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||
- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||
- if (is_year()) pageTitle += ': ' + page.year
|
||||
- var pageTitle_saved //- 暂时存储pageTitle
|
||||
- var pageTitle_no_include_blog_name //- 存储pageTitle, 不带 " | ",meta用
|
||||
//- home时显示config.title (JerryC),其他显示 pageTitle。meta用
|
||||
- var pageTitle_saved //- 暫時存儲pageTitle
|
||||
- var pageTitle_no_include_blog_name //- 存儲pageTitle, 不帶 " | ",meta用
|
||||
//- home時顯示config.title (JerryC),其他顯示 pageTitle。meta用
|
||||
- is_home() ? pageTitle_no_include_blog_name = config.title : pageTitle_no_include_blog_name = pageTitle
|
||||
//- 暂时存储pageTitle
|
||||
//- 暫時存儲pageTitle
|
||||
- pageTitle ? pageTitle_saved = pageTitle + ' | ' + config.title : pageTitle_saved = config.title
|
||||
//- home时pageTitle显示 JerryC - subtitle,其他显示 pageTitle | JerryC
|
||||
//- home時pageTitle顯示 JerryC - subtitle,其他顯示 pageTitle | JerryC
|
||||
- is_home() ? pageTitle = config.title + ' - ' + config.subtitle : pageTitle = pageTitle_saved
|
||||
|
||||
- var pageDescription = page.description || page.title || config.description || ''
|
||||
@@ -42,6 +42,8 @@ html(lang=config.language)
|
||||
include ./head.pug
|
||||
include ./config.pug
|
||||
body
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
if (is_post() && page.toc != false && theme.toc.enable)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
||||
include ./sidebar.pug
|
||||
|
||||
@@ -4,11 +4,10 @@ else
|
||||
- var top_img = page.top_img||theme.top_img || config.top_img
|
||||
|
||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
||||
- var flag = top_img === true ? 'no-bg' : ''
|
||||
|
||||
|
||||
if is_home()
|
||||
nav#nav.full_page(style=bg_img class=flag)
|
||||
nav#nav.full_page(style=bg_img)
|
||||
include ./header.pug
|
||||
#site-info
|
||||
#site-title
|
||||
@@ -26,7 +25,7 @@ if is_home()
|
||||
i.fa.fa-angle-down.scroll-down-effects
|
||||
|
||||
else
|
||||
nav#nav.bg_local(style=bg_img class=flag)
|
||||
nav#nav.bg_local(style=bg_img)
|
||||
include ./header.pug
|
||||
#page_site-info
|
||||
#site-title
|
||||
|
||||
@@ -54,6 +54,6 @@ each article , index in page.posts.data
|
||||
.more_setting
|
||||
a.more.more--border.more--primary.more--animated(href=url_for(link) + '#more' style="margin-top: 14px")= _p('read_more')
|
||||
else
|
||||
.content!= post_description
|
||||
.content!= article.description
|
||||
|
||||
|
||||
|
||||
6
layout/includes/related-posts.pug
Normal file
6
layout/includes/related-posts.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
.relatedPosts
|
||||
.relatedPosts_headline
|
||||
i.fa.fa-thumbs-up(aria-hidden="true")
|
||||
span=' ' + _p('relatedPosts_headline')
|
||||
.relatedPosts_list!= related_posts(page,site.posts)
|
||||
.clear_both
|
||||
@@ -10,7 +10,7 @@
|
||||
#local-stats
|
||||
#hr.local-search-stats__hr
|
||||
case config.language
|
||||
when "zh-Hans"
|
||||
when "zh-CN"
|
||||
span=_p("local_search.by")
|
||||
| #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search]
|
||||
| #[span=_p("local_search.powered")]
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.addthis_inline_share_toolbox.pull-right
|
||||
.addthis_inline_share_toolbox
|
||||
script(src=`//s7.addthis.com/js/300/addthis_widget.js#pubid=${theme.addThis.pubid}` async)
|
||||
@@ -1,13 +1,9 @@
|
||||
.addtoany
|
||||
.a2a_kit.a2a_kit_size_32.a2a_default_style
|
||||
a.a2a_button_facebook
|
||||
a.a2a_button_twitter
|
||||
a.a2a_button_wechat
|
||||
a.a2a_button_sina_weibo
|
||||
a.a2a_button_facebook_messenger
|
||||
a.a2a_button_email
|
||||
a.a2a_button_copy_link
|
||||
a.a2a_dd(href="https://www.addtoany.com/share")
|
||||
.a2a_kit.a2a_kit_size_32.a2a_default_style
|
||||
each name in theme.addtoany.item
|
||||
a(class="a2a_button_" + name)
|
||||
|
||||
a.a2a_dd(href="https://www.addtoany.com/share")
|
||||
script(async src="https://static.addtoany.com/menu/page.js")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user