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:
parent
07e0e0be9f
commit
360117deb1
3 changed files with 12 additions and 4 deletions
2
main.py
2
main.py
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue