Ankit Sinha
Ankit Sinha

Reputation: 1680

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

I am working on a blog using Next.js Static Site Generator. We have a blog folder that contains other folders of individual blogs. Each blog contains some images and a .md file. The .md file is using images to display. The images are not showing. If I add images to public folder it works. But is there any way I can use images from the same folder itself.

enter image description here

enter image description here

Upvotes: 1

Views: 650

Answers (1)

pearllv
pearllv

Reputation: 288

If you want to stick to follow the Next.js rules, Store the static images in public folder. Thats what Next.js is generated for. Access to images besides images in public folder wouldnt be automatic.

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

Upvotes: 1

Related Questions