Skip to content

Commit 21adcf9

Browse files
authored
FIX: rework 104 to support e.g. PDFHTML (#105)
1 parent 34d2150 commit 21adcf9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sphinx_external_toc/events.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,11 @@ def ensure_index_file(app: Sphinx, exception: Optional[Exception]) -> None:
329329

330330
root_name = remove_suffix(app.config.master_doc, app.config.source_suffix)
331331

332-
if app.builder.name == "html":
333-
redirect_url = f"{root_name}.html"
334-
elif app.builder.name == "dirhtml":
332+
if app.builder.name == "dirhtml":
335333
redirect_url = f"{root_name}/index.html"
336334
else:
337-
return
335+
# Assume a single index for all non dir-HTML builders
336+
redirect_url = f"{root_name}.html"
338337

339338
redirect_text = f'<meta http-equiv="Refresh" content="0; url={redirect_url}" />\n'
340339
index_path.write_text(redirect_text, encoding="utf8")

0 commit comments

Comments
 (0)