eleventy-base-blog
eleventy-base-blog copied to clipboard
Inconsistency between documentation and implementation for "draft" feature
Since I'm new both to JS and Eleventy, it might be that I'm missing something. But when I couldn't get drafts working as I expected, I dived into the draft functions and found that there is only checks for wether draft is defined in the frontmatter or not. According to the docs, "draft: true" should exclude drafts from the builds, but any post where draft is defined is actually omitted.
This gave me the behaviour I was expecting.
if(data.draft == true && !process.env.BUILD_DRAFTS) {
return true;
}
Sorry if I'm missing something obvious here! :)