Only first title in sidebar
Describe the bug
context
When I add .. toctree:: in index.rst like this:
Welcome to test's documentation!
================================
.. toctree::
:maxdepth: 2
:caption: Contents:
tmp.md
The content of tmp.md is:
# head1
# head2
## head2.1
expectation
After build the docs, I expected the sidebar (or so-called navbar) to have every first-level head of .md file, which is head1 and head2.
bug But instead, I got only the first title in sidebar like this:

Reproduce the bug
All files are compressed into test.zip:
test.zip
The main files of this zip are as follows:
index.rst:
.. test documentation master file, created by
sphinx-quickstart on Tue Sep 20 11:08:35 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to test's documentation!
================================
.. toctree::
:maxdepth: 2
:caption: Contents:
tmp.md
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
tmp.md
# head1
# head2
## head2.1
conf.py
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'test'
copyright = '2022, mei'
author = 'mei'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
# 'myst_parser',
'recommonmark',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.autosectionlabel',
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_book_theme'
html_static_path = ['_static']
List your environment
No response
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
I don’t see any captions in the sidebar currently, what happened?
I think this is intentional, but I'm finding myself wanting to be able to do the same, where there are multiple H1 headings, and having those show up on the primary sidebar. xref: https://github.com/executablebooks/sphinx-book-theme/issues/337