1
0
Fork 0
mirror of https://codeberg.org/Reuh/feather.git synced 2025-10-28 02:29:32 +00:00

feat: set mtime and atime for generated files

This commit is contained in:
Étienne Fildadut 2025-10-09 21:42:41 +02:00
parent 07e0e0be9f
commit 360117deb1
3 changed files with 12 additions and 4 deletions

View file

@ -235,6 +235,8 @@ def generate_html_for_item(config, item_json, regenerate=False):
else:
with html_path.open("w") as f:
f.write(config.item_template.render(item_json))
# set accessed date to update time, modified to publication time
os.utime(html_path, (max(item_json["updated"], item_json["updated"]), item_json["published"]))
def remove_html_for_item(config, item_json, ignore_deleted=False):
# Delete a HTML file for a JSON object