-
Notifications
You must be signed in to change notification settings - Fork 338
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
Make icon links and link shortening optional #2109
base: main
Are you sure you want to change the base?
Conversation
f"type {type(theme_options.get('icon_links'))}." | ||
) | ||
if theme_options.get("icon_links") is not None: | ||
if not isinstance(theme_options.get("icon_links", []), list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see why on current main
, setting icon_links = None
in your conf.py
would cause an error here. But if you don't want icon links, why not just leave icon_links
undefined? Genuinely curious if there's a reason you need this.
}, | ||
) | ||
if icon_links is not None: | ||
for url, icon, name in shortcuts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question as above: the code on main
is fine if icon_links
is not defined, it only errors if you explicitly set icon_links=None
in the html_theme_options
dictionary of conf.py
. So why do that?
if theme_options.get("shorten_urls") is True: | ||
app.add_post_transform(short_link.ShortenLinkTransform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this change, you'll need to add shorten_urls
to src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf
and give it a default value (probably True
for backwards compatibility)
Hey @westurner. This PR has been open for a while. I was wondering if you could get it over the finish line or if we should see if someone in the PST team can help get this wrapped up? Thanks for your contribution 🌻 |
Sorry, I don't mean to block. Anyone is welcome to take this |
Backwards compatible:
Not backwards compatible:
dont_shorten_urls=True
instead ofshorten_urls=True