diff --git a/.eleventy.js b/.eleventy.js index 036d48b..476e74d 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -16,6 +16,8 @@ module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy("src/.well-known"); + eleventyConfig.addPassthroughCopy("src/blog/**/*.png"); + let markdownItOptions = { html: true, breaks: true, diff --git a/eleventy.config.images.js b/eleventy.config.images.js index 7f632db..67e1e7a 100644 --- a/eleventy.config.images.js +++ b/eleventy.config.images.js @@ -26,10 +26,13 @@ module.exports = function(eleventyConfig) { // Warning: Avif can be resource-intensive so take care! let formats = ["avif", "webp", "auto"]; let input; + let originalSrc; if(isFullUrl(src)) { input = src; + originalSrc = src; } else { input = relativeToInputPath(this.page.inputPath, src); + originalSrc = '.' + src; // passthrough copy puts imags 1 level up } let metadata = await eleventyImage(input, { @@ -46,6 +49,8 @@ module.exports = function(eleventyConfig) { decoding: "async", }; - return eleventyImage.generateHTML(metadata, imageAttributes); + let imageHtml = eleventyImage.generateHTML(metadata, imageAttributes); + + return `${imageHtml}`; }); };