aboutsummaryrefslogtreecommitdiff
path: root/eleventy.config.js
blob: 6b0f30901b54d7a65067e3a04bd9fc9382cea9d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { minify } from "html-minifier-next";

export default async function (eleventyConfig) {
  eleventyConfig.addPassthroughCopy({ public: "/" });
  eleventyConfig.addGlobalData("layout", "layouts/base.njk");
  eleventyConfig.addTransform("htmlmin", (content, path) =>
    path.endsWith(".html")
      ? minify(content, {
          useShortDoctype: true,
          removeComments: true,
          collapseWhitespace: true,
        })
      : content,
  );
}

export const config = {
  dir: {
    input: "content",
    includes: "../_includes",
    data: "../_data",
  },
};