feat: 🔧 add compressor config options
This commit is contained in:
parent
929d9cf8a4
commit
796619d22b
1 changed files with 4 additions and 0 deletions
|
@ -70,6 +70,8 @@ export default async function (eleventyConfig) {
|
||||||
extensions: 'html',
|
extensions: 'html',
|
||||||
formats: ['avif', 'webp', 'auto'],
|
formats: ['avif', 'webp', 'auto'],
|
||||||
widths: [640, 800, 1280, 1920, 2560, 3840, 'auto'],
|
widths: [640, 800, 1280, 1920, 2560, 3840, 'auto'],
|
||||||
|
sharpJpegOptions: { mozjpeg: true, optimiseScans: true, quality: 95 },
|
||||||
|
sharpPngOptions: { compressionLevel: 9 },
|
||||||
urlPath: '/img/',
|
urlPath: '/img/',
|
||||||
outputDir: './public/img/',
|
outputDir: './public/img/',
|
||||||
defaultAttributes: {
|
defaultAttributes: {
|
||||||
|
@ -112,6 +114,8 @@ export default async function (eleventyConfig) {
|
||||||
eleventyConfig.addShortcode('bgimgset', async (src) => {
|
eleventyConfig.addShortcode('bgimgset', async (src) => {
|
||||||
const imgset = await Image(src, {
|
const imgset = await Image(src, {
|
||||||
widths: [1920, 2560, 3840],
|
widths: [1920, 2560, 3840],
|
||||||
|
sharpJpegOptions: { mozjpeg: true, optimiseScans: true, quality: 95 },
|
||||||
|
sharpPngOptions: { compressionLevel: 9 },
|
||||||
formats: ['avif', 'webp', 'auto'],
|
formats: ['avif', 'webp', 'auto'],
|
||||||
urlPath: '/img/',
|
urlPath: '/img/',
|
||||||
outputDir: './public/img/'
|
outputDir: './public/img/'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue