use eleventyImageTransformPlugin
This commit is contained in:
parent
fa753b52e7
commit
5fce1c2cb2
2 changed files with 18 additions and 1 deletions
|
|
@ -54,6 +54,21 @@ export default async function (eleventyConfig) {
|
||||||
useTransform: true
|
useTransform: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eleventyConfig.addPlugin(plugins.eleventyImageTransformPlugin, {
|
||||||
|
formats: ['avif', 'webp', 'jpeg'],
|
||||||
|
outputDir: '/assets/images/',
|
||||||
|
widths: ['auto'],
|
||||||
|
extensions: 'html',
|
||||||
|
htmlOptions: {
|
||||||
|
imgAttributes: {
|
||||||
|
loading: 'lazy',
|
||||||
|
decoding: 'async',
|
||||||
|
sizes: '100vw'
|
||||||
|
},
|
||||||
|
pictureAttributes: {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// --------------------- bundle
|
// --------------------- bundle
|
||||||
eleventyConfig.addBundle('css', {hoist: true});
|
eleventyConfig.addBundle('css', {hoist: true});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import {EleventyRenderPlugin} from '@11ty/eleventy';
|
||||||
import rss from '@11ty/eleventy-plugin-rss';
|
import rss from '@11ty/eleventy-plugin-rss';
|
||||||
import syntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight';
|
import syntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight';
|
||||||
import webc from '@11ty/eleventy-plugin-webc';
|
import webc from '@11ty/eleventy-plugin-webc';
|
||||||
|
import {eleventyImageTransformPlugin} from '@11ty/eleventy-img';
|
||||||
|
|
||||||
// custom
|
// custom
|
||||||
import {markdownLib} from './plugins/markdown.js';
|
import {markdownLib} from './plugins/markdown.js';
|
||||||
|
|
@ -20,8 +21,9 @@ export default {
|
||||||
rss,
|
rss,
|
||||||
syntaxHighlight,
|
syntaxHighlight,
|
||||||
webc,
|
webc,
|
||||||
|
eleventyImageTransformPlugin,
|
||||||
markdownLib,
|
markdownLib,
|
||||||
drafts,
|
drafts,
|
||||||
htmlConfig,
|
htmlConfig,
|
||||||
cssConfig,
|
cssConfig,
|
||||||
jsConfig
|
jsConfig
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue