How to reference an image inside your nuxtent markdown content file?
dimitrieh opened this issue · 12 comments
I could not find this anywhere in the documentation, so I think its best to get this issue out there.
When using HTML or markdown, the following does not work:
![img](~/assets/img/image.jpeg)
or
<img src="~/assets/img/image.jpeg">
Help is appreciated! If I find out myself, I will document here! 😉
should this be closed instantly due to a bot? cc: @joostdecock
You can use .comp.md
because it's loaded through webpack. If you can, document it as well!
@ishitatsuyuki can you elaborate? :)
@dimitrieh Change the content file extension to .comp.md
so it's loaded into the Webpack bundle. At there Webpack import syntax will just work.
@ishitatsuyuki you mean of the blog article or the images trying to load in? 🤔
@dimitrieh The article markdown, of course.
This is not clear at all
This module compiles to html as is and it outputs as html, there is no webpack parsing for the content inside the markdown files, so any image or asset should be static.
For the contrary if you use choose to use components (By using .comp.md extension) then it is parsed by webpack and the alias are applied.