From 03e85bcb357ce8453956834ac503557e26a6f12a Mon Sep 17 00:00:00 2001 From: Lee Cattarin Date: Thu, 17 Sep 2026 07:58:37 -0700 Subject: [PATCH] draft handling --- eleventy.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eleventy.config.js b/eleventy.config.js index f3f1715..2e53ca2 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -69,6 +69,17 @@ export default async function (eleventyConfig) { /* All filters from _config/filters.js */ eleventyConfig.addPlugin(pluginFilters); + /* Draft handling */ + eleventyConfig.addPreprocessor("drafts", "*", (data, content) => { + if (data.draft) { + data.title = `${data.title} (draft)`; + } + + if(data.draft && process.env.ELEVENTY_RUN_MODE === "build") { + return false; + } + }); + /* Shortcodes */ eleventyConfig.addShortcode("currentBuildDate", () => { return new Date().toISOString();