#10842·hugo

Option to not modify mtime on unmodified files

Author: JonHurstCreated Mar 16, 2023Updated Sep 26, 2026
LabelsProposalb0

Naïve sychronisers such as aws s3 sync rely on file size and file modification time to decide whether to upload a file. Hugo appears to overwrite existing files, updating their file modification time, even when the file in question is unchanged.

I propose that something like a --preserveModificationTimes flag be added. This would cause Hugo to check whether a file that it is about to overwrite has identical content and cancel the operation if this is the case, thus preserving the mtime.