mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-10 21:38:10 +02:00
Rename latestVersion to defaultVersion (#639)
* Rename lastVersion to defaultVersion * Added defaultVersionShown to site-config doc * Remove defaultVersionShown from siteConfig * Update api-site-config.md
This commit is contained in:
parent
dbc597bfd7
commit
5771549e75
5 changed files with 12 additions and 8 deletions
|
@ -44,7 +44,7 @@ class Translation {
|
|||
class Versioning {
|
||||
constructor() {
|
||||
this.enabled = false;
|
||||
this.latestVersion = null;
|
||||
this.defaultVersion = null;
|
||||
this.versions = [];
|
||||
|
||||
this._load();
|
||||
|
@ -54,7 +54,7 @@ class Versioning {
|
|||
if (fs.existsSync(versions_json)) {
|
||||
this.enabled = true;
|
||||
this.versions = JSON.parse(fs.readFileSync(versions_json, 'utf8'));
|
||||
this.latestVersion = siteConfig.defaultVersionShown
|
||||
this.defaultVersion = siteConfig.defaultVersionShown
|
||||
? siteConfig.defaultVersionShown
|
||||
: this.versions[0]; // otherwise show the latest version (other than next/master)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue