Prepend "./src" if not present
This commit is contained in:
parent
78fb47cd01
commit
f029a43a8e
1 changed files with 5 additions and 0 deletions
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Reference in a new issue