Creating draft posts in Jekyll

How to create and develop with draft posts in Jekyll

If you want the ability to write an article over the course of a few days and ensure it’s version controlled but not publicly visible, here’s where drafts come in useful!

You will want to create a folder called _drafts/ in the root of your project. In that you can place your draft article using the same naming convention as you would for something in your _posts folder (i.e. 2024_04_30_my_article.md). This will ensure the article doesn’t show up on your site.

To work on a draft article locally run jekyll serve --draft, this will show your draft article so you can view it locally on the frontend.

When you’re ready to publish your article just move it from the _drafts/ folder to the _posts/ folder and deploy.


Recent posts View all

Web Dev

Updating payment method email addresses in Stripe

You can't update the email address associated with a payment method in Stripe via their dashboard, you need to use the Stripe CLI

Ruby

Irreversible Rails Migrations

What are irreversible migrations and how might we use them to our advantage?