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();