mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
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:
parent
4a3da1f30a
commit
a5e963dba1
8 changed files with 177 additions and 175 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue