-
Notifications
You must be signed in to change notification settings - Fork 317
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
Section navigation shows up even if it contains nothing #1662
Comments
I'm also seeing this. Originally my site consisted of two pages: an index and a "what's new". The index had a single hidden TOC with maxdepth 1. No customizations were done to the theme. No matter what I do I can't get rid of the left sidebar nor can I get it to display anything except "Section Navigation". Even if I add a third page nothing changes. I've tried unhiding the TOC. I've tried numbering the TOC. Nothing changes this from being just "Section Navigation". |
@djhoese and @Charlie-XIAO can you please provide
|
Of course, sorry. Here's the relevant packages:
Docs source: https://gitlab.ssec.wisc.edu/cspp_geo/geosphere/geosphere-docs Published site: https://geosphere.ssec.wisc.edu/docs/ Primary problem page (the only non-index page in my site): https://geosphere.ssec.wisc.edu/docs/whats-new.html Edit: The source repository includes a Dockerfile that does all the dependency installs and building of the site. |
@drammock Sorry for the late reply. The one I'm working on is the scikit-learn homepage, see scikit-learn/scikit-learn#28132. It is a bit too large, so I crafted a minimal reproducible example instead. The version is |
I think the cause is here: pydata-sphinx-theme/src/pydata_sphinx_theme/toctree.py Lines 74 to 77 in c04f042
This assumption does not seem to be correct. I opened #1682 to propose a fix. Hopefully it can be included in 0.15.3 otherwise I would have to pin 0.14.x in scikit-learn. |
That seems like valid logic to me unless I'm misunderstanding. In my case I have a parent TOC and the page I'm on could have a side bar, but the side bar is empty. |
@djhoese Sorry I'm a bit confused now. From what I see you have on the .. toctree::
:maxdepth: 1
:hidden:
whats-new and no toctree on the
But |
@djhoese using your docker image, I can make the sidebar disappear on your whats-new page by adding this to html_sidebars = {
'whats-new': []
} It is supposed to happen automatically when the sidebar elements are all empty, but for some buggy reason your whats-new page is ending up with a single empty TOC element: <div class="bd-toc-item navbar-nav"></div> If on the contrary you were expecting a TOC to actually appear there (below the "section navigation" heading) then there's a misunderstanding about the theme: your homepage is the site's root, and the whats-new page is the (only) first-level page; the left sidebar TOC by default would show any pages below that first-level page (of which there are none). The first-level pages only show up (by default) in the top navbar. @Charlie-XIAO I haven't had time to look at your site yet, but will try to do so soon. |
Honestly, I don't know. I think my thinking for my last comment was "if it is going to show the sidebar, then it must be considering the hidden TOC, so in that case there should be something shown". But yeah, if it isn't supposed to do anything with a hidden TOC as far as the sidebar goes then it makes sense that it is including the sidebar erroneously but the rest of the logic is correctly not finding anything to put in the sidebar (because it is hidden). @drammock Thanks. All my googling kept leading to the navigation and sidebars page here: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/navigation.html which doesn't mention the import html_sidebars configuration. I wouldn't have commented and looked through github issues if I would have just found this section from my searches: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#primary-sidebar-left Thanks everyone. |
Apply work-around for pydata/pydata-sphinx-theme#1662
This is introduced by #1632 I think. As seen in the screenshot, the section navigation is empty but still shows up.
The text was updated successfully, but these errors were encountered: