-
Notifications
You must be signed in to change notification settings - Fork 342
Make social buttons extendable #270
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
Comments
That sounds good to me! Should we give it a more generic name (eg "icon links" or so)? It's not necessarily only "social" links |
yeah that makes sense 👍 |
If this gets overhauled: it's likely worth adding some human-readable content to render in a tooltip/screen-reader discoverable way: pydata_social_buttons = {
{"title": "GitHub", "classes": "fab fa-github", "url": "https://github.com/pandas-dev/pydata-sphinx-theme"},
{"title": "Twitter", "classes": "fab fa-twitter-square", "url": "https://twitter.com/pandas-dev"},
} {% if social_buttons %}
<ul class="navbar-nav">
{% for button in social_buttons %}
<li class="nav-item">
<a class="nav-link" href="{{ button['url'] }}" target="_blank" rel="noopener" title="{{ button['title'] }}">
<span><i class="button['classes']"></i></span>
<span>{{ button['title'] }}</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %} |
#270 is doing what it says on the tin, but in thinking about deprecation cycles and testing: could we combine "external_links": [
{
"url": "https://pandas.pydata.org/pandas-docs/stable/",
"name": "Pandas Docs"
},
{
"url": "https://pypi.org/project/pydata-sphinx-theme",
"name": "PyPI",
"icon": "fab fa-python",
}
], |
Uh oh!
There was an error while loading. Please reload this page.
Right now we are hard-coding our social buttons here:
https://github.com/pandas-dev/pydata-sphinx-theme/blob/cc2551f97db509102c99421e758bffd2c527b305/pydata_sphinx_theme/docs-navbar.html#L38
It means that we need to manually add support for a new kind of button each time somebody wants one. We could instead make this a configurable list like so:
and so on.
Then the template code for adding the buttons would be:
and this could live in
_tempalates/social-buttons.html
. In the future we could then insert it into the sidebar/navbar/etc as users wish via other configuration valuesThe text was updated successfully, but these errors were encountered: