.md file Image from the same folder in Next.js

Viewed 340

Im trying to get some markdown posts to display through NextJS

I'm using react-markdown to render the markdown itself, however, I'm running into an issue trying to display images.

My markdown files are structured the following way:'

Content
- img
-- Random
--- Image1.png
- Random.md
- Folder A
-- Sub-folder A.md
-- img
--- Sub-folder A
---- Image.png

In the markdown files, all images use relative paths ./img/Sub-folder A/Image.png

I know that nextjs has a public folder for static file serving, however, I do not want to change the structure with which the content is stored.

Is it possible to do so through the transformImageUri prop for ReactMarkdown?

0 Answers
Related