diff --git a/eleventy.config.js b/eleventy.config.js index 56599a0..0a6c26c 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -49,7 +49,7 @@ module.exports = function (eleventyConfig) { collection.sort((a, b) => a.data.sectionOrder - b.data.sectionOrder) ); eleventyConfig.addFilter("filterDrafts", collection => { - if (process.env.BUILD_DRAFTS) { + if (process.env.BUILD_DRAFTS == true || process.env.BUILD_DRAFTS == null) { return collection; } diff --git a/src/posts/index.njk b/src/posts/index.njk index 775e6b8..b6ae4d6 100644 --- a/src/posts/index.njk +++ b/src/posts/index.njk @@ -7,5 +7,5 @@ eleventyNavigation: order: 1 --- -{% set postsList = collections.posts | IsNotPage(page.url) %} +{% set postsList = collections.posts | filterDrafts | IsNotPage(page.url) %} {% include "posts-list.njk" %}