sphinx-book-theme
sphinx-book-theme copied to clipboard
Add badges and icon links to sidebar
With the alabaster theme I like that you can have badges added to the sidebar (and a description), e.g.
See https://github.com/bitprophet/alabaster/blob/master/alabaster/theme.conf for all options
Implementation
The easiest way to do this would be to support the Icon Links functionality from the pydata theme:
- https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/header-links.html#icon-links
You can modify the sidebar yourself by setting html_sidebars
.
I discovered that was the case when I migrated from the rtd-theme, since I had it set and it made the sidebar use the old structure.
Example:
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
"**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"],
}
Not sure what you need to set it to to keep the structure used in this theme (with the addition of your badges), but should be easy for you to figure out if you dig through the source :)