mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
🐛 1.修復首頁文章日期顯示錯誤的bug
🐛 2.修復因註釋掉豆瓣設置導致報Cannot read property 'meta' of undefined的bug 💄 3.調整文章頁post-meta和主頁post-meta的間距 💄 4.文章頁,當設置只顯示一個日期時,增加文字顯示
This commit is contained in:
parent
67c013d6e7
commit
c118e1e16a
@ -34,6 +34,7 @@ if theme.disable_baidu_transformation
|
||||
if page.hide == true
|
||||
meta(name="robots" content="noindex")
|
||||
|
||||
if theme.douban
|
||||
if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
|
||||
meta(name="referrer" content="no-referrer")
|
||||
|
||||
|
||||
@ -5,39 +5,44 @@
|
||||
if (theme.post_meta.post.date_type)
|
||||
if (theme.post_meta.post.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||
span.post-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
|
||||
- var data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||
- var date_type = data_type_update ? 'updated' : 'date'
|
||||
- var date_icon = data_type_update ? 'fa-history' :'fa-calendar'
|
||||
- var data_info = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
time.post-meta__date
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
=' ' + data_info + ' ' + date(page[date_type], config.date_format)
|
||||
|
||||
if (theme.post_meta.post.categories && page.categories.data.length > 0)
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta__separator |
|
||||
span
|
||||
each item, index in page.categories.data
|
||||
i.fa.fa-inbox.post-meta__icon.fa-fw(aria-hidden="true")
|
||||
i.fa.fa-inbox.post-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
||||
if (index < page.categories.data.length - 1)
|
||||
i.fa.fa-angle-right.fa-fw(aria-hidden="true")
|
||||
i.fa.fa-angle-right.post-meta__separator(aria-hidden="true")
|
||||
.post-meta-wordcount
|
||||
if (theme.wordcount && theme.wordcount.enable)
|
||||
- var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
|
||||
i.post-meta__icon.fa-fw(class=wordCountIcon aria-hidden="true")
|
||||
i.post-meta__icon(class=wordCountIcon aria-hidden="true")
|
||||
span= _p('post.wordcount') + ':'
|
||||
span.word-count= wordcount(page.content)
|
||||
span.post-meta__separator |
|
||||
- var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
|
||||
i.post-meta__icon.fa-fw(class=readCountIcon aria-hidden="true")
|
||||
i.post-meta__icon(class=readCountIcon aria-hidden="true")
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
.post-meta-pv-cv
|
||||
if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
if theme.busuanzi.page_pv
|
||||
i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
|
||||
i.fa.fa-eye.post-meta__icon(aria-hidden="true")
|
||||
span=_p('post.page_pv') + ':'
|
||||
span#busuanzi_value_page_pv
|
||||
|
||||
@ -45,21 +50,21 @@
|
||||
if ((theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
|
||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
span.disqus-comment-count.comment-count
|
||||
a(href=full_url_for(page.path) + '#disqus_thread')
|
||||
if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||
if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.gitalk-comment-count.comment-count
|
||||
|
||||
@ -19,14 +19,17 @@ mixin UI_NEW(posts)
|
||||
if (theme.post_meta.page.date_type)
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
||||
=date(page.date, config.date_format)
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=date(article.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
=date(page.updated, config.date_format)
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=date(article.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
|
||||
- var date_type = theme.post_meta.page.date_type === 'updated' ? 'updated' : 'date'
|
||||
- var date_icon = theme.post_meta.page.date_type === 'updated' ? 'fa-history' :'fa-calendar'
|
||||
time.post-meta__date
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
=date(article[date_type], config.date_format)
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
|
||||
@ -23,14 +23,17 @@ each article , index in page.posts.data
|
||||
if (theme.post_meta.page.date_type)
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
||||
=date(page.date, config.date_format)
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=date(article.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
=date(page.updated, config.date_format)
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=date(article.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
|
||||
- var date_type = theme.post_meta.page.date_type === 'updated' ? 'updated' : 'date'
|
||||
- var date_icon = theme.post_meta.page.date_type === 'updated' ? 'fa-history' :'fa-calendar'
|
||||
time.post-meta__date
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
=date(article[date_type], config.date_format)
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
@ -54,5 +57,3 @@ each article , index in page.posts.data
|
||||
.content!= expert
|
||||
else
|
||||
.content!= article.description
|
||||
|
||||
|
||||
|
||||
@ -101,6 +101,8 @@
|
||||
-webkit-box-orient: vertical
|
||||
|
||||
#post-meta
|
||||
font-size: 95%
|
||||
|
||||
.word-count,
|
||||
#busuanzi_value_page_pv,
|
||||
.comment-count
|
||||
|
||||
Loading…
Reference in New Issue
Block a user