#Eager image attributes in mdx

1 messages · Page 1 of 1 (latest)

empty cobalt
#

Hi there, just updating to 4.4 and got a question.
I've got a blog post written in markdown with an image near the top of the post. The Astro dev toolbar audit is recommending that I Use the loading="eager" attribute on the image.
Does anyone know how to achieve this in md/mdx?
Thanks in advance 🙏

kindred wharf
#

You would need a remark plugin, since there's no way to pass attributes to images in Markdown's native syntax, unfortunately. This one is great https://www.npmjs.com/package/remark-imgattr

#

Cc @heavy copper

empty cobalt
#

Hey that worked out great, thank you @kindred wharf