mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-25 22:18:01 +02:00
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:
parent
e865ed88a0
commit
829508797e
4 changed files with 18 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
||||||
## `docusaurus-init`
|
## `docusaurus-init`
|
||||||
|
|
||||||
An initialization script for [Docusaurus](https://docusuarus.io).
|
An initialization script for [Docusaurus](https://docusaurus.io).
|
||||||
|
|
||||||
### What does it do?
|
### What does it do?
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,14 @@ class Footer extends React.Component {
|
||||||
<footer className="nav-footer" id="footer">
|
<footer className="nav-footer" id="footer">
|
||||||
<section className="sitemap">
|
<section className="sitemap">
|
||||||
<a href={this.props.config.baseUrl} className="nav-home">
|
<a href={this.props.config.baseUrl} className="nav-home">
|
||||||
|
{this.props.config.footerIcon && (
|
||||||
<img
|
<img
|
||||||
src={this.props.config.baseUrl + this.props.config.footerIcon}
|
src={this.props.config.baseUrl + this.props.config.footerIcon}
|
||||||
alt={this.props.config.title}
|
alt={this.props.config.title}
|
||||||
width="66"
|
width="66"
|
||||||
height="58"
|
height="58"
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</a>
|
</a>
|
||||||
<div>
|
<div>
|
||||||
<h5>Docs</h5>
|
<h5>Docs</h5>
|
||||||
|
|
|
@ -167,6 +167,9 @@ const Description = props => (
|
||||||
);
|
);
|
||||||
|
|
||||||
const Showcase = props => {
|
const Showcase = props => {
|
||||||
|
if ((siteConfig.users||[]).length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const showcase = siteConfig.users
|
const showcase = siteConfig.users
|
||||||
.filter(user => {
|
.filter(user => {
|
||||||
return user.pinned;
|
return user.pinned;
|
||||||
|
|
|
@ -188,10 +188,12 @@ class HeaderNav extends React.Component {
|
||||||
<div className="headerWrapper wrapper">
|
<div className="headerWrapper wrapper">
|
||||||
<header>
|
<header>
|
||||||
<a href={this.props.baseUrl}>
|
<a href={this.props.baseUrl}>
|
||||||
|
{siteConfig.headerIcon && (
|
||||||
<img
|
<img
|
||||||
className="logo"
|
className="logo"
|
||||||
src={this.props.baseUrl + siteConfig.headerIcon}
|
src={this.props.baseUrl + siteConfig.headerIcon}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
{!this.props.config.disableHeaderTitle && (
|
{!this.props.config.disableHeaderTitle && (
|
||||||
<h2 className="headerTitle">{this.props.title}</h2>
|
<h2 className="headerTitle">{this.props.title}</h2>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue