diff --git a/.eleventy.js b/.eleventy.js index 94f61a8..44740dc 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,10 +1,27 @@ -module.exports = function (config) { +const { DateTime } = require('luxon'); +const pluginRss = require("@11ty/eleventy-plugin-rss"); - // Layouts +module.exports = function (config) { + // Passthrough copy + + // Layouts // config.addLayoutAlias("base", "base.njk"); config.addLayoutAlias("post", "post.njk"); config.addLayoutAlias("page", "page.njk"); - // Base confirguration + + // Transforms // + // Minify HTML + const htmlMinTransform = require("./src/transforms/html-min.js"); + const isProduction = process.env.ELEVENTY_ENV === "production"; + // html min only in production + if (isProduction) { + config.addTransform("htmlmin", htmlMinTransform); + } + + // Plug-Ins // + config.addPlugin(pluginRss); + + // Base confirguration // return { dir: { input: "src", @@ -13,7 +30,7 @@ module.exports = function (config) { layouts: "layouts", data: "data", }, - templateFormats: ["njk", "md", "11ty.js"], + templateFormats: ["html", "njk", "md", "11ty.js"], htmlTemplateEngine: "njk", markdownTemplateEngine: "njk", };