perf(config): optimize base_info.logo settings
This commit is contained in:
parent
2d80c45ec5
commit
49e0e1212f
12
_config.yml
12
_config.yml
|
@ -2,11 +2,19 @@
|
|||
# Your basic info
|
||||
# ---------------------------------------------------------------------------------------
|
||||
base_info:
|
||||
# Your website title
|
||||
title: Keep Theme
|
||||
|
||||
# Your blog author name
|
||||
author: Keep Team
|
||||
|
||||
# Your website url
|
||||
url: https://keep.xpoet.cn/
|
||||
# Logo image (You can use local image, image external link or don’t fill)
|
||||
logo_img:
|
||||
|
||||
# Your website logo image
|
||||
# You can use local image, image external link or don’t fill
|
||||
logo: /images/logo.svg
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------
|
||||
# Theme style settings
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
<header class="header-wrapper">
|
||||
|
||||
<%
|
||||
const { title, logo, logo_img } = theme.base_info
|
||||
const { title: configTitle } = config
|
||||
%>
|
||||
|
||||
<div class="header-content<%- (theme.style.first_screen.enable === true && is_home() && !page.prev) ? ' has-first-screen' : '' %>">
|
||||
<div class="left">
|
||||
<% if (theme.base_info.hasOwnProperty('logo_img') && theme.base_info.logo_img) { %>
|
||||
<% if (logo || logo_img) { %>
|
||||
<a class="logo-image" href="/">
|
||||
<%- image_tag(theme.base_info.logo_img) %>
|
||||
<%- image_tag(logo || logo_img) %>
|
||||
</a>
|
||||
<% } %>
|
||||
<a class="logo-title" href="/">
|
||||
<%= theme.base_info.title || config.title || 'Keep Theme' %>
|
||||
<%= title || configTitle || 'Keep Theme' %>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ $logo-image-box-width = 46px;
|
|||
}
|
||||
|
||||
|
||||
if (hexo-config('base_info.logo_img') && hexo-config('base_info.logo_img') != '') {
|
||||
if (hexo-config('base_info.logo_img') || hexo-config('base_info.logo')) {
|
||||
.logo-image {
|
||||
width: $logo-image-box-width;
|
||||
height: $logo-image-box-width;
|
||||
|
|
Loading…
Reference in New Issue