mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
🐛 2.修復因註釋掉豆瓣設置導致報Cannot read property 'meta' of undefined的bug 💄 3.調整文章頁post-meta和主頁post-meta的間距 💄 4.文章頁,當設置只顯示一個日期時,增加文字顯示
71 lines
3.9 KiB
Plaintext
71 lines
3.9 KiB
Plaintext
#post-info
|
|
#post-title
|
|
.posttitle= page.title || _p('no_title')
|
|
#post-meta
|
|
if (theme.post_meta.post.date_type)
|
|
if (theme.post_meta.post.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 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(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.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(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(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(aria-hidden="true")
|
|
span=_p('post.page_pv') + ':'
|
|
span#busuanzi_value_page_pv
|
|
|
|
- var commentCount = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-comments' : 'fa fa-comment-o'
|
|
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(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(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(class=commentCount aria-hidden="true")
|
|
span= _p('post.comments') + ':'
|
|
a(href=url_for(page.path) + '#post-comment')
|
|
span.gitalk-comment-count.comment-count
|