Skip to content
6 changes: 5 additions & 1 deletion src/pydata_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def update_config(app):
raise ExtensionError(
"`icon_links` must be a list of dictionaries, you provided "
f"type {type(theme_options.get('icon_links'))}."
"If you wish to disable this feature, either do not provide "
"a value (leave undefined), or set to an empty list."
)

# Set the anchor link default to be # if the user hasn't provided their own
Expand Down Expand Up @@ -282,7 +284,9 @@ def setup(app: Sphinx) -> Dict[str, str]:

app.add_html_theme("pydata_sphinx_theme", str(theme_path))

app.add_post_transform(short_link.ShortenLinkTransform)
theme_options = utils.get_theme_options_dict(app)
if theme_options.get("shorten_urls") is True:
app.add_post_transform(short_link.ShortenLinkTransform)

app.connect("builder-inited", translator.setup_translators)
app.connect("builder-inited", update_config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ logo_link =
surface_warnings = True
back_to_top_button = True
search_as_you_type = False
shorten_urls = True

# Template placement in theme layouts
navbar_start = navbar-logo
Expand Down
Loading