From eae1b8bc646462a66801181e13d3a7c9abc2a076 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Mon, 22 Jul 2024 08:28:45 +0900 Subject: [PATCH] Fix a bug in version selector --- src/doc/common/static/jupyter-sphinx-furo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/common/static/jupyter-sphinx-furo.js b/src/doc/common/static/jupyter-sphinx-furo.js index b63de354db8..ad06a84d5a2 100644 --- a/src/doc/common/static/jupyter-sphinx-furo.js +++ b/src/doc/common/static/jupyter-sphinx-furo.js @@ -109,12 +109,12 @@ function changeVersion() { if (selected_url) { if (window.location.protocol == 'file:') { let pathname = window.location.pathname; - let cutoff_point = pathname.indexOf('doc/sage'); + let cutoff_point = pathname.indexOf('/html'); if (cutoff_point !== -1) { - pathname = pathname.substring(cutoff_point + 8); + pathname = pathname.substring(cutoff_point); window.location.href = selected_url + pathname; } else { - window.location.href = selected_url + 'html/en/index.html'; + window.location.href = selected_url + '/index.html'; } } else { window.location.href = selected_url + window.location.pathname;