pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
565 stars 304 forks source link

Error when moving "sidebar-nav-bs" from html_sidebars to secondary_sidebar_items #1702

Open bryan-brancotte opened 5 months ago

bryan-brancotte commented 5 months ago

Hi,

Impacted version are 0.15.1 and 0.15.2 ; is working with 0.14.4 ; both using Sphinx==7.2.6

Here is a fragment of my conf.py:


html_theme_options = {
    "use_edit_page_button": True,
    "navigation_with_keys": True,
    "secondary_sidebar_items": [
        "sidebar-nav-bs",
        "page-toc",
        "sourcelink",
        "edit-this-page",
    ], # put section nav on the right
}
html_sidebars = { # remove left side bar as section are now on the right
  "**": []
}

Which throw me this error:

Extension error (pydata_sphinx_theme.utils):
Handler <function set_secondary_sidebar_items at 0x7faddc02b880> for event 'html-page-context' threw 
an exception (exception: Template requested to generate a TocTree fragment but no suitable ancestor 
found to act as root node. Please report this to theme developers.)
make: *** [Makefile:21: html] Error 2

When commenting "sidebar-nav-bs", is works, so does when moving it to html_sidebars as it is by default

If you need more information to spot the issue feel free to ask

Best wishes