Replies: 1 comment 6 replies
-
According to @Princesseuh's response on Bluesky this should already work! If it doesn't, we can probably consider it a bug. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
I'd like to leverage Astro's image optimization service in a
.mdx?
file without needing to traverse the directory structure, using the paths configuration from thetsconfig.json
.Background & Motivation
The docs mentions that you can get files optimized from the
src/assets
directory in.mdx?
files however that requires you to recall and retype the path to those images. In many cases since these content files are deep within a structure that has nothing to do withsrc/assets
, you need to go down and come back up. It would be easier to leverage the existing@assets
alias defined in thetsconfig.json
to point to these assets.Note
I'm aware that
.mdx
files can import using aliases but that requires the use of the<Image/>
element as well. This is more cumbersome than using standard markdown syntax (![]()
).Goals
src/assets
in.mdx?
files.Example
Beta Was this translation helpful? Give feedback.
All reactions