Working with drafts on a Jekyll blog
June 13, 2020 - 1 min read
Did you know that Jekyll supports drafts by default?
The process of writing a post may span to multiple days; from the time you jot down an idea, to writing the post, polishing and eventually publishing it.
Instead of creating a post, you can start using drafts for those unfinished posts that you don’t want to publish yet.
To start using drafts on an existing Jekyll blog, just follow the following steps:
# Create a folder named `_draft` on the root directory of your blog
mkdir _drafts
# Inside '_draft', create a Markdown file for your first draft
touch _drafts/my-first-draft.md
# Open this file and add some content
echo "my first draft" > _drafts/my-first-draft.md
# Run your blog with the `--drafts` switch
jekyll server --watch --drafts
# Open http://127.0.0.1:4000 on your favourite browser to see the draft
And that’s it!
You can now streamline your writing process using drafts!