Doc - Fix default version

This commit is contained in:
Anthony MOI
2020-10-05 15:30:22 -04:00
committed by Anthony MOI
parent 799954973d
commit 1da10c17ef

View File

@ -104,12 +104,12 @@ function addGithubButton() {
function addVersionControl() { function addVersionControl() {
// Default language and version // Default language and version
let language = defaultLanguage; let language = defaultLanguage;
let version = stableVersion[language];
// To grab the version currently in view, we parse the url // To grab the version currently in view, we parse the url
let parts = location.pathname.split('/'); let parts = location.pathname.split('/');
const languageIndex = parts.findIndex((part) => languages.includes(part)); const languageIndex = parts.findIndex((part) => languages.includes(part));
language = parts[languageIndex]; language = parts[languageIndex];
let version = stableVersion[language];
const versionIndex = languageIndex + 1; const versionIndex = languageIndex + 1;
// If a version is specified, update it // If a version is specified, update it