Skip to content

v1.6.0

Latest

Choose a tag to compare

@github-actions github-actions released this 21 Oct 02:26
· 16 commits to main since this release

   🚀 Features

  • Add support to handle strings paths, module-like imports and dynamic imports  -  by @felixicaza (8e516)

Now you can also put the image path as string directly in the src prop. Support absolute paths in src folder, relative paths and alias.

Example with absolute path:

---
import { Image, Picture } from 'astro-lqip/components';
---

<Image src="/src/assets/images/image.png" alt="Cover Image" width={220} height={220} />
<Picture src="/src/assets/images/other-image.png" alt="Other Image" width={220} height={220} />

Example with relative path:

---
import { Image, Picture } from 'astro-lqip/components';
---

<!-- assuming you are on the path `/src/pages/index.astro` -->
<Image src="../assets/images/image.png" alt="Cover Image" width={220} height={220} />
<Picture src="../assets/images/other-image.png" alt="Other Image" width={220} height={220} />

Example with alias:

---
import { Image, Picture } from 'astro-lqip/components';
---

<Image src="@/assets/images/image.png" alt="Cover Image" width={220} height={220} />
<Picture src="@/assets/images/other-image.png" alt="Other Image" width={220} height={220} />
    View changes on GitHub