Skip to content

Commit

Permalink
🐛 BUG: fixing jupyterhub urls (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf authored Aug 8, 2020
1 parent c00e5df commit 6439b66
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@
html_theme_options = {
"path_to_docs": "docs",
"repository_url": "https://github.com/executablebooks/sphinx-book-theme",
# "repository_branch": "gh-pages", # For testing
"launch_buttons": {
"binderhub_url": "https://mybinder.org",
# "jupyterhub_url": "https://datahub.berkeley.edu", # For testing
"colab_url": "https://colab.research.google.com/",
"notebook_interface": "jupyterlab",
"thebe": True,
Expand Down
2 changes: 1 addition & 1 deletion sphinx_book_theme/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def add_hub_urls(app, pagename, templatename, context, doctree):
if jupyterhub_url:
url = (
f"{jupyterhub_url}/hub/user-redirect/git-pull?"
f"repo={repo_url}&urlpath={ui_pre}/{repo}/{path_rel_repo}"
f"repo={repo_url}&urlpath={ui_pre}/{repo}/{path_rel_repo}&branch={branch}"
)
context["jupyterhub_url"] = url

Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_repo_custombranch.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Binder
</button>
</a>
<a class="jupyterhub-button" href="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/executablebooks/sphinx-book-theme&amp;urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb">
<a class="jupyterhub-button" href="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/executablebooks/sphinx-book-theme&amp;urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&amp;branch=foo">
<button class="btn btn-secondary topbarbtn" data-placement="left" data-toggle="tooltip" title="Launch JupyterHub" type="button">
<img alt="Interact on JupyterHub" class="jupyterhub-button-logo" src="../_static/images/logo_jupyterhub.svg"/>
JupyterHub
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_topbar_launchbtns.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Binder
</button>
</a>
<a class="jupyterhub-button" href="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/executablebooks/sphinx-book-theme&amp;urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb">
<a class="jupyterhub-button" href="https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https://github.com/executablebooks/sphinx-book-theme&amp;urlpath=lab/tree/sphinx-book-theme/TESTPATH/section1/ntbk.ipynb&amp;branch=master">
<button class="btn btn-secondary topbarbtn" data-placement="left" data-toggle="tooltip" title="Launch JupyterHub" type="button">
<img alt="Interact on JupyterHub" class="jupyterhub-button-logo" src="../_static/images/logo_jupyterhub.svg"/>
JupyterHub
Expand Down

0 comments on commit 6439b66

Please sign in to comment.