Juicy lil' bytes

How to Create a Draft Post With Octopress

Don’t want to publish that draft post with Octopress quite yet? Here’s the solution.

The YAML frontmatter for your typical post looks like this:

1
2
3
4
5
6
7
8
9
---
layout: post
title: 'How to Create a Draft Post with Octopress'
date: 2013-08-19 21:52
description: Learn how to create a draft post with the Octopress blogging framework
keywords: Octopress, yaml, draft, draft post, how to, tip
comments: true
categories:
---

If you use the command rake generate with these YAML settings, your static html files are generated in the directory that you use to deploy to your live site.

Insert published: false into the YAML frontmatter to make the post a draft. Here’s an example:

1
2
3
4
5
6
7
8
9
10
---
layout: post
title: 'How to Create a Draft Post with Octopress'
date: 2013-08-19 21:52
description: Learn how to create a draft post with the Octopress blogging framework
keywords: Octopress, yaml, draft, draft post, how to, tip
comments: true
categories:
published: false
---

Now when you rake generate and rake deploy (or deploy manually with git or rsync), the draft post is not pushed to the server but you can still view it locally with rake preview (http://localhost:4000), or http://yoursitename.dev if you use POW, so that you can make further edits.