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

@ -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