Improve draft filtering

This commit is contained in:
Neil Brommer 2023-07-10 15:22:32 -07:00
parent 6dbe6567dd
commit db0860ae2e
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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" %}