Issue 305 broken link because of language fixes (#322)

* 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

* link with language fixes

* do not show language dropdown if only one enabled

* check translation outside of LanguageDropDown.render
This commit is contained in:
Richard Zhang 2017-12-19 17:44:43 -08:00 committed by Joel Marcey
parent 4a3da1f30a
commit a5e963dba1
8 changed files with 177 additions and 175 deletions

View file

@ -8,6 +8,16 @@
const React = require('react');
class Footer extends React.Component {
docUrl(doc, language) {
const baseUrl = this.props.config.baseUrl;
return baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
}
pageUrl(doc, language) {
const baseUrl = this.props.config.baseUrl;
return baseUrl + (language ? language + '/' : '') + doc;
}
render() {
const currentYear = new Date().getFullYear();
return (
@ -25,40 +35,19 @@ class Footer extends React.Component {
</a>
<div>
<h5>Docs</h5>
<a
href={
this.props.config.baseUrl +
'docs/' +
this.props.language +
'/doc1.html'
}>
<a href={this.docUrl('doc1.html', this.props.language)}>
Getting Started (or other categories)
</a>
<a
href={
this.props.config.baseUrl +
'docs/' +
this.props.language +
'/doc2.html'
}>
<a href={this.docUrl('doc2.html', this.props.language)}>
Guides (or other categories)
</a>
<a
href={
this.props.config.baseUrl +
'docs/' +
this.props.language +
'/doc3.html'
}>
<a href={this.docUrl('doc3.html', this.props.language)}>
API Reference (or other categories)
</a>
</div>
<div>
<h5>Community</h5>
<a
href={
this.props.config.baseUrl + this.props.language + '/users.html'
}>
<a href={this.pageUrl('users.html', this.props.language)}>
User Showcase
</a>
<a