Using Hugo

Hugo’s pretty simple to use, but I use it so sporadically I figured I should jot down how I use it…

Note: All the following commands assume I’m in the /blog subdirectory of the repo.

Installation

I installed it with Homebrew:

$ brew install hugo

so to upgrade it I just brew update && brew upgrade.

Previewing

To get hugo to render on-the-fly:

$ hugo server --watch --buildDrafts

Writing new articles

To start a new post:

$ hugo new post/title_of_post.md

Or if it’s a static page (about/etc)

$ hugo new title_of_page.md

Edit the page:

$ atom content/<path to .md file>

Update the categories and title fields, and set draft = true in the front matter if necessary.

Publishing

Regenerate the site

$ hugo

Then git add/git commit/git push to taste.

fin

comments powered by Disqus