mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:40:55 +08:00
feat: 可配置最新評論的緩存時間 fix: 修復pjax下不會跳轉404頁面的bug fix: 修復手持設備橫向翻轉時,menu 沒有進行判斷,而導致樣式錯亂的bug fix: 修復文字點擊關閉random無效的bug fix: 修復子目錄下,打賞圖片跳轉鏈接會錯誤的bug improvement: 文章版權右上角改為 版權icon improvement: pangu的操作範圍增大到 body-wrap裏的內容 improvement: pug 判斷優化 improvement: 最新評論js優化 remove: 移除 fragment_cache 配置(默認開啟) remove: 移除百度推送(百度已棄用)和百度轉碼
51 lines
2.1 KiB
Plaintext
51 lines
2.1 KiB
Plaintext
if !theme.disable_top_img && page.top_img !== false
|
|
if is_post()
|
|
- var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
|
|
else if is_page()
|
|
- var top_img = page.top_img || theme.default_top_img
|
|
else if is_tag()
|
|
- var top_img = theme.tag_per_img && theme.tag_per_img[page.tag]
|
|
- top_img = top_img ? top_img : (theme.tag_img !== false ? theme.tag_img || theme.default_top_img : false)
|
|
else if is_category()
|
|
- var top_img = theme.category_per_img && theme.category_per_img[page.category]
|
|
- top_img = top_img ? top_img : (theme.category_img !== false ? theme.category_img || theme.default_top_img : false)
|
|
else if is_home()
|
|
- var top_img = theme.index_img !== false ? theme.index_img || theme.default_top_img : false
|
|
else if is_archive()
|
|
- var top_img = theme.archive_img !== false ? theme.archive_img || theme.default_top_img : false
|
|
else
|
|
- var top_img = page.top_img || theme.default_top_img
|
|
|
|
if top_img !== false
|
|
- var imgSource = top_img && top_img.indexOf('/') !== -1 ? `background-image: url('${url_for(top_img)}')` : `background: ${top_img}`
|
|
- var bg_img = top_img ? imgSource : ''
|
|
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
|
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
|
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
|
else
|
|
- var isHomeClass = 'no-top-img'
|
|
else
|
|
- var top_img = false
|
|
- var isHomeClass = 'no-top-img'
|
|
|
|
header#page-header(class=isHomeClass style=bg_img)
|
|
!=partial('includes/header/nav', {}, {cache: true})
|
|
if top_img !== false
|
|
if is_post()
|
|
include ./post-info.pug
|
|
else if is_home()
|
|
#site-info
|
|
h1#site-title=site_title
|
|
if theme.subtitle.enable
|
|
- var loadSubJs = true
|
|
#site-subtitle
|
|
span#subtitle
|
|
if(theme.social)
|
|
#site_social_icons
|
|
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
|
#scroll-down
|
|
i.fas.fa-angle-down.scroll-down-effects
|
|
else
|
|
#page-site-info
|
|
h1#site-title=site_title
|