File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
from docutils import nodes
5
5
from docutils .parsers .rst import directives
6
+ from sphinx import version_info as sphinx_version
6
7
from sphinx .application import Sphinx
7
8
from sphinx .environment import BuildEnvironment
8
9
from sphinx .transforms import SphinxTransform
@@ -67,9 +68,14 @@ def update_css_js(app: Sphinx):
67
68
js_path .write_text (content )
68
69
# Read the css content and hash it
69
70
content = read_text (static_module , "style.min.css" )
70
- hash = hashlib .md5 (content .encode ("utf8" )).hexdigest ()
71
71
# Write the css file
72
- css_path = static_path / f"design-style.{ hash } .min.css"
72
+ if sphinx_version < (7 , 1 ):
73
+ hash = hashlib .md5 (content .encode ("utf8" )).hexdigest ()
74
+ css_path = static_path / f"sphinx-design.{ hash } .min.css"
75
+ else :
76
+ # since sphinx 7.1 a checksum is added to the css file URL, so there is no need to do it here
77
+ # https://github.com/sphinx-doc/sphinx/pull/11415
78
+ css_path = static_path / "sphinx-design.min.css"
73
79
app .add_css_file (css_path .name )
74
80
if css_path .exists ():
75
81
return
You can’t perform that action at this time.
0 commit comments