From f029a43a8ef75d88a44dde1f00d0c046e73e3693 Mon Sep 17 00:00:00 2001 From: madrilene Date: Fri, 10 Jan 2025 12:44:22 +0100 Subject: [PATCH] Prepend "./src" if not present --- src/_config/shortcodes/image.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_config/shortcodes/image.js b/src/_config/shortcodes/image.js index e1eed56..55aff34 100644 --- a/src/_config/shortcodes/image.js +++ b/src/_config/shortcodes/image.js @@ -21,6 +21,11 @@ export const imageShortcode = async ( sizes = 'auto', formats = ['avif', 'webp', 'jpeg'] ) => { + // Prepend "./src" if not present + if (!src.startsWith('./src')) { + src = `./src${src}`; + } + const metadata = await Image(src, { widths: [...widths], formats: [...formats],