Skip to content

Commit

Permalink
FIX: adjust jupyterhub links (#285)
Browse files Browse the repository at this point in the history
* FIX: adjust jupyterhub links

* fix pre-commit

* v0.8.1 with bug fix
  • Loading branch information
mmcky authored Jan 30, 2025
1 parent 19b3c59 commit 615d6db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/quantecon_book_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from .launch import add_hub_urls

__version__ = "0.8.0"
__version__ = "0.8.1"
"""quantecon-book-theme version"""

SPHINX_LOGGER = logging.getLogger(__name__)
Expand Down
5 changes: 1 addition & 4 deletions src/quantecon_book_theme/assets/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ document.addEventListener("DOMContentLoaded", function () {
let urlpath = document.getElementById("launcher-private-input").dataset
.urlpath;
const repoPrefix =
"/jupyter/hub/user-redirect/git-pull?repo=" +
repo +
"&urlpath=" +
urlpath;
"/user-redirect/git-pull?repo=" + repo + "&urlpath=" + urlpath;
url = privateInput + repoPrefix + pagename + ".ipynb";
launchButton.getElementsByTagName("a")[0].setAttribute("href", url);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/quantecon_book_theme/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def add_hub_urls(

urlpath = ui_pre + "/" + repo + "/" + repo_subpath + path_rel_repo
url = (
f"{jupyterhub_url}/jupyter/hub/user-redirect/git-pull?"
f"{jupyterhub_url}/user-redirect/git-pull?"
f"repo={repo_url}&urlpath={urlpath}" # noqa: E501
f"&branch={branch}"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
function setLaunchServer() {
launchNotebookLink.removeAttribute("style")
if ( localStorage.launcherType == 'launcher-private' ) {
let repoPrefix = "/jupyter/hub/user-redirect/git-pull?repo=" + repoURL + "&branch=" + branch + "&urlpath=" + urlPath;
let repoPrefix = "/user-redirect/git-pull?repo=" + repoURL + "&branch=" + branch + "&urlpath=" + urlPath;
launcherPrivateValue = launcherPrivate.value
if (!launcherPrivateValue) {
launchNotebookLink.removeAttribute("href")
Expand Down

2 comments on commit 615d6db

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.