Search code examples
vue.jsnuxt.jsmarkdown

Nuxt.js: How to include local images in Markdown blog content?


I created a blog in Nuxt.js which uses Markdown for my articles. When writing my first article, I realized I can't include images in my markdown article from my assets folder. It only works if it's a link like the example below:

Markdown Image:

alt text

How can insert an image in Nuxt.js Markdown from this location? assets/images/blog/trees.png


Solution

  • Looks like relative paths are not currently available: https://github.com/nuxt/content/issues/693#issuecomment-750412810

    Only absolute paths should work after placing the image in the /static directory

    ![alt text](/images/blog/trees.png)