Skip to content

Commit 6947195

Browse files
committed
Revert "BUG: do not add icon links if theme_options[icon_links] is None"
This reverts commit 7b5cedd.
1 parent 91c3609 commit 6947195

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

src/pydata_sphinx_theme/__init__.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ def update_config(app):
4040
)
4141

4242
# Validate icon links
43-
if theme_options.get("icon_links") is not None:
44-
if not isinstance(theme_options.get("icon_links", []), list):
45-
raise ExtensionError(
46-
"`icon_links` must be a list of dictionaries, you provided "
47-
f"type {type(theme_options.get('icon_links'))}."
48-
)
43+
if not isinstance(theme_options.get("icon_links", []), list):
44+
raise ExtensionError(
45+
"`icon_links` must be a list of dictionaries, you provided "
46+
f"type {type(theme_options.get('icon_links'))}."
47+
)
4948

5049
# Set the anchor link default to be # if the user hasn't provided their own
5150
if not utils.config_provided_by_user(app, "html_permalinks_icon"):
@@ -141,19 +140,18 @@ def update_config(app):
141140
# Add extra icon links entries if there were shortcuts present
142141
# TODO: Deprecate this at some point in the future?
143142
icon_links = theme_options.get("icon_links", [])
144-
if icon_links is not None:
145-
for url, icon, name in shortcuts:
146-
if theme_options.get(url):
147-
# This defaults to an empty list so we can always insert
148-
icon_links.insert(
149-
0,
150-
{
151-
"url": theme_options.get(url),
152-
"icon": icon,
153-
"name": name,
154-
"type": "fontawesome",
155-
},
156-
)
143+
for url, icon, name in shortcuts:
144+
if theme_options.get(url):
145+
# This defaults to an empty list so we can always insert
146+
icon_links.insert(
147+
0,
148+
{
149+
"url": theme_options.get(url),
150+
"icon": icon,
151+
"name": name,
152+
"type": "fontawesome",
153+
},
154+
)
157155
theme_options["icon_links"] = icon_links
158156

159157
# Prepare the logo config dictionary

0 commit comments

Comments
 (0)