Moved some comments to the official docs.
This commit is contained in:
parent
6fe22389c9
commit
e3d39b460e
@ -1,25 +1,17 @@
|
|||||||
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
||||||
|
|
||||||
export default function(eleventyConfig) {
|
export default function(eleventyConfig) {
|
||||||
|
// Read more about this plugin: https://www.11ty.dev/docs/plugins/image/#eleventy-transform
|
||||||
|
|
||||||
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
||||||
// which file extensions to process
|
// file extensions to process
|
||||||
extensions: "html",
|
extensions: "html",
|
||||||
|
|
||||||
formats: ["avif", "webp", "auto"],
|
formats: ["avif", "webp", "auto"],
|
||||||
|
|
||||||
// widths: ["auto"],
|
// widths: ["auto"],
|
||||||
|
|
||||||
// urlPath: "/img/",
|
// e.g. <img loading decoding> assigned on the HTML tag will override these values.
|
||||||
|
|
||||||
// If a urlPath is not specified:
|
|
||||||
|
|
||||||
// 1. Relative image sources (<img src="./possum.png">) will be co-located in your output directory
|
|
||||||
// with the template they are used in. Warning: if the same source image is used in multiple templates,
|
|
||||||
// it will be written to two different locations!
|
|
||||||
// 2. Absolute image sources (<img src="/possum.png">) will be normalized to your input/content directory
|
|
||||||
// and written to ${OUTPUT_DIR}/img/
|
|
||||||
|
|
||||||
// <img loading decoding> assigned on the HTML tag will override these values.
|
|
||||||
defaultAttributes: {
|
defaultAttributes: {
|
||||||
loading: "lazy",
|
loading: "lazy",
|
||||||
decoding: "async"
|
decoding: "async"
|
||||||
|
Loading…
Reference in New Issue
Block a user