Skip to content
Merged
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
9 changes: 8 additions & 1 deletion src/sphinx_book_theme/header_buttons/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ def add_launch_buttons(
# If so, insert the URLs depending on the configuration
config_theme = app.config["html_theme_options"]
launch_buttons = config_theme.get("launch_buttons", {})
if not launch_buttons or not _is_notebook(app, pagename):
if (
not launch_buttons
or not _is_notebook(app, pagename)
or not any(
launch_buttons[key]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldnt we use launch_buttons.get(key) in case one is not present so we don't raise a key error?

for key in ("binderhub_url", "jupyterhub_url", "thebe", "colab_url")
)
):
return

# Grab the header buttons from context as it should already exist.
Expand Down