minify transforms, plugins, aliases
This commit is contained in:
parent
e2a7c7019a
commit
676c9540a4
1 changed files with 21 additions and 4 deletions
25
.eleventy.js
25
.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("base", "base.njk");
|
||||||
config.addLayoutAlias("post", "post.njk");
|
config.addLayoutAlias("post", "post.njk");
|
||||||
config.addLayoutAlias("page", "page.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 {
|
return {
|
||||||
dir: {
|
dir: {
|
||||||
input: "src",
|
input: "src",
|
||||||
|
|
@ -13,7 +30,7 @@ module.exports = function (config) {
|
||||||
layouts: "layouts",
|
layouts: "layouts",
|
||||||
data: "data",
|
data: "data",
|
||||||
},
|
},
|
||||||
templateFormats: ["njk", "md", "11ty.js"],
|
templateFormats: ["html", "njk", "md", "11ty.js"],
|
||||||
htmlTemplateEngine: "njk",
|
htmlTemplateEngine: "njk",
|
||||||
markdownTemplateEngine: "njk",
|
markdownTemplateEngine: "njk",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue