In case you haven’t noticed, I use Jekyll to create my blog from markdown files. And I typically write short posts, mostly TILs like this one. But I am trying to write longer, more thoughtful posts, which means that I will likely need to write drafts of these posts.
Well Jekyll has a nice feature where you can save these drafts in a folder (
_drafts) separate from the one used to contain your completed posts (
_posts). That way the draft won’t be made available at your website until you are ready to move it to the
But wait! There’s more!!!
You can view the posts (most likely locally) in the
_draftsfolder using the
bundle exec jekyll serve --drafts
Also, the posts in the
_draftsfolder typically don’t have the date in the file name. i.e instead of
2020-01-01-post-1.md, it would be
post-1.md. You add the date after you move it to the
If you want to keep the dates in the filename of the drafts, then run:
bundle exec jekyll serve --drafts --future