Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f95e35a

Browse files
authored
Merge pull request #26547 from meeseeksmachine/auto-backport-of-pr-26493-on-v3.8.x
Backport PR #26493 on branch v3.8.x (Disable ``add_html_cache_busting`` on Sphinx 7.1+)
2 parents 92e771d + da2bb10 commit f95e35a

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
@@ -19,6 +19,8 @@
1919
import sys
2020
from urllib.parse import urlsplit, urlunsplit
2121
import warnings
22+
23+
import sphinx
2224
import yaml
2325

2426
import matplotlib
@@ -400,6 +402,9 @@ def add_html_cache_busting(app, pagename, templatename, context, doctree):
400402
This adds the Matplotlib version as a query to the link reference in the
401403
HTML, if the path is not absolute (i.e., it comes from the `_static`
402404
directory) and doesn't already have a query.
405+
406+
.. note:: Sphinx 7.1 provides asset checksums; so this hook only runs on
407+
Sphinx 7.0 and earlier.
403408
"""
404409
from sphinx.builders.html import Stylesheet, JavaScript
405410

@@ -780,4 +785,5 @@ def setup(app):
780785
bld_type = 'rel'
781786
app.add_config_value('skip_sub_dirs', 0, '')
782787
app.add_config_value('releaselevel', bld_type, 'env')
783-
app.connect('html-page-context', add_html_cache_busting, priority=1000)
788+
if sphinx.version_info[:2] < (7, 1):
789+
app.connect('html-page-context', add_html_cache_busting, priority=1000)

0 commit comments

Comments
 (0)