Skip to content

Commit

Permalink
fix: Solved that enable op_image is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyib committed Sep 14, 2019
1 parent ffbc296 commit 2ff7190
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
5 changes: 4 additions & 1 deletion layout/_layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ html(lang=config.language)
body
div#container.container
header#header.header
div.header-inner
div.header-inner(style=`${
theme.header.bg_image.enable &&
page.top_image ? 'background: url(' + page.top_image + ') no-repeat center/cover;' : ''
}`)
!= partial('./_partials/header/header.pug', null, { cache: theme.cache })

main#main.main
Expand Down
16 changes: 11 additions & 5 deletions layout/_third-party/pjax.pug
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
-
var pjaxSelectors = [
'head title',
'#main',
'.pjax-reload'
];
if (theme.header.bg_image.enable) {
pjaxSelectors.push('.header-inner');
}
var pjaxArgs = {
'selectors': [
'head title',
'#main',
'.pjax-reload'
],
'selectors': pjaxSelectors,
'history': theme.pjax.history,
'scrollTo': theme.pjax.scrollTo,
'scrollRestoration': theme.pjax.scrollRestoration,
Expand Down
5 changes: 1 addition & 4 deletions source/css/_common/components/header/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
height: convert(hexo-config('header.height') || '80vh');
}

if (hexo-config('page.top_image')) {
background: url(hexo-config('page.top_image')) no-repeat center center;
background-size: cover;
} else if (hexo-config('header.bg_image.enable')) {
if (hexo-config('header.bg_image.enable')) {
background: url(hexo-config('header.bg_image.url')) no-repeat center center;
background-size: cover;
}
Expand Down

0 comments on commit 2ff7190

Please sign in to comment.