xmitter-11ty/eleventy.config.images.js

21 lines
543 B
JavaScript
Raw Normal View History

2024-02-12 10:19:19 -05:00
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
2023-01-24 09:08:52 -05:00
2024-02-12 10:19:19 -05:00
export default function(eleventyConfig) {
// Read more about this plugin: https://www.11ty.dev/docs/plugins/image/#eleventy-transform
2024-02-12 10:19:19 -05:00
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
// file extensions to process
2024-02-12 10:19:19 -05:00
extensions: "html",
2024-02-12 10:19:19 -05:00
formats: ["avif", "webp", "auto"],
2024-02-12 10:19:19 -05:00
// widths: ["auto"],
2023-01-24 09:08:52 -05:00
// e.g. <img loading decoding> assigned on the HTML tag will override these values.
2024-02-12 10:19:19 -05:00
defaultAttributes: {
2023-01-24 09:08:52 -05:00
loading: "lazy",
decoding: "async",
2024-03-07 09:19:33 -05:00
},
2023-01-24 09:08:52 -05:00
});
};