A GREAT Hugo Setup

May 2016 ยท 2 minute read

I thought I would write this up partially for sake of bragging about the efficiency of my setup.

Unless if you host the Hugo server locally, you will need to either SSH to the server to generate a new post, put Hugo on watch and FTP to the server to edit the files locally or some variable of that.

Now me, I wanted to be able to generate the posts without using any extra software while using Atom.io for seamless editing and publishing.

My workflow

Muh workflow

I generate a new post and modify it to my liking and when I save it, it gets published automagically.

Now how does it work?

Setting up Hugo

Setting up Hugo is the easiest part. The only thing we want for it to do is to watch for file changes and regenerate. To do that create a new screen with screen -R hugo and then run hugo --watch to make it watch for file changes. After that you may close the terminal.

Setting up the desktop folder

This is slightly more tricky and never got it working on Windows; works on Linux fine though. What we want for this is a tool called sshfs, what it does is it mounts an SFTP folder as a directory which is great for anything.

This is done in a single command:

sshfs admin@domain.com:/home/admin /home/user/Desktop/domain.com

Note: Make sure to create an empty folder for it first.

Wrapping it up

After this setup, you can softlink the public directory to a directory on your desktop for faster access.

Recommended Reading: From Ghost to Hugo