fix algolia version to use the correct version info, not 'current' (#797)

This commit is contained in:
Endilie Yacop Sucipto 2018-06-24 02:01:23 +07:00 committed by GitHub
parent c5661b0e1e
commit 9ff5328c88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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