const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const { DateTime } = require("luxon");

module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(eleventyNavigationPlugin);

  eleventyConfig.addFilter("formatDate", (dateObj) => {
    return DateTime.fromJSDate(dateObj).toFormat("y'-'LL'-'dd");
  });

  eleventyConfig.addPassthroughCopy({ "./src/res/css/**/*.css": "css" });
  eleventyConfig.addPassthroughCopy({ "./src/res/font": "font" });
  eleventyConfig.addPassthroughCopy({ "./src/res/img": "img" });
  eleventyConfig.addPassthroughCopy({ "./src/res/*.txt": "."});
  eleventyConfig.addWatchTarget("./src/res/css");

  return {
    dir: {
      input: "src",
      output: "_site",
    },
  };
};
