Skip to content

Commit

Permalink
Slight modification to #195 to prefer jpeg/png to gif
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jan 15, 2024
1 parent 92938bb commit 3fa59d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generate-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const DEFAULT_ATTRIBUTES = {
// decoding: "async",
};

const LOWSRC_FORMAT_PREFERENCE = ["gif", "jpeg", "png", "svg", "webp", "avif"];
const LOWSRC_FORMAT_PREFERENCE = ["jpeg", "png", "gif", "svg", "webp", "avif"];

/*
Returns:
Expand Down Expand Up @@ -72,6 +72,7 @@ function generateObject(metadata, attributes = {}) {
};
}

// TODO work with sizes="auto" https://groups.google.com/a/chromium.org/g/blink-dev/c/OAsmCbjPJz0/m/jzuTJzs1AAAJ
let missingSizesErrorMessage = `Missing \`sizes\` attribute on eleventy-img shortcode from: ${originalSrc || attributes.src}`;

// <img srcset>: one format and multiple sizes
Expand Down

0 comments on commit 3fa59d4

Please sign in to comment.