mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-27 16:06:59 +02:00
Fix correct linking when setting defaultVersionShown to non-latest version (#894)
This commit is contained in:
parent
3f896c8e18
commit
8f9f7a5602
3 changed files with 5 additions and 2 deletions
|
@ -45,6 +45,7 @@ class Translation {
|
|||
class Versioning {
|
||||
constructor() {
|
||||
this.enabled = false;
|
||||
this.latestVersion = null;
|
||||
this.defaultVersion = null;
|
||||
this.versions = [];
|
||||
this.missingVersionsPage = false;
|
||||
|
@ -64,9 +65,10 @@ class Versioning {
|
|||
if (fs.existsSync(versionsJSONFile)) {
|
||||
this.enabled = true;
|
||||
this.versions = JSON.parse(fs.readFileSync(versionsJSONFile, 'utf8'));
|
||||
this.latestVersion = this.versions[0];
|
||||
this.defaultVersion = siteConfig.defaultVersionShown
|
||||
? siteConfig.defaultVersionShown
|
||||
: this.versions[0]; // otherwise show the latest version (other than next/master)
|
||||
: this.latestVersion; // otherwise show the latest version (other than next/master)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(versionsFile)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue