Skip to content

Commit

Permalink
show siteTitle if no logo (ppoffice#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
robberphex authored and 张旭 committed Jul 9, 2021
1 parent db9e663 commit f573d51
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion layout/common/footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
13 changes: 12 additions & 1 deletion layout/common/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit f573d51

Please sign in to comment.