Skip to content

Commit 3045dc3

Browse files
committed
Only add sphinx sidebar if the extension is loaded
1 parent 7d51c2c commit 3045dc3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/sunpy_sphinx_theme/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
SunPy Sphinx Theme.
33
"""
44

5-
import importlib
65
import json
76
import os
87
import posixpath
@@ -77,7 +76,7 @@ def update_config(app) -> None:
7776
):
7877
theme_options["rtd_extra_search_projects"] = [["sunpyorg", "https://sunpy.org"]]
7978

80-
if importlib.util.find_spec("sphinx_gallery"):
79+
if "sphinx_gallery.gen_gallery" in app.extensions:
8180
ssi = theme_options_with_defaults["secondary_sidebar_items"].split(",")
8281
if "sg_download_links" not in ssi:
8382
ssi.append("sg_download_links")

0 commit comments

Comments
 (0)