diff --git a/_config.yml b/_config.yml
index 835e610..bf70093 100644
--- a/_config.yml
+++ b/_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:
- site_uv_footer:
- # custom pv span for the whole site
site_pv: true
- site_pv_header:
- site_pv_footer:
- # custom pv span for one page only
- page_pv: false
- page_pv_header:
- page_pv_footer:
+ page_pv: true
@@ -329,6 +322,7 @@ translate:
runtimeshow:
enable: true
+ start_date: 6/7/2018 00:00:00
nightshift:
diff --git a/languages/default.yml b/languages/default.yml
index d5469a5..141d27d 100644
--- a/languages/default.yml
+++ b/languages/default.yml
@@ -26,6 +26,7 @@ post:
updated: Updated
wordcount: Word count
min2read: 'Reading time: %s min'
+ page_pv: Post View
copyright:
author: Author
link: Link
diff --git a/languages/en.yml b/languages/en.yml
index e1ccebc..622309c 100644
--- a/languages/en.yml
+++ b/languages/en.yml
@@ -26,6 +26,7 @@ post:
updated: Updated
wordcount: Word count
min2read: 'Reading time: %s min'
+ page_pv: Post View
copyright:
author: Author
link: Link
diff --git a/languages/zh-Hans.yml b/languages/zh-Hans.yml
index 7281fe2..ab256e6 100644
--- a/languages/zh-Hans.yml
+++ b/languages/zh-Hans.yml
@@ -26,6 +26,7 @@ post:
updated: 更新于
wordcount: 字数总计
min2read: '阅读时长: %s 分钟'
+ page_pv: 阅读量
copyright:
author: 文章作者
link: 文章链接
diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml
index f4973a3..171cc38 100644
--- a/languages/zh-TW.yml
+++ b/languages/zh-TW.yml
@@ -30,6 +30,7 @@ post:
wordcount: 字數總計
commentcount: 評論數
min2read: '閲讀時長: %s 分鐘'
+ page_pv: 閲讀量
copyright:
author: 文章作者
link: 文章鏈接
diff --git a/layout/includes/aside.pug b/layout/includes/aside.pug
index 0c1f4aa..714991a 100644
--- a/layout/includes/aside.pug
+++ b/layout/includes/aside.pug
@@ -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
diff --git a/layout/includes/count/busuanzi.pug b/layout/includes/count/busuanzi.pug
deleted file mode 100644
index 9bec29c..0000000
--- a/layout/includes/count/busuanzi.pug
+++ /dev/null
@@ -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
\ No newline at end of file
diff --git a/layout/includes/footer.pug b/layout/includes/footer.pug
index 09b0b4a..61c4854 100644
--- a/layout/includes/footer.pug
+++ b/layout/includes/footer.pug
@@ -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
diff --git a/layout/includes/header.pug b/layout/includes/header.pug
index 29d8682..d655421 100644
--- a/layout/includes/header.pug
+++ b/layout/includes/header.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
diff --git a/layout/includes/sidebar.pug b/layout/includes/sidebar.pug
index a804f50..2e49cc2 100644
--- a/layout/includes/sidebar.pug
+++ b/layout/includes/sidebar.pug
@@ -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
diff --git a/layout/post.pug b/layout/post.pug
index 4705321..8c9d36b 100644
--- a/layout/post.pug
+++ b/layout/post.pug
@@ -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)
diff --git a/source/css/_global/index.styl b/source/css/_global/index.styl
index ea09790..a412531 100644
--- a/source/css/_global/index.styl
+++ b/source/css/_global/index.styl
@@ -34,6 +34,9 @@ h6
color: lighten($font-color, 15%)
font-weight: bold
+ code
+ font-size: inherit !important
+
#content-outer
flex: 1 auto
diff --git a/source/css/_layout/footer.styl b/source/css/_layout/footer.styl
index 5dfeaa5..6530b67 100644
--- a/source/css/_layout/footer.styl
+++ b/source/css/_layout/footer.styl
@@ -26,9 +26,3 @@ footer
.footer-separator
margin: 0 0.2rem
-#busuanzi
- &_value
- &_site_uv,
- &_site_pv,
- &_page_pv
- margin-left: 0.2rem
\ No newline at end of file
diff --git a/source/css/_layout/post.styl b/source/css/_layout/post.styl
index dffebcc..d46fc93 100644
--- a/source/css/_layout/post.styl
+++ b/source/css/_layout/post.styl
@@ -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)
diff --git a/source/js/main.js b/source/js/main.js
index c8483d8..0698afd 100644
--- a/source/js/main.js
+++ b/source/js/main.js
@@ -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")
//-------------------------------------------------------------------------------------------------------
diff --git a/source/js/runtimeshow.js b/source/js/runtimeshow.js
index 8bf8cf5..f054162 100644
--- a/source/js/runtimeshow.js
+++ b/source/js/runtimeshow.js
@@ -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