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:
Jerry
2019-06-08 22:37:30 +08:00
parent 1357f218e5
commit ee434f7dc4
16 changed files with 86 additions and 98 deletions

View File

@@ -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:

View File

@@ -26,6 +26,7 @@ post:
updated: Updated
wordcount: Word count
min2read: 'Reading time: %s min'
page_pv: Post View
copyright:
author: Author
link: Link

View File

@@ -26,6 +26,7 @@ post:
updated: Updated
wordcount: Word count
min2read: 'Reading time: %s min'
page_pv: Post View
copyright:
author: Author
link: Link

View File

@@ -26,6 +26,7 @@ post:
updated: 更新于
wordcount: 字数总计
min2read: '阅读时长: %s 分钟'
page_pv: 阅读量
copyright:
author: 文章作者
link: 文章链接

View File

@@ -30,6 +30,7 @@ post:
wordcount: 字數總計
commentcount: 評論數
min2read: '閲讀時長: %s 分鐘'
page_pv: 閲讀量
copyright:
author: 文章作者
link: 文章鏈接

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -50,6 +50,10 @@ block top_img
span.word-count= wordcount(page.content)
span.post-meta__separator |
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)

View File

@@ -34,6 +34,9 @@ h6
color: lighten($font-color, 15%)
font-weight: bold
code
font-size: inherit !important
#content-outer
flex: 1 auto

View File

@@ -26,9 +26,3 @@ footer
.footer-separator
margin: 0 0.2rem
#busuanzi
&_value
&_site_uv,
&_site_pv,
&_page_pv
margin-left: 0.2rem

View File

@@ -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)

View File

@@ -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")
//-------------------------------------------------------------------------------------------------------

View File

@@ -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