mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 19:10:53 +08:00
feat: 增加 waline avatarCDN 配置(最新評論也會更新) feat: archives 的 標題 在 menu 配置中獲取 fix: 修復文章頁 mathjax 因字體小導致顯示重疊的 bug close #587 fix: 修復 mathjax 在列表下,導致 列表沒有樣式的 bug close #586 improvement: 減少卡頓,apple 裝置首頁背景 background-attachment 設為 scroll
50 lines
2.2 KiB
Plaintext
50 lines
2.2 KiB
Plaintext
if !theme.disable_top_img && page.top_img !== false
|
|
if is_post()
|
|
- var top_img = page.top_img || page.cover || page.randomcover
|
|
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() ? fragment_cache('findArchivesTitle', function(){return findArchivesTitle(theme.menu);}) : page.title || page.tag || page.category || config.title
|
|
- var isHomeClass = is_home() ? 'full_page' : 'not-home-page'
|
|
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
|
else
|
|
- var isHomeClass = 'not-top-img'
|
|
else
|
|
- var top_img = false
|
|
- var isHomeClass = 'not-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 |