Let's say your Jekyll site's directory structure looks like:
|-- _config.yml |-- _drafts/ | |-- a-draft-post.md |-- _layouts/ | |-- default.html |-- _posts/ | |-- 2013-05-10-a-published-post |-- index.html
How to preview a draft post
Normally (and on GitHub Pages) Jekyll will ignore the posts in the
_drafts folder, publishing only the posts in the
_posts folder. If you run Jekyll locally with the
--drafts flag (e.g.,
jekyll serve --drafts), Jekyll will include any posts in the
_drafts folder, just as if they were published post (but don't worry, only locally).
Hi all, does anyone know whether it is actually possible to view a draft with a date in the filename?
The reason I'm asking this is because I use a script that takes the filename of my blog post (
YYYY-MM-DD-post-name) to create a folder where I store my images, adding the date keeps the files neatly organised.
My scripts are based on taking the filename, which works if I write my drafts in the
_postsfolder but my jekyll blog doesn't seem to be able to find my drafts if I add date.