Skip to content

Return empty toctree for missing TOC#264

Open
Herrtian wants to merge 1 commit into
readthedocs:mainfrom
Herrtian:return-empty-toctree
Open

Return empty toctree for missing TOC#264
Herrtian wants to merge 1 commit into
readthedocs:mainfrom
Herrtian:return-empty-toctree

Conversation

@Herrtian

Copy link
Copy Markdown

Closes #253.

Return an empty toctree fragment when a 404 page has no TOC, so templates get a string instead of None.

Checks:

  • uv run --with pytest --with defusedxml pytest tests/test_urls.py::test_empty_toctree_returns_empty_string -q
  • uv run --with pytest --with defusedxml pytest tests/test_urls.py::test_toctree_urls_notfound_default tests/test_urls.py::test_toctree_links tests/test_urls.py::test_toctree_links_custom_settings -q
  • git diff --check

@Herrtian Herrtian requested a review from a team as a code owner May 18, 2026 08:54
@Herrtian Herrtian requested a review from ericholscher May 18, 2026 08:54
@ericholscher ericholscher requested a review from humitos May 18, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with pydata-sphinx-theme and an empty toctree

1 participant