2021-09-03 02:05:52 +00:00
|
|
|
const { DateTime } = require('luxon');
|
|
|
|
|
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
|
|
|
|
|
2021-08-31 02:16:17 +00:00
|
|
|
module.exports = function (config) {
|
2021-09-03 02:05:52 +00:00
|
|
|
// Passthrough copy
|
2021-09-02 01:20:51 +00:00
|
|
|
|
2021-09-03 02:05:52 +00:00
|
|
|
// Layouts //
|
2021-08-31 02:16:17 +00:00
|
|
|
config.addLayoutAlias("base", "base.njk");
|
|
|
|
|
config.addLayoutAlias("post", "post.njk");
|
2021-09-02 01:20:51 +00:00
|
|
|
config.addLayoutAlias("page", "page.njk");
|
2021-09-03 02:05:52 +00:00
|
|
|
|
|
|
|
|
// 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 //
|
2021-08-31 02:16:17 +00:00
|
|
|
return {
|
|
|
|
|
dir: {
|
|
|
|
|
input: "src",
|
|
|
|
|
output: "dist",
|
|
|
|
|
includes: "includes",
|
|
|
|
|
data: "data",
|
|
|
|
|
},
|
2021-09-03 02:05:52 +00:00
|
|
|
templateFormats: ["html", "njk", "md", "11ty.js"],
|
2021-08-31 02:16:17 +00:00
|
|
|
htmlTemplateEngine: "njk",
|
|
|
|
|
markdownTemplateEngine: "njk",
|
|
|
|
|
};
|
|
|
|
|
};
|