A bunch of tiny little fixes for issues I found while setting up docusaurus (#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
This commit is contained in:
António Afonso 2017-12-18 09:26:33 -08:00 committed by Joel Marcey
parent e865ed88a0
commit 829508797e
4 changed files with 18 additions and 11 deletions

View file

@ -1,6 +1,6 @@
## `docusaurus-init`
An initialization script for [Docusaurus](https://docusuarus.io).
An initialization script for [Docusaurus](https://docusaurus.io).
### What does it do?

View file

@ -14,12 +14,14 @@ class Footer extends React.Component {
<footer className="nav-footer" id="footer">
<section className="sitemap">
<a href={this.props.config.baseUrl} className="nav-home">
{this.props.config.footerIcon && (
<img
src={this.props.config.baseUrl + this.props.config.footerIcon}
alt={this.props.config.title}
width="66"
height="58"
/>
)}
</a>
<div>
<h5>Docs</h5>

View file

@ -167,6 +167,9 @@ const Description = props => (
);
const Showcase = props => {
if ((siteConfig.users||[]).length === 0) {
return null;
}
const showcase = siteConfig.users
.filter(user => {
return user.pinned;

View file

@ -188,10 +188,12 @@ class HeaderNav extends React.Component {
<div className="headerWrapper wrapper">
<header>
<a href={this.props.baseUrl}>
{siteConfig.headerIcon && (
<img
className="logo"
src={this.props.baseUrl + siteConfig.headerIcon}
/>
)}
{!this.props.config.disableHeaderTitle && (
<h2 className="headerTitle">{this.props.title}</h2>
)}