|
|
|
@ -28,14 +28,19 @@ for path_to_source in source.glob("**/*"): |
|
|
|
|
|
|
|
|
|
if ".ignore" in str(rel_path): |
|
|
|
|
continue |
|
|
|
|
if ".git" in str(rel_path): |
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
if path_to_source.is_dir(): |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
elif ".article.html" in str(path_to_source): |
|
|
|
|
path_to_output = path_to_output.parent / path_to_output.name.replace(".article","") |
|
|
|
|
folder_name = path_to_output.parent / path_to_output.name.replace(".article.html","") |
|
|
|
|
os.makedirs(folder_name, exist_ok=True) # make the folder /var/www/shoofle.net/articles/circle_script |
|
|
|
|
|
|
|
|
|
path_to_output = folder_name / "index.html" |
|
|
|
|
|
|
|
|
|
with open(path_to_output, "w") as output_file: |
|
|
|
|
os.makedirs(path_to_output.parent, exist_ok=True) |
|
|
|
|
output_file.write(article_template.render(title="Article", target=str(rel_path))) |
|
|
|
|
|
|
|
|
|
elif ".renderme" in str(path_to_source): |
|
|
|
|