show siteTitle if no logo (#785)

This commit is contained in:
Robert LU 2020-09-09 02:06:52 +08:00 committed by GitHub
parent a57a3e15fd
commit 7784d964aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -15,12 +15,23 @@ class Footer extends Component {
visitorCounterTitle
} = this.props;
let footerLogo = '';
if (logo) {
if (logo.text) {
footerLogo = logo.text;
} else {
footerLogo = <img src={logoUrl} alt={siteTitle} height="28" />;
}
} else {
footerLogo = siteTitle;
}
return <footer class="footer">
<div class="container">
<div class="level">
<div class="level-start">
<a class="footer-logo is-block mb-2" href={siteUrl}>
{logo && logo.text ? logo.text : <img src={logoUrl} alt={siteTitle} height="28" />}
{footerLogo}
</a>
<p class="size-small">
<span dangerouslySetInnerHTML={{ __html: `&copy; ${siteYear} ${author || siteTitle}` }}></span>

View File

@ -28,11 +28,22 @@ class Navbar extends Component {
searchTitle
} = this.props;
let navbarLogo = '';
if (logo) {
if (logo.text) {
navbarLogo = logo.text;
} else {
navbarLogo = <img src={logoUrl} alt={siteTitle} height="28" />;
}
} else {
navbarLogo = siteTitle;
}
return <nav class="navbar navbar-main">
<div class="container">
<div class="navbar-brand justify-content-center">
<a class="navbar-item navbar-logo" href={siteUrl}>
{logo && logo.text ? logo.text : <img src={logoUrl} alt={siteTitle} height="28" />}
{navbarLogo}
</a>
</div>
<div class="navbar-menu">