mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 14:07:06 +08:00
Add the option to close the sidebar autopen
Fix the code font-size Add the post view fix runtimeshow bugs
This commit is contained in:
18
_config.yml
18
_config.yml
@@ -170,6 +170,10 @@ toc:
|
||||
enable: true
|
||||
number: true
|
||||
|
||||
# auto open the sidebar in 'post'
|
||||
auto_open_sidebar:
|
||||
enable: true
|
||||
|
||||
post_copyright:
|
||||
enable: true
|
||||
license: CC BY-NC-SA 4.0
|
||||
@@ -255,20 +259,9 @@ ICP:
|
||||
|
||||
# busuanzi count for PV / UV in site
|
||||
busuanzi:
|
||||
# count values only if the other configs are false
|
||||
enable: true
|
||||
# custom uv span for the whole site
|
||||
site_uv: true
|
||||
site_uv_header: <i class="fa fa-user"></i>
|
||||
site_uv_footer:
|
||||
# custom pv span for the whole site
|
||||
site_pv: true
|
||||
site_pv_header: <i class="fa fa-eye"></i>
|
||||
site_pv_footer:
|
||||
# custom pv span for one page only
|
||||
page_pv: false
|
||||
page_pv_header: <i class="fa fa-file-o"></i>
|
||||
page_pv_footer:
|
||||
page_pv: true
|
||||
|
||||
|
||||
|
||||
@@ -329,6 +322,7 @@ translate:
|
||||
|
||||
runtimeshow:
|
||||
enable: true
|
||||
start_date: 6/7/2018 00:00:00
|
||||
|
||||
|
||||
nightshift:
|
||||
|
||||
@@ -26,6 +26,7 @@ post:
|
||||
updated: Updated
|
||||
wordcount: Word count
|
||||
min2read: 'Reading time: %s min'
|
||||
page_pv: Post View
|
||||
copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
|
||||
@@ -26,6 +26,7 @@ post:
|
||||
updated: Updated
|
||||
wordcount: Word count
|
||||
min2read: 'Reading time: %s min'
|
||||
page_pv: Post View
|
||||
copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
|
||||
@@ -26,6 +26,7 @@ post:
|
||||
updated: 更新于
|
||||
wordcount: 字数总计
|
||||
min2read: '阅读时长: %s 分钟'
|
||||
page_pv: 阅读量
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章链接
|
||||
|
||||
@@ -30,6 +30,7 @@ post:
|
||||
wordcount: 字數總計
|
||||
commentcount: 評論數
|
||||
min2read: '閲讀時長: %s 分鐘'
|
||||
page_pv: 閲讀量
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章鏈接
|
||||
|
||||
@@ -108,14 +108,19 @@
|
||||
.webinfo_item
|
||||
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
||||
.webinfo_article_count= site.posts.length
|
||||
.webinfo_item
|
||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo_runtime_count.webinfo_runtime_count
|
||||
script(src=url_for('js/runtimeshow.js'))
|
||||
.webinfo_item
|
||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
||||
.webinfo_item
|
||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
||||
|
||||
if theme.runtimeshow.enable
|
||||
.webinfo_item
|
||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo_runtime_count.webinfo_runtime_count
|
||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
||||
|
||||
if theme.busuanzi.site_uv
|
||||
.webinfo_item
|
||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
||||
if theme.busuanzi.site_pv
|
||||
.webinfo_item
|
||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
.busuanzi
|
||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
||||
if(!is_post())
|
||||
if(theme.busuanzi.site_uv)
|
||||
span#busuanzi_container_site_uv!= theme.busuanzi.site_uv_header
|
||||
span#busuanzi_value_site_uv
|
||||
span!=theme.busuanzi.site_uv_footer
|
||||
if(theme.busuanzi.site_pv)
|
||||
if(theme.busuanzi.site_pv)
|
||||
span.footer-separator |
|
||||
span#busuanzi_container_site_pv!= theme.busuanzi.site_pv_header
|
||||
span#busuanzi_value_site_pv
|
||||
span!=theme.busuanzi.site_pv_footer
|
||||
else
|
||||
if(theme.busuanzi.page_pv)
|
||||
span#busuanzi_container_page_pv!= theme.busuanzi.page_pv_header
|
||||
span#busuanzi_value_page_pv
|
||||
span!=theme.busuanzi.page_pv_footer
|
||||
else
|
||||
if(theme.busuanzi.site_uv)
|
||||
span#busuanzi_container_site_uv!= theme.busuanzi.site_uv_header
|
||||
span#busuanzi_value_site_uv
|
||||
span!=theme.busuanzi.site_uv_footer
|
||||
if(theme.busuanzi.site_pv)
|
||||
if(theme.busuanzi.site_pv)
|
||||
span.footer-separator |
|
||||
span#busuanzi_container_site_pv!= theme.busuanzi.site_pv_header
|
||||
span#busuanzi_value_site_pv
|
||||
span!=theme.busuanzi.site_pv_footer
|
||||
@@ -12,16 +12,11 @@
|
||||
span Hexo
|
||||
span.footer-separator |
|
||||
span= _p('footer.theme') + ' '
|
||||
a(href='https://github.com/Molunerfinn/hexo-theme-melody')
|
||||
span Melody
|
||||
//- if theme.runtimeshow.enable
|
||||
//- script(src=url_for('js/runtimeshow.js'))
|
||||
//- div#span_dt_dt
|
||||
a(href='https://github.com/jerryc127/hexo-theme-butterfly')
|
||||
span Butterfly
|
||||
if theme.footer_custom_text
|
||||
.footer_custom_text!=`${theme.footer_custom_text}`
|
||||
if theme.ICP.enable
|
||||
.icp
|
||||
a(href=theme.ICP.url)
|
||||
span=theme.ICP.text
|
||||
//- if theme.busuanzi.enable
|
||||
//- include ./count/busuanzi.pug
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#page-header
|
||||
span.pull-left
|
||||
a#site-name(href=url_for('/')) #[=config.title]
|
||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||
//- i.fa.fa-bars.toggle-menu.pull-right(aria-hidden="true")
|
||||
.open.toggle-menu.pull-right
|
||||
.menu-icon-first
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#sidebar
|
||||
|
||||
- var sidebar_class = theme.auto_open_sidebar.enable === true ? 'auto_open' : ''
|
||||
|
||||
#sidebar(class=sidebar_class)
|
||||
- const showToc = is_post() && page.toc != false && theme.toc.enable
|
||||
-
|
||||
let tocNumber
|
||||
|
||||
@@ -49,7 +49,11 @@ block top_img
|
||||
span= _p('post.wordcount') + ': '
|
||||
span.word-count= wordcount(page.content)
|
||||
span.post-meta__separator |
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
if theme.busuanzi.page_pv
|
||||
span.post-meta__separator |
|
||||
span= _p('post.page_pv') + ': '
|
||||
span#busuanzi_value_page_pv
|
||||
|
||||
else
|
||||
div#top-container.plain
|
||||
@@ -61,10 +65,16 @@ block content
|
||||
#post-title.plain= page.title || _p('no_title')
|
||||
#post-meta
|
||||
if (theme.post_meta.date_type)
|
||||
//- - var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[= _p('created_date') + " "+ date(page['date'], config.date_format)]
|
||||
span.post-meta__separator |
|
||||
time.post-meta__update #[i.fa.fa-history(aria-hidden="true")] #[= _p('update_date') + " "+ date(page['updated'], config.date_format)]
|
||||
if (theme.post_meta.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||
span.post-meta__separator |
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
|
||||
|
||||
if (theme.post_meta.categories && page.categories.data.length > 0)
|
||||
if (theme.post_meta.date_type)
|
||||
|
||||
@@ -34,6 +34,9 @@ h6
|
||||
color: lighten($font-color, 15%)
|
||||
font-weight: bold
|
||||
|
||||
code
|
||||
font-size: inherit !important
|
||||
|
||||
#content-outer
|
||||
flex: 1 auto
|
||||
|
||||
|
||||
@@ -26,9 +26,3 @@ footer
|
||||
.footer-separator
|
||||
margin: 0 0.2rem
|
||||
|
||||
#busuanzi
|
||||
&_value
|
||||
&_site_uv,
|
||||
&_site_pv,
|
||||
&_page_pv
|
||||
margin-left: 0.2rem
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#post
|
||||
overflow: hidden
|
||||
text-align: justify
|
||||
|
||||
&-meta
|
||||
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)
|
||||
|
||||
@@ -1,32 +1,37 @@
|
||||
$(function () {
|
||||
if ($(".sidebar-toc__content").children().length > 0 ) {
|
||||
$(".layout_post").animate({}, function () {
|
||||
{
|
||||
setTimeout(function () {
|
||||
$('#page-header').addClass('open-sidebar')
|
||||
$("#toggle-sidebar").addClass('on')
|
||||
$('body').animate({
|
||||
paddingLeft: 300
|
||||
}, 200)
|
||||
$('#sidebar').animate({}, function () {
|
||||
$('#sidebar').css({
|
||||
'transform': 'translateX(300px)'
|
||||
},200)
|
||||
})
|
||||
$('#toggle-sidebar').animate({}, function () {
|
||||
$('#toggle-sidebar').css({
|
||||
'transform': 'rotateZ(180deg)',
|
||||
'color': '#99a9bf',
|
||||
'opacity': "1"
|
||||
if ($('#sidebar').hasClass('auto_open')) {
|
||||
if ($(".sidebar-toc__content").children().length > 0) {
|
||||
$(".layout_post").animate({}, function () {
|
||||
{
|
||||
setTimeout(function () {
|
||||
$('#page-header').addClass('open-sidebar')
|
||||
$("#toggle-sidebar").addClass('on')
|
||||
$('body').animate({
|
||||
paddingLeft: 300
|
||||
}, 200)
|
||||
$('#sidebar').animate({}, function () {
|
||||
$('#sidebar').css({
|
||||
'transform': 'translateX(300px)'
|
||||
}, 200)
|
||||
})
|
||||
$('#toggle-sidebar').animate({}, function () {
|
||||
$('#toggle-sidebar').css({
|
||||
'transform': 'rotateZ(180deg)',
|
||||
'color': '#99a9bf',
|
||||
'opacity': "1"
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
}
|
||||
else
|
||||
$("#toggle-sidebar").css("display", "none")
|
||||
}
|
||||
else {
|
||||
$('#toggle-sidebar').css('opacity', '1')
|
||||
}
|
||||
else
|
||||
$("#toggle-sidebar").css("display", "none")
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
function show_date_time(){
|
||||
// get user config
|
||||
var start_date = document.getElementById("runtionshow").getAttribute("start_date")
|
||||
|
||||
function show_date_time() {
|
||||
window.setTimeout("show_date_time()", 1000);
|
||||
BirthDay=new Date("6/7/2018 00:00:00");//這個日期是可以修改的
|
||||
BirthDay=new Date(start_date);//這個日期是可以修改的
|
||||
today=new Date();
|
||||
timeold=(today.getTime()-BirthDay.getTime());//其實僅僅改了這裏
|
||||
// sectimeold=timeold/1000
|
||||
|
||||
Reference in New Issue
Block a user