Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/nbclassic base url #168

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nbclassic/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def _prepare_templates(self):
base_dir, 'nbclassic/i18n'), fallback=True)
self.jinja2_env.install_gettext_translations(nbui, newstyle=False)
self.jinja2_env.globals.update(nbclassic_path=nbclassic_path)
self.jinja2_env.globals.update(nbclassic_tree=url_path_join(self.serverapp.base_url, nbclassic_path(), "tree"))
echarles marked this conversation as resolved.
Show resolved Hide resolved

def _link_jupyter_server_extension(self, serverapp):
# Monkey-patch Jupyter Server's and nbclassic's static path list to include
Expand Down
3 changes: 2 additions & 1 deletion nbclassic/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@

<div id="header" role="navigation" aria-label="{% trans %}Top Menu{% endtrans %}">
<div id="header-container" class="container">
<div id="ipython_notebook" class="nav navbar-brand"><a href="{{default_url}}
<div id="ipython_notebook" class="nav navbar-brand"><a href="
{%- if nbclassic_tree|length > 0 -%}{{nbclassic_tree}}{%- else -%}{{default_url}}{%- endif -%}
{%- if logged_in and token -%}?token={{token}}{%- endif -%}" title='{% trans %}dashboard{% endtrans %}'>
{% block logo %}<img src='{{static_url("base/images/logo.png") }}' alt='Jupyter Notebook'/>{% endblock %}
</a></div>
Expand Down