File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 33
44from docutils import nodes
55from docutils .parsers .rst import directives
6+ from sphinx import version_info as sphinx_version
67from sphinx .application import Sphinx
78from sphinx .environment import BuildEnvironment
89from sphinx .transforms import SphinxTransform
@@ -67,9 +68,14 @@ def update_css_js(app: Sphinx):
6768 js_path .write_text (content )
6869 # Read the css content and hash it
6970 content = read_text (static_module , "style.min.css" )
70- hash = hashlib .md5 (content .encode ("utf8" )).hexdigest ()
7171 # 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"
7379 app .add_css_file (css_path .name )
7480 if css_path .exists ():
7581 return
You can’t perform that action at this time.
0 commit comments