How to use image path variable in mdx file? #2519
-
I have a *.mdx file and I want to set the image src path with a variable import viteLogo from "@/assets/vite.svg";
{viteLogo}
{/* correct output: /src/assets/vite.svg */}
![VITE]({viteLogo})
{/* expect output: <img src="/src/assets/vite.svg" alt="VITE"> */}
{/* actual output: <img src="{viteLogo}" alt="VITE"> */} Is it possible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Duplicate of #2411
|
Beta Was this translation helpful? Give feedback.
-
As an alternative to @ChristianMurphy’s answer, you could use |
Beta Was this translation helpful? Give feedback.
Duplicate of #2411