File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,13 @@ def _generate_redirects(app, exception):
7676 return
7777 for k , v in RedirectFrom .redirects .items ():
7878 p = Path (app .outdir , k + builder .out_suffix )
79+ html = HTML_TEMPLATE .format (v = v )
7980 if p .is_file ():
80- logger .warning (f'A redirect-from directive is trying to create '
81- f'{ p } , but that file already exists (perhaps '
82- f'you need to run "make clean")' )
81+ if p .read_text () != html :
82+ logger .warning (f'A redirect-from directive is trying to '
83+ f'create { p } , but that file already exists '
84+ f'(perhaps you need to run "make clean")' )
8385 else :
86+ logger .info (f'making refresh html file: { k } redirect to { v } ' )
8487 p .parent .mkdir (parents = True , exist_ok = True )
85- with p .open ("x" ) as file :
86- logger .info (f'making refresh html file: { k } redirect to { v } ' )
87- file .write (HTML_TEMPLATE .format (v = v ))
88+ p .write_text (html )
You can’t perform that action at this time.
0 commit comments