summaryrefslogtreecommitdiff
path: root/lib/notes.source.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/notes.source.sh')
-rw-r--r--lib/notes.source.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/notes.source.sh b/lib/notes.source.sh
index bdea5fc..85bd2b5 100644
--- a/lib/notes.source.sh
+++ b/lib/notes.source.sh
@@ -41,5 +41,10 @@ That were all notes. Hope they were useful!
=> ../ Go back to main site
NOTES
- mv "$notes_dir/index.gmi.tmp" "$notes_dir/index.gmi"
+ # Only overwrite if content changed, preserving mtime for template skip logic
+ if [[ -f "$notes_dir/index.gmi" ]] && diff -q "$notes_dir/index.gmi.tmp" "$notes_dir/index.gmi" >/dev/null 2>&1; then
+ rm "$notes_dir/index.gmi.tmp"
+ else
+ mv "$notes_dir/index.gmi.tmp" "$notes_dir/index.gmi"
+ fi
}