Fixing Issue 305 - broken links because of language (#316)

* without having having to worry about site design.

Let me know if double having is intentional

* distinguish case of no translation and en lang

* prettier recommends

* distinguish case of no translation and en lang

* prettier recommends

* merge with latest origin/master changes

* typo
This commit is contained in:
Richard Zhang 2017-12-19 09:20:32 -08:00 committed by Joel Marcey
parent f52e12df84
commit 7dc6c6c2da
7 changed files with 161 additions and 163 deletions

View file

@ -19,11 +19,11 @@ function imgUrl(img) {
}
function docUrl(doc, language) {
return siteConfig.baseUrl + 'docs/' + language + '/' + doc;
return siteConfig.baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
}
function pageUrl(page, language) {
return siteConfig.baseUrl + language + '/' + page;
return siteConfig.baseUrl + (language ? language + '/' : '') + page;
}
class Button extends React.Component {
@ -73,7 +73,7 @@ const PromoSection = props => (
class HomeSplash extends React.Component {
render() {
let language = this.props.language || 'en';
let language = this.props.language || '';
return (
<SplashContainer>
<Logo img_src={imgUrl('docusaurus.svg')} />