correctly rename non .html files when only converting one file
This commit is contained in:
1 parent
0487b39737
commit
de35de34cd
3 files changed
+36
-1
No files matched your search
@@ -61,7 +61,8 @@ def convert_file(path: str, overwrite: bool = False) -> None:
|
||||
if overwrite:
|
||||
out_path = path
|
||||
else:
|
||||
out_path = path.replace(".html", ".n.html")
|
||||
filename, file_extension = os.path.splitext(path)
|
||||
out_path = f"{filename}.n{file_extension}"
|
||||
with open(out_path, "w") as file:
|
||||
for lib in required_libraries:
|
||||
file.write(f"{{% load {lib} %}}\n")
|
||||
|
||||
Reference in new issue
Block a user