-
Notifications
You must be signed in to change notification settings - Fork 339
What's the right way to set per-page secondary sidebar content? #1535
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
Is this doc page answering your question ? |
This addresses my use case but it would still be nice to set secondary sidebar content on a per-page basis (if we can do this with the primary sidebar, why not the secondary?). Thanks for the help! I'll keep this open since it seems like this isn't currently possible and might be a nice feature to add. |
the answer to "why not the secondary?" is that setting the primary sidebar content on a per-page basis is a feature of sphinx itself, not a feature of the theme. I suspect it would entail re-implementing a lot of sphinx machinery (and/or relying on aspects of the sphinx API that are not meant to be public) in order to get it to work. That's not to say we can't or won't do it someday, but my educated guess (without having tried any experiments) is that it would be hard. PR welcome from any motivated users :) |
@drammock Well, I figure we could just have a template that calls out to a python function to render secondary sidebar content depending on the current pagename. In any case if you'd like we can close this one out if it's too much work. |
hmm. that could work. I guess we could accept current configs like html_theme_options["secondary_sidebar_items"] = ['list', 'of', 'templates'] and internally convert them to html_theme_options["secondary_sidebar_items"] = {"**": ['list', 'of', 'templates']} and then in So, unless I'm missing something, not actually that hard. Thanks for pushing back on my pessimistic assessment. Wanna give it a shot? |
I'd love to! I'll make a PR later this week, if that works. |
I'm building my docs with the latest verison of
pydata-sphinx-theme
. I'd really like to have the secondary sidebar show up everywhere except in the docs landing page (index
). I noticed that the PST docs don't have a secondary sidebar on the landing page. From what I can tell, those docs are just using the default value fortheme_secondary_sidebar_items
, so I'm wondering if there's something more I need to do to prevent the secondary sidebar from rendering on the index.As a related issue, it would be nice to be able to set secondary sidebar templates on a per-page basis in the same way that we can already do by providing a dictionary to
html_sidebars
.The text was updated successfully, but these errors were encountered: