You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @astrojs/image and mdx, I was able to override the img tag to do extra processing on the image (i.e. get the average color of the image and set it as the background color of the image). It would also allow the image to be processed by remark plugins, like remark-unwrap-images, which prevents extraneous <p> tags to wrap images.
The above code would combine such that the image in my-first-blog.mdx would have a nice background color when the image is not loaded AND the <img /> would be at the root level of the generate MDX HTML.
After
After setting up Astro Assets according to the guide and updating MyCoolImage.astro with the following changes:
Another big picture question: How are we supposed to control quality / size of mdx images in the asset system? I would love to not have to update all my calls to be aware of defaults around this and I'm not seeing a global default control for this a la Next/Gatsby?
Another big picture question: How are we supposed to control quality / size of mdx images in the asset system? I would love to not have to update all my calls to be aware of defaults around this and I'm not seeing a global default control for this a la Next/Gatsby?
There's currently no way to do this, sorry for the inconvenience. We're still considering what is the best way to do this
What version of
astro
are you using?2.7.4
Are you using an SSR adapter? If so, which one?
Netlify / None
What package manager are you using?
npm
What operating system are you using?
Linux, Mac
What browser are you using?
Chrome
Describe the Bug
Before
When using
@astrojs/image
and mdx, I was able to override theimg
tag to do extra processing on the image (i.e. get the average color of the image and set it as the background color of the image). It would also allow the image to be processed by remark plugins, like remark-unwrap-images, which prevents extraneous<p>
tags to wrap images.Take the example blow:
📁
src/components/Post/MyCoolImage.astro
📁
src/components/Post/components.astro
📁
src/content/blog/my-first-blog.mdx
The above code would combine such that the image in
my-first-blog.mdx
would have a nice background color when the image is not loaded AND the<img />
would be at the root level of the generate MDX HTML.After
After setting up Astro Assets according to the guide and updating
MyCoolImage.astro
with the following changes:It seems that
MyCoolImage.astro
is no longer being called NOR is the image running through any of the remark plugins relevant to it.What's the expected result?
In the below minimal replication app of the above issue, I would expect heading to http://localhost:3000/blog/markdown-style-guide/ to throw an error.
<img />
override<PostImage />
component that just throws an error that is never thrown with the asset setupLink to Minimal Reproducible Example
https://github.com/eligundry/astro-asset-bug
Participation
The text was updated successfully, but these errors were encountered: