File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change
1
+ import hashlib
1
2
import os
2
3
import sys
3
4
import time
5
+ from pathlib import Path
4
6
5
7
# Location of custom extensions.
6
8
sys .path .insert (0 , os .path .abspath ("." ) + "/_extensions" )
32
34
'.github' ,
33
35
]
34
36
37
+ def _asset_hash (path : os .PathLike [str ]) -> str :
38
+ """Append a `?digest=` to an url based on the file content."""
39
+ full_path = (Path (html_static_path [0 ]) / path ).resolve ()
40
+ digest = hashlib .sha1 (full_path .read_bytes ()).hexdigest ()
41
+
42
+ return f"{ path } ?digest={ digest } "
43
+
44
+
35
45
html_theme = 'furo'
36
46
html_theme_options = {
37
47
"source_repository" : "https://github.com/python/devguide" ,
38
48
"source_branch" : "main" ,
39
49
}
40
50
html_static_path = ['_static' ]
41
51
html_css_files = [
42
- 'devguide_overrides.css' ,
52
+ _asset_hash ( 'devguide_overrides.css' ) ,
43
53
]
44
54
html_logo = "_static/python-logo.svg"
45
55
html_favicon = "_static/favicon.png"
You can’t perform that action at this time.
0 commit comments