11ty draft posts

Set up a draft system in 11ty

Now this and a few other sites I have are running on 11ty 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 and the Quick Tip in the 11ty docs. 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 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

By Simon Cox Published: Fri, Sep 1, 2023 : Updated: Mon Oct 30 2023

Next short: Cleaning up the 11ty config

Previous short: Solving a date display issue in 11ty templates

Latest Shorts

Or all the short articles

Latest articles

Or all the articles