Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions sphinx/builders/html/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,6 @@ def get_doc_context(self, docname: str, body: str, metatags: str) -> dict[str, A
}

def write_doc(self, docname: str, doctree: nodes.document) -> None:
title_node = self.env.longtitles.get(docname)
title = self.render_partial(title_node)['title'] if title_node else ''
self.index_page(docname, doctree, title)

destination = StringOutput(encoding='utf-8')
doctree.settings = self.docsettings

Expand All @@ -678,6 +674,9 @@ def write_doc(self, docname: str, doctree: nodes.document) -> None:
def write_doc_serialized(self, docname: str, doctree: nodes.document) -> None:
self.imgpath = relative_uri(self.get_target_uri(docname), self.imagedir)
self.post_process_images(doctree)
title_node = self.env.longtitles.get(docname)
title = self.render_partial(title_node)['title'] if title_node else ''
self.index_page(docname, doctree, title)

def finish(self) -> None:
self.finish_tasks.add_task(self.gen_indices)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,10 @@ def test_nosearch(app):
assert 'latex' not in index['terms']
assert 'zfs' in index['terms']
assert index['terms']['zfs'] == [] # zfs on nosearch.rst is not registered to index


@pytest.mark.sphinx(testroot='search', parallel=3, freshenv=True)
def test_parallel(app):
app.build()
index = load_searchindex(app.outdir / 'searchindex.js')
assert index['docnames'] == ['index', 'nosearch', 'tocitem']