Correct usage of getImage function (#6068)

This commit is contained in:
Happydev 2023-01-31 17:50:17 +01:00 committed by Matthew Phillips
parent 81f6ece5ca
commit 6daf548688

View file

@ -422,7 +422,10 @@ This can be helpful if you need to add preload links to a page's `<head>`.
---
import { getImage } from '@astrojs/image';
const { src } = await getImage({src: '../assets/hero.png'});
const { src } = await getImage({
src: import('../assets/hero.png'),
alt: "My hero image"
});
---
<html>