eleventy-plugin-img2picture
Version:
Eleventy plugin to replace <img> using <picture> with resized and optimized images.
23 lines (19 loc) • 374 B
JavaScript
// @ts-check
/**
* Generate Widths for Image
*
* @param {number} min The minimum
* @param {number} max The maximum
* @param {number} step The step
* @returns {number[]} Widths
*/
function generateWidths(min, max, step) {
const sizes = [];
for (let i = min; i < max; i += step) {
sizes.push(i);
}
return sizes;
}
module.exports = {
generateWidths,
};