Does hugo generate all pages or only those changed since last run?

The subject says it all: When I run hugo as the first step in my deployment (which uses rsync via ssh to a private host), does this generate all content or only those parts that changed since the last run?

I’m asking because I have the impression that rsync uploads a lot more files than would be necessary if only the changes where concerned. An I’m not talking about taxonomy or pagination data, but pages I haven’t touched in weeks.

Hugo generates the whole site each time you run hugo.

Thanks. So it is basically quite pointless to use rsync since the creation dates of all the files will be now, which is always newer then the last time hugo was run. scp could then do the same job, and perhaps faster, unless I’m overlooking something here.

I use Hugo on the host :wink:

Sync Github, generate all in a temp dir and sync local - fastest way for me

No, but you need to use rsync --checksum (my memory is a little faded here, but there is a flag like that). This logic is also built into hugo deploy (also s3deploy, which I created some years ago).

That’s what I’m doing (rsync -vzlpcgoDr), or at least I think that I’m doing that. Regardless, all index.html files are in the list of files to send to the server, also they should be just the same as the last time they were generated, since the corresponding index.md files did not change. Also, a lot of images generated by hugo (i.e. converted to webp from jpeg and/or resized) are in the list although the jpegs did not change. Interestingly, not all of the images are concerned.

I’m using rsync version 3.2.3 on MacOS (from homebrew). On the server side, it’s 3.1.3 on a Debian Linux. But maybe @ju52’s suggestion is best here: Run hugo on the host. That also makes uploading all the converted and resized images unnecessary.

That depends on the template(s) used to render the page.

1 Like

I changed one CSS file, so that might explain this (since the CSS get’s included inline). I’ll try to observe more closely what happens. Though changing a CSS file should not influence the conversion of jpeg to webp or resizing of images, I think.