Drafts in Jekyll
The great thing about Jekyll is that you can start writing a draft without publishing it and still be able to see the post locally.
- Create a draft directory called
_drafts
in the root directory - Create a new post in this directory but omit the date in the file name
- Serve up the page locally using
jekyll serve --drafts
Then, Jekyll will automatically adjust the date of the post to today’s date and display the post as the most recent post. Note that this post won’t be displayed on your github pages since they aren’t using the --drafts
option. So, you’ll be able to save all of your drafts without worrying about them showing up on your live site. Once the post is ready for the prime time, then simply move it over to the _posts
directory and prepend a date to the file name. That’s it!