From 9ff5328c88706d2025fd14c274c14d17712fa048 Mon Sep 17 00:00:00 2001 From: Endilie Yacop Sucipto Date: Sun, 24 Jun 2018 02:01:23 +0700 Subject: [PATCH] fix algolia version to use the correct version info, not 'current' (#797) --- lib/core/Site.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/core/Site.js b/lib/core/Site.js index e3b93b1a67..1bda0329c7 100644 --- a/lib/core/Site.js +++ b/lib/core/Site.js @@ -33,13 +33,11 @@ class Site extends React.Component { this.props.config.url + this.props.config.baseUrl + (this.props.url || 'index.html'); - let docsVersion = this.props.version || 'current'; + let docsVersion = this.props.version; - if (fs.existsSync(CWD + '/versions.json')) { + if (!docsVersion && fs.existsSync(CWD + '/versions.json')) { const latestVersion = require(CWD + '/versions.json')[0]; - if (docsVersion === latestVersion) { - docsVersion = 'current'; - } + docsVersion = latestVersion; } // We do not want a lang attribute for the html tag if we don't have a language set