site/eleventy.config.js

26 lines
1.1 KiB
JavaScript
Raw Normal View History

2025-06-02 12:12:28 -05:00
import { minify } from "terser";
2025-06-02 10:50:26 -05:00
import { transform } from "lightningcss";
2025-06-02 12:12:28 -05:00
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
2025-04-20 03:23:57 -05:00
export default function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({ "_includes/assets/": "assets/" });
2025-11-13 09:14:22 +07:00
eleventyConfig.addPassthroughCopy({ "_includes/other/.well-known/": ".well-known/" }); // static identity stuff
eleventyConfig.addPassthroughCopy({ "_includes/other/custard.html": "custard.html" }); // 🍮
eleventyConfig.addPassthroughCopy({ "sneexy/notebook/": "_subdomain/sneexy/notebook/" }); // notebook page generated by quartz seperately - see https://forged.synth.download/sneexy/notebook
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(syntaxHighlight);
2025-06-29 01:03:34 -05:00
eleventyConfig.addFilter("cssmin", function (code) {
2025-06-02 10:50:26 -05:00
const result = transform({
code: Buffer.from(code, 'utf-8'),
minify: true,
})
return result.code.toString('utf-8')
});
2025-06-02 12:12:28 -05:00
eleventyConfig.addFilter("jsmin", async function (code) {
const minified = await minify(code);
return minified.code;
});
2025-10-14 20:54:48 +07:00
};