Working with Draft Posts

Hugo has a built in mechanism for draft postings. This allows you to work on a post and not publish it until you are ready. Great for when you’re dipping in and out of writing.

This is a setting that sits in your post, in the top section.

1
2
3
4
5
6
7
---
title: "My Draft Post"
date: 1970-01-01
url: /my draft-post/
draft: true
--
my content

That last line, draft: true means the post won’t be listed and generated as part of the hugo build. You can work on it in your own time until you’re ready.

An alternative way, is to set the date in the future. This will act in a similar way (but can mean when the date passes it surprisingly shows up!).