How to Make a New Post on Hugo

Creating New Posts in Hugo #

Hugo is a fast and flexible static site generator written in Go. Creating new posts is straightforward once you understand the basic workflow. This guide is mostly for myself since I don’t always remember how the process goes.

Step-by-Step Process #

1. Navigate to your Hugo site directory #

/var/lib/snapd/void/blog

2. Create a new post using Hugo CLI #

hugo new content content/docs/hugo-post.md

3. Edit the post content #

vim content/docs/hugo-post.md

Edit the front matter (title, date, draft status) and add your content in Markdown.

4. Version control your changes #

git add content/docs/hugo-post.md
git add content/docs/hugo-post.md
git commit -m "add new site"
git push

5. Build and deploy your site #

hugo

Gotchas #

  • Make sure to set draft = false or otherwise the site wont appear after publishing.