File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -234,9 +234,11 @@ def build_html(path):
234
234
config = JINJA_WATCH_PATH / "config.json"
235
235
context = json .loads (config .read_text ()) if config .is_file () else {}
236
236
237
- output = t_env .get_template (str (path )).render (context )
238
- if DEV_MODE :
239
- try :
237
+ try :
238
+ output = t_env .get_template (str (path )).render (context )
239
+
240
+ if DEV_MODE :
241
+ # try:
240
242
soup = BeautifulSoup (output , "lxml" )
241
243
body_tag = soup .find ("body" )
242
244
@@ -249,10 +251,13 @@ def build_html(path):
249
251
body_tag .append (soup .new_tag ("script" , src = "https://cdnjs.cloudflare.com/ajax/libs/livereload-js/3.3.1/livereload.min.js" ,
250
252
integrity = "sha512-DSycG/J5pRCjy6wZ8nfeqaKuSAf9jVmSulTuzy1xQL+2yyBIp7fwzNvx+tZCtZ6kIRMqiDyWOYSl4zYjT32zOw==" , crossorigin = "anonymous" ))
251
253
output = str (soup )
252
- except AttributeError :
253
- logging .warning (output := f"Malformed or non-existent html in '{ path } '. Doing nothing." )
254
254
255
- resolve_output_path (path ).write_text (output )
255
+ resolve_output_path (path ).write_text (output )
256
+
257
+ except AttributeError :
258
+ logging .warning ("Malformed or non-existent html in '%s'. Doing nothing." , path )
259
+ except Exception as e :
260
+ logging .exception (e )
256
261
257
262
258
263
def main ():
You can’t perform that action at this time.
0 commit comments