Skip to content

Commit

Permalink
FIX: exit if non-html builder (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 authored Dec 12, 2023
1 parent 3053d2e commit bceac01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sphinx_external_toc/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def ensure_index_file(app: Sphinx, exception: Optional[Exception]) -> None:
redirect_url = f"{root_name}.html"
elif app.builder.name == "dirhtml":
redirect_url = f"{root_name}/index.html"
else:
return

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

0 comments on commit bceac01

Please sign in to comment.