

Recap
A few days ago, I wrote a post outlining how I use Hugo and Amazon S3 to create a severless blog hosting platform. While this solution works awesome for hosting the site, publishing is still a bit of a pain. After a few too many rounds of drag-and-drop uploading, I set out to find a better publishing workflow.
My first breakthrough was a quick terminal command using the AWS CLI to automatically upload the public directory that Hugo generates. The sync
parameter is used instead of upload
to make sure that the source and target directories match, and the --delete
modified is appended to make sure that any files removed from the source directory are also removed from the target (S3) directory. This ensures that any outdated images or documents are removed! Finally, the -- acl public-read
modifier makes sure that the uploaded files are public readable (this should be redundant if you have a public bucket policy, but never hurts).
Read More