Resolve assets in markdown content
See original GitHub issueI would like to know if it’s possible to have the webpack assets resolution inside of markdown content ? To display webpack handeled’s images.
Reproduction link: https://codesandbox.io/s/dawn-snowflake-fv7l4?file=/content/post.md
- I have an image in the assets folder
- I link the image in the md file
![](~/assets/photo.jpg)
(or<img src="~/assets/photo.jpg">
in html) the same way I would have in a component template
I’m not interested in putting files in the static folder since there is no compression and no hash for cache-busting.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:52
- Comments:98 (8 by maintainers)
Top Results From Across the Web
Assets - Docusaurus
Sometimes you want to link to assets (e.g. docx files, images...) directly from Markdown files, and it is convenient to co-locate the asset...
Read more >How do I display local image in markdown? - Stack Overflow
The best solution is to provide a path relative to the folder where the md document is located. Probably a browser is in...
Read more >Asset Folders - Hexo
Global Asset FolderAssets are non-post files in the source folder, ... Referencing images or other assets using normal markdown syntax and ...
Read more >Working with Images in Markdown & MDX - Gatsby
... of markdown or MDX , insertion of images can enhance the content. ... as the markdown files, sourcing and resolving the images...
Read more >Asset Handling - VuePress
Sometimes you may need to provide static assets that are not directly referenced in any of your Markdown or theme components (for example, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
Is it possible to store the images under the content directory itself instead of in the assets directory? Then you could create a structure like:
content/articles/my-new-article/index.md content/articles/my-new-article/img/pic1.jpg content/articles/my-new-article/img/pic2.jpg content/articles/my-new-article/img/pic3.jpg
which would keep all the content together.
@davydnorris suggestion was helpful to me
I created a global
Image
component to work around with that and stored my images inside the/content/blog/my-blog-slug/images/
Make sure to register this component globally. Inside
components/global/Image.vue
and set thecomponents:true
in nuxt.config.jsInside Markdown:
I hope this will be helpful to someone. 🙌