Hugo Server

Hugo has a command called hugo server that both builds the code and launches a web server that, in real time, updates a browser pointed to localhost:1313. This makes interactive development and debugging a breeze. But this command also temporarily updates all the links from the target domain to localhost and back. This makes a mess for Git because many of the files in the public directory, which is deployed after a Hugo build, are left in modified status.

The fix is to have Git ignore the /public/ deployment directory. While we’re at it, let’s ignore /resources/_gen/ too, because it is a cache.

/public/
/resources/_gen/
hugo 

See also