---
type: Article
title: 11ty draft posts
description: Setting a post to draft in 11ty while writing
resource: https://www.simoncox.com/short-articles/2023-09-01-11ty-draft-posts/
tags: [Shorticles, Eleventy]
timestamp: 2023-10-30
---

## Set up a draft system in 11ty

Now this and a few other sites I have are [running on 11ty](https://www.11ty.dev) I have been meaning to add a way of marking a post as a draft while I am writing it - just in case I need to publish a short while getting an article ready.

There are several complex explanations of how to do this out there including one from [Remy Sharps from 2019](https://remysharp.com/2019/06/26/scheduled-and-draft-11ty-posts) and the [Quick Tip in the 11ty docs](https://www.11ty.dev/docs/quicktips/draft-posts/). I am sure they are all great
but I wanted something simple and easy to use and I didn't need to schedule anything - well not yet anyway. 

I found this one on github from [Peter Dehaan](https://github.com/pdehaan/11ty-drafts) which explained how this works easily enough for me to comprehend and implement. 

With the added src.11tydata.js file all I need to is add a draft: true to the front matter and the post will not be included in the build, including lists of posts, my mxl sitemap and my rss feed.

```
---
title: 11ty draft posts
description: Setting a post to draft in 11ty while writing
topic: web
draft: true
---
```

## Update 2024/11/25
There has been un update in 11ty v3 with an [easier method](https://www.11ty.dev/docs/config-preprocessors/#example-drafts)

[Read full article](https://www.simoncox.com/short-articles/2023-09-01-11ty-draft-posts/)
