Skip to content

How to use image path variable in mdx file? #2519

Closed Answered by ChristianMurphy
yuijzeon asked this question in Q&A
Discussion options

You must be logged in to vote

Duplicate of #2411

MDX is not a templating language where you can add variables anywhere you want. So you can’t put braces anywhere (and that’s not a goal).

Markdown already has references/definitions. You don’t need variables to solve this:

Some [link][some-url]

[some-url]: https://whatever

You can also already use JSX for this:

export const whatever = 'https://example'

Like <a href={whatever}>*this*</a>.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@yuijzeon
Comment options

Answer selected by yuijzeon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants