53 lines
1.8 KiB
Plaintext
53 lines
1.8 KiB
Plaintext
-
|
|
const returnTopImg = img => img !== false ? img || theme.default_top_img : false
|
|
const isFixedClass = theme.nav.fixed ? ' fixed' : ''
|
|
var top_img = false
|
|
let headerClassName = 'not-top-img'
|
|
var bg_img = ''
|
|
|
|
if !theme.disable_top_img && page.top_img !== false
|
|
if is_post()
|
|
- top_img = page.top_img || page.cover || theme.default_top_img
|
|
else if is_page()
|
|
- top_img = page.top_img || theme.default_top_img
|
|
else if is_tag()
|
|
- top_img = theme.tag_per_img && theme.tag_per_img[page.tag]
|
|
- top_img = top_img || returnTopImg(theme.tag_img)
|
|
else if is_category()
|
|
- top_img = theme.category_per_img && theme.category_per_img[page.category]
|
|
- top_img = top_img || returnTopImg(theme.category_img)
|
|
else if is_home()
|
|
- top_img = returnTopImg(theme.index_img)
|
|
else if is_archive()
|
|
- top_img = returnTopImg(theme.archive_img)
|
|
else
|
|
- top_img = page.top_img || theme.default_top_img
|
|
|
|
if top_img !== false
|
|
- bg_img = getBgPath(top_img)
|
|
- headerClassName = is_home() ? 'full_page' : is_post() ? 'post-bg' : 'not-home-page'
|
|
|
|
header#page-header(class=`${headerClassName + isFixedClass}` style=bg_img)
|
|
include ./nav.pug
|
|
if top_img !== false
|
|
if is_post()
|
|
include ./post-info.pug
|
|
else if is_home()
|
|
#site-info
|
|
h1#site-title=config.title
|
|
if theme.subtitle.enable
|
|
- var loadSubJs = true
|
|
#site-subtitle
|
|
span#subtitle
|
|
if theme.social
|
|
#site_social_icons
|
|
!=partial('includes/header/social', {}, {cache: true})
|
|
#scroll-down
|
|
i.fas.fa-angle-down.scroll-down-effects
|
|
else
|
|
#page-site-info
|
|
h1#site-title=page.title || page.tag || page.category
|
|
else
|
|
//- improvement seo
|
|
if !is_post()
|
|
h1.title-seo=page.title || page.tag || page.category || config.title |