8000 Backport PR #26493: Disable ``add_html_cache_busting`` on Sphinx 7.1+ · QuLogic/matplotlib@6115784 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6115784

Browse files
story645QuLogic
authored andcommitted
Backport PR matplotlib#26493: Disable add_html_cache_busting on Sphinx 7.1+
(cherry picked from commit 48e2891)
1 parent ade5315 commit 6115784

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from urllib.parse import urlsplit, urlunsplit
2121
import warnings
2222

23+
import sphinx
24+
2325
import matplotlib
2426

2527
from datetime import timezone
@@ -347,6 +349,9 @@ def add_html_cache_busting(app, pagename, templatename, context, doctree):
347349
This adds the Matplotlib version as a query to the link reference in the
348350
HTML, if the path is not absolute (i.e., it comes from the `_static`
349351
directory) and doesn't already have a query.
352+
353+
.. note:: Sphinx 7.1 provides asset checksums; so this hook only runs on
354+
Sphinx 7.0 and earlier.
350355
"""
351356
from sphinx.builders.html import Stylesheet, JavaScript
352357

@@ -723,4 +728,5 @@ def setup(app):
723728
else:
724729
bld_type = 'rel'
725730
app.add_config_value('releaselevel', bld_type, 'env')
726-
app.connect('html-page-context', add_html_cache_busting, priority=1000)
731+
if sphinx.version_info[:2] < (7, 1):
732+
app.connect('html-page-context', add_html_cache_busting, priority=1000)

0 commit comments

Comments
 (0)
0