mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-15 01:02:35 +02:00
fix(v1): fix broken links in example docs (#2453)
* fix(v1): add languages file to fix broken links * fix(v1): add languages file to fix broken links * fix(v1): change links for default website instead of introducing languages file * fix(v1): after linter run * fix(v1): fix my IDE's weird formatting * fix(v1): follow same indentation as the rest of the anchor tags * fix(v1): maybe I do need linter to run
This commit is contained in:
parent
ecfb55eee8
commit
bf3c7cc8f9
1 changed files with 6 additions and 16 deletions
|
@ -8,17 +8,11 @@
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
|
|
||||||
class Footer extends React.Component {
|
class Footer extends React.Component {
|
||||||
docUrl(doc, language) {
|
docUrl(doc) {
|
||||||
const baseUrl = this.props.config.baseUrl;
|
const baseUrl = this.props.config.baseUrl;
|
||||||
const docsUrl = this.props.config.docsUrl;
|
const docsUrl = this.props.config.docsUrl;
|
||||||
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
|
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
|
||||||
const langPart = `${language ? `${language}/` : ''}`;
|
return `${baseUrl}${docsPart}${doc}`;
|
||||||
return `${baseUrl}${docsPart}${langPart}${doc}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
pageUrl(doc, language) {
|
|
||||||
const baseUrl = this.props.config.baseUrl;
|
|
||||||
return baseUrl + (language ? `${language}/` : '') + doc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -37,21 +31,17 @@ class Footer extends React.Component {
|
||||||
</a>
|
</a>
|
||||||
<div>
|
<div>
|
||||||
<h5>Docs</h5>
|
<h5>Docs</h5>
|
||||||
<a href={this.docUrl('doc1.html', this.props.language)}>
|
<a href={this.docUrl('doc1.html')}>
|
||||||
Getting Started (or other categories)
|
Getting Started (or other categories)
|
||||||
</a>
|
</a>
|
||||||
<a href={this.docUrl('doc2.html', this.props.language)}>
|
<a href={this.docUrl('doc2.html')}>Guides (or other categories)</a>
|
||||||
Guides (or other categories)
|
<a href={this.docUrl('doc3.html')}>
|
||||||
</a>
|
|
||||||
<a href={this.docUrl('doc3.html', this.props.language)}>
|
|
||||||
API Reference (or other categories)
|
API Reference (or other categories)
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h5>Community</h5>
|
<h5>Community</h5>
|
||||||
<a href={this.pageUrl('users.html', this.props.language)}>
|
<a href={`${this.props.config.baseUrl}users`}>User Showcase</a>
|
||||||
User Showcase
|
|
||||||
</a>
|
|
||||||
<a
|
<a
|
||||||
href="https://stackoverflow.com/questions/tagged/"
|
href="https://stackoverflow.com/questions/tagged/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue