Sometimes you want to write things down without publishing it for the world to see. The easiest way to add support for draft posts is to use the .eleventyignore
file to ignore all of your draft posts in the build process. This file sits at the root of your project and uses the same ruleset as .gitignore
files to decide which things should not be used to generate output for your website.
Here's how you might do it:
drafts
for your draft posts.eleventyignore
at the root of your projectdrafts/
to ignore all files in the drafts folderJust remember if you host your blog's git repository publicly, people will still be able to read the raw files.
For more information on ignoring things in 11ty, check this out.
Back Home | Back To Top | View on GitHub