Skip to content

Commit 8295087

Browse files
aadsmJoelMarcey
authored andcommitted
A bunch of tiny little fixes for issues I found while setting up docusaurus (facebook#312)
* Do not show users related UI if no users have been specified * Fixed typo in Docusaurus homepage link * Allow projects without icons Not every project has an icon, so avoid showing a broken image in that case. * Do not show project icon in the footer if there's no footer icon
1 parent e865ed8 commit 8295087

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

docusaurus-init/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## `docusaurus-init`
22

3-
An initialization script for [Docusaurus](https://docusuarus.io).
3+
An initialization script for [Docusaurus](https://docusaurus.io).
44

55
### What does it do?
66

examples/basics/core/Footer.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ class Footer extends React.Component {
1414
<footer className="nav-footer" id="footer">
1515
<section className="sitemap">
1616
<a href={this.props.config.baseUrl} className="nav-home">
17-
<img
18-
src={this.props.config.baseUrl + this.props.config.footerIcon}
19-
alt={this.props.config.title}
20-
width="66"
21-
height="58"
22-
/>
17+
{this.props.config.footerIcon && (
18+
<img
19+
src={this.props.config.baseUrl + this.props.config.footerIcon}
20+
alt={this.props.config.title}
21+
width="66"
22+
height="58"
23+
/>
24+
)}
2325
</a>
2426
<div>
2527
<h5>Docs</h5>

examples/basics/pages/en/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ const Description = props => (
167167
);
168168

169169
const Showcase = props => {
170+
if ((siteConfig.users||[]).length === 0) {
171+
return null;
172+
}
170173
const showcase = siteConfig.users
171174
.filter(user => {
172175
return user.pinned;

lib/core/nav/HeaderNav.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ class HeaderNav extends React.Component {
188188
<div className="headerWrapper wrapper">
189189
<header>
190190
<a href={this.props.baseUrl}>
191-
<img
192-
className="logo"
193-
src={this.props.baseUrl + siteConfig.headerIcon}
194-
/>
191+
{siteConfig.headerIcon && (
192+
<img
193+
className="logo"
194+
src={this.props.baseUrl + siteConfig.headerIcon}
195+
/>
196+
)}
195197
{!this.props.config.disableHeaderTitle && (
196198
<h2 className="headerTitle">{this.props.title}</h2>
197199
)}

0 commit comments

Comments
 (0)