Compare commits

..

No commits in common. "5755823792052153e7bc113c68f0a1f3e0a82797" and "12876f0773f30621ddd49070aa7dfa07413ba720" have entirely different histories.

View file

@ -17,8 +17,6 @@ const IMAGE_ATTR_SIZES = [
{ minw: null, size: 'calc(100vw - 3rem)' }
];
const getAttrSizes = ({ minw, size }) => (minw ? `(min-width: ${minw}) ${size}` : size);
const IMAGE_TRANSFORM_OPTS = {
widths: [...IMAGE_COMPUTED_WIDTHS, 'auto'],
formats: ['avif', 'webp', 'auto'],
@ -29,13 +27,11 @@ const IMAGE_TRANSFORM_OPTS = {
defaultAttributes: {
loading: 'lazy',
decoding: 'async',
sizes: IMAGE_ATTR_SIZES.map(getAttrSizes).join(', ')
sizes: IMAGE_ATTR_SIZES.map(({ minw, size }) => (minw ? `(min-width: ${minw}): ${size}` : size))
}
};
const BASE = env.ELEVENTY_PRODUCTION
? 'https://ref-beta.sebin-nyshkim.net'
: 'http://localhost:8080';
const BASE = env.ELEVENTY_PRODUCTION ? 'https://ref-beta.sebin-nyshkim.net' : 'http://localhost:8080';
// source: https://notes.jays.net/blog/11ty/
async function getImage(type, src, key) {