I have some images on the blog posts that are on the .md file on the layout front matter as images to use for sharing in social media and as a thumbnail.
Those images still need to be moved to the _site folder and I would like to move them only once and only if they change.
That's why I considered using eleventy-img for them instead of just using fs.copyFile.
I want to make use of the eleventy-img cache for this but i don't want eleventy-img to process them at all.
They are in png and for some reason eleventy-img ends up creating a bigger file.
Source file 5.9Kb and output file is 7.7Kb.
Both png.
Is there a way to tell eleventy-img we want to skip any kind of image processing?
I tried using sharOptions to pass the raw option, but it doesn't seem to do the trick:
await Image(src, {
formats: ["png"],
outputDir: outputDir,
useCache: false,
sharOptions: {
raw: true
},
// Define custom filenames for generated images
filenameFormat: function (id, src, width, format, options) {
const name = path.basename(src, format);
return `${name}${format}`;
}
})
I have some images on the blog posts that are on the .md file on the layout front matter as images to use for sharing in social media and as a thumbnail.
Those images still need to be moved to the
_sitefolder and I would like to move them only once and only if they change.That's why I considered using
eleventy-imgfor them instead of just usingfs.copyFile.I want to make use of the
eleventy-imgcache for this but i don't wanteleventy-imgto process them at all.They are in png and for some reason
eleventy-imgends up creating a bigger file.Source file 5.9Kb and output file is 7.7Kb.
Both png.
Is there a way to tell
eleventy-imgwe want to skip any kind of image processing?I tried using
sharOptionsto pass therawoption, but it doesn't seem to do the trick: