jump to content
Snippets and tips
  1. Home
  2. Holiday
  3. Posts
  4. Tools
  5. Tags
  6. Categories

Hugo

The very software that runs this blog.

The most used commands (my cheat sheet)

New entries #

The command that created this page was:

1
hugo new tools/hugo.md

Watching the new content #

1
hugo server -D

hugo starts and compiles all pages, then waits for changes. The flag ‘-D’ allows for draft contents.

Publishing new content #

Actually, I have a shell script that contains a few commands.

1
2
3
rm public -fr
hugo --minify
rsync -rvt --del public/* mefju7.priv.no@ssh.mefju7.priv.no:/www/blog
  • Line 1 removes the current public folder, which might contain obsolete pages.
  • Line 2 creates the content and also tells hugo to create minimal content.
  • Line 3 syncs the content to my provider. The options for rsync ensure that obsolete content is deleted, while all other is copied over.