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 enable: true
number: true number: true
# auto open the sidebar in 'post'
auto_open_sidebar:
enable: true
post_copyright: post_copyright:
enable: true enable: true
license: CC BY-NC-SA 4.0 license: CC BY-NC-SA 4.0
@@ -255,20 +259,9 @@ ICP:
# busuanzi count for PV / UV in site # busuanzi count for PV / UV in site
busuanzi: busuanzi:
# count values only if the other configs are false
enable: true
# custom uv span for the whole site
site_uv: true 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: true
site_pv_header: <i class="fa fa-eye"></i> page_pv: true
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:
@@ -329,6 +322,7 @@ translate:
runtimeshow: runtimeshow:
enable: true enable: true
start_date: 6/7/2018 00:00:00
nightshift: nightshift:

View File

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

View File

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

View File

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

View File

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

View File

@@ -108,13 +108,18 @@
.webinfo_item .webinfo_item
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :" .webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
.webinfo_article_count= site.posts.length .webinfo_article_count= site.posts.length
if theme.runtimeshow.enable
.webinfo_item .webinfo_item
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :" .webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
#webinfo_runtime_count.webinfo_runtime_count #webinfo_runtime_count.webinfo_runtime_count
script(src=url_for('js/runtimeshow.js')) script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
if theme.busuanzi.site_uv
.webinfo_item .webinfo_item
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :" .webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
.webinfo_site_uv_count#busuanzi_value_site_uv .webinfo_site_uv_count#busuanzi_value_site_uv
if theme.busuanzi.site_pv
.webinfo_item .webinfo_item
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :" .webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
.webinfo_site_pv_count#busuanzi_value_site_pv .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 Hexo
span.footer-separator | span.footer-separator |
span= _p('footer.theme') + ' ' span= _p('footer.theme') + ' '
a(href='https://github.com/Molunerfinn/hexo-theme-melody') a(href='https://github.com/jerryc127/hexo-theme-butterfly')
span Melody span Butterfly
//- if theme.runtimeshow.enable
//- script(src=url_for('js/runtimeshow.js'))
//- div#span_dt_dt
if theme.footer_custom_text if theme.footer_custom_text
.footer_custom_text!=`${theme.footer_custom_text}` .footer_custom_text!=`${theme.footer_custom_text}`
if theme.ICP.enable if theme.ICP.enable
.icp .icp
a(href=theme.ICP.url) a(href=theme.ICP.url)
span=theme.ICP.text span=theme.ICP.text
//- if theme.busuanzi.enable
//- include ./count/busuanzi.pug

View File

@@ -1,6 +1,6 @@
#page-header #page-header
span.pull-left 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") //- i.fa.fa-bars.toggle-menu.pull-right(aria-hidden="true")
.open.toggle-menu.pull-right .open.toggle-menu.pull-right
.menu-icon-first .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 - const showToc = is_post() && page.toc != false && theme.toc.enable
- -
let tocNumber let tocNumber

View File

@@ -50,6 +50,10 @@ block top_img
span.word-count= wordcount(page.content) span.word-count= wordcount(page.content)
span.post-meta__separator | 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 else
div#top-container.plain div#top-container.plain
@@ -61,10 +65,16 @@ block content
#post-title.plain= page.title || _p('no_title') #post-title.plain= page.title || _p('no_title')
#post-meta #post-meta
if (theme.post_meta.date_type) if (theme.post_meta.date_type)
//- - var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date' if (theme.post_meta.date_type === 'both')
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[= _p('created_date') + " "+ date(page['date'], config.date_format)] time.post-meta__date
i.fa.fa-calendar(aria-hidden="true")
=' '+_p('post.created')+' '+date(page.date, config.date_format)
span.post-meta__separator | span.post-meta__separator |
time.post-meta__update #[i.fa.fa-history(aria-hidden="true")] #[= _p('update_date') + " "+ date(page['updated'], config.date_format)] 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.categories && page.categories.data.length > 0)
if (theme.post_meta.date_type) if (theme.post_meta.date_type)

View File

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

View File

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

View File

@@ -13,6 +13,7 @@
#post #post
overflow: hidden overflow: hidden
text-align: justify
&-meta &-meta
text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15) text-shadow: 0.1rem 0.1rem 0.2rem rgba(0, 0, 0, 0.15)

View File

@@ -1,4 +1,5 @@
$(function () { $(function () {
if ($('#sidebar').hasClass('auto_open')) {
if ($(".sidebar-toc__content").children().length > 0) { if ($(".sidebar-toc__content").children().length > 0) {
$(".layout_post").animate({}, function () { $(".layout_post").animate({}, function () {
{ {
@@ -27,6 +28,10 @@ $(function () {
} }
else else
$("#toggle-sidebar").css("display", "none") $("#toggle-sidebar").css("display", "none")
}
else {
$('#toggle-sidebar').css('opacity', '1')
}
//------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------

View File

@@ -1,6 +1,9 @@
// get user config
var start_date = document.getElementById("runtionshow").getAttribute("start_date")
function show_date_time() { function show_date_time() {
window.setTimeout("show_date_time()", 1000); window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("6/7/2018 00:00:00");//這個日期是可以修改的 BirthDay=new Date(start_date);//這個日期是可以修改的
today=new Date(); today=new Date();
timeold=(today.getTime()-BirthDay.getTime());//其實僅僅改了這裏 timeold=(today.getTime()-BirthDay.getTime());//其實僅僅改了這裏
// sectimeold=timeold/1000 // sectimeold=timeold/1000