简体   繁体   English

使用 Next.js 中同一文件夹中的图像 in.md 文件

[英]using image in .md file from the same folder in Next.js

I am working on a blog using Next.js Static Site Generator.我正在使用 Next.js Static 站点生成器编写博客。 We have a blog folder that contains other folders of individual blogs.我们有一个博客文件夹,其中包含各个博客的其他文件夹。 Each blog contains some images and a .md file.每个博客都包含一些图像和一个.md文件。 The .md file is using images to display. .md文件使用图像来显示。 The images are not showing.图像未显示。 If I add images to public folder it works.如果我将图像添加到public ,它可以工作。 But is there any way I can use images from the same folder itself.但是有什么方法可以使用来自同一个文件夹本身的图像。

在此处输入图像描述

在此处输入图像描述

If you want to stick to follow the Next.js rules, Store the static images in public folder.如果您想坚持遵循 Next.js 规则,请将 static 图像存储在公共文件夹中。 Thats what Next.js is generated for.这就是生成 Next.js 的目的。 Access to images besides images in public folder wouldnt be automatic.访问公共文件夹中图像以外的图像不会是自动的。

https://nextjs.org/docs/basic-features/static-file-serving https://nextjs.org/docs/basic-features/static-file-serving

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM