Skip to content

Commit

Permalink
Make _add_asset_hashes a no-op with Sphinx 7.1
Browse files Browse the repository at this point in the history
This makes things work properly with the newest version of Sphinx, which
added new functionality.
  • Loading branch information
pradyunsg committed Jul 26, 2023
1 parent f8db95b commit a92dd0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/furo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ def _asset_hash(path: str) -> str:


def _add_asset_hashes(static: List[str], add_digest_to: List[str]) -> None:
if sphinx.version_info >= (7, 1):
# https://github.com/sphinx-doc/sphinx/pull/11415 added the relevant
# functionality to Sphinx, so we don't need to do anything.
return

for asset in add_digest_to:
index = static.index("_static/" + asset)
static[index].filename = _asset_hash(asset) # type: ignore
Expand Down

0 comments on commit a92dd0c

Please sign in to comment.