diff --git a/.eleventy.js b/.eleventy.js index f246a3f..98615b6 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -27,7 +27,18 @@ module.exports = function (eleventyConfig) { return collection.filter(item => !item.url || item.url.startsWith("/_sections")); }); eleventyConfig.addFilter("IsNotMainPageSection", (collection) => { - return collection.filter(item => item.url != null && (item.data.tags == null || !item.data.tags.includes("MainPage"))); + return collection.filter(item => { + if (item.url == null || item.url == false) + return false; + + if (item.data.tags == null) + return true; + + if (item.data.tags.includes("MainPage")) + return false; + + return true; + }); }); eleventyConfig.addFilter("orderBySectionOrder", (collection) => collection.sort((a, b) => a.data.sectionOrder - b.data.sectionOrder) @@ -40,8 +51,6 @@ module.exports = function (eleventyConfig) { } return collection.filter(item => { - console.log(item); - if (item.data.draft != null) { return !item.data.draft; } @@ -51,8 +60,6 @@ module.exports = function (eleventyConfig) { }); eleventyConfig.addFilter("log", (value) => console.log(value)); - console.log("BUILD_DRAFTS: " + process.env.BUILD_DRAFTS); - return { dir: { input: "src", diff --git a/src/_includes/layouts/layout.njk b/src/_includes/layouts/layout.njk index bbd16bb..e7e38b0 100644 --- a/src/_includes/layouts/layout.njk +++ b/src/_includes/layouts/layout.njk @@ -36,10 +36,12 @@ {% set standalonePages = collections.all | filterDrafts | IsNotMainPageSection | eleventyNavigation %} {% if standalonePages | length %} +