import lume from "lume/mod.ts";
import jsx from "lume/plugins/jsx.ts";
import attributes from "lume/plugins/attributes.ts";
import code_highlight from "lume/plugins/code_highlight.ts";
// import favicon from "lume/plugins/favicon.ts";
// import liquid from "lume/plugins/liquid.ts";
import pug from "lume/plugins/pug.ts";
import feed from "lume/plugins/feed.ts";
import filter_pages from "lume/plugins/filter_pages.ts";
import mdx from "lume/plugins/mdx.ts";
import metas from "lume/plugins/metas.ts";
import nav from "lume/plugins/nav.ts";
// import pagefind from "lume/plugins/pagefind.ts";
import reading_info from "lume/plugins/reading_info.ts";
import source_maps from "lume/plugins/source_maps.ts";
import tailwindcss from "lume/plugins/tailwindcss.ts";
import postcss from "lume/plugins/postcss.ts";
import terser from "lume/plugins/terser.ts";
import remark from "lume/plugins/remark.ts";
import sass from "lume/plugins/sass.ts";
import minify from "lume/plugins/minify_html.ts";

// Custom Plugins
import emojis from "./_src/lib/plugins/mutant.ts";

// Components
// import Link from "./_src/_components/Link.vento";

const site = lume({
    src: "_src",
    location: new URL(Deno.env.get("LOCATION") || "http://localhost:3000"),
    components: {
        variable: "comp",
        cssFile: "/components.css",
        jsFile: "/components.js",
    },
});

site.data("getYear", () => {
    return new Date().getFullYear();
});

// CSS and Engine Stuffs
site.use(emojis())
site.data("basename", "css", "./files/styles");
site.use(sass());
site.use(tailwindcss({
    options: {
        attributes: {
            darkMode: 'class'
        }
    }
}));
site.use(postcss());
site.use(pug());
site.use(jsx());
site.use(remark());
// Plugin Things
site.use(attributes());
site.use(code_highlight());
// site.use(favicon());
site.use(feed());
site.use(filter_pages({ fn: (page) => page.data.ignored !== true }));
site.use(mdx());
site.use(metas({
    extensions: [".md", ".mdx"],
}));
site.use(nav());
// site.use(pagefind());
site.use(reading_info());
site.use(source_maps());
site.use(terser());
// site.use(minify({
//     extensions: [".html"],
// }));


site.ignore('wk/.git', 'wk/README.md')
site.copy("wk", ".well-known");
// site.copy("files/emojis/nature_effects/effects/sparkles.svg");


export default site;
