site/eleventy.config.js
zenfyr 790ebad260
All checks were successful
/ build (push) Successful in 4m46s
fix extra /
2025-11-13 09:14:22 +07:00

26 lines
1.1 KiB
JavaScript

import { minify } from "terser";
import { transform } from "lightningcss";
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
export default function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({ "_includes/assets/": "assets/" });
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);
eleventyConfig.addFilter("cssmin", function (code) {
const result = transform({
code: Buffer.from(code, 'utf-8'),
minify: true,
})
return result.code.toString('utf-8')
});
eleventyConfig.addFilter("jsmin", async function (code) {
const minified = await minify(code);
return minified.code;
});
};