Hugo Content Management Series

Just an update for a script in Zsh instead of Bash and rsync for Hugo.

zsh - the Z Shell - is the default terminal shell for newer macs replacing bash

this means zsh scripts need to change ..

Change first line from sh to zsh

1
2
3
4
5
6
7
8
#!/bin/zsh
USER=my-user
HOST=my-server.com             
DIR=my/directory/to/localsite/   # the directory where your web site files should go

hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR}

exit 0

my preferred rsync options are

-ah --stats --delete

so its silent, tells stats and deletes old files

follow the rest of the linkage .. to chmod and make executable

Linkage

Tags: Deployment, Script, Development

Read more from my blog for an introduction and quick tips on developing in Hugo or UCTD.

Meet the author

Photo for Damien Saunders
Damien Saunders
An experienced management consultant and business leader interested in digital transformation, product centred design and scaled agile. If I'm not writing about living with UCTD (an autoimmune disease), I'm probably listening to music, reading a book or learning more about wine.