Next.js Discord

Discord Forum

Dynamic image import for statically generated pages

Unanswered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
Hi all! I'm attempting to build a documentation site using markdoc and appdir and have run into a small hurdle. I'd like to be able to co-locate my images along side my markdown files and hopefully use with next/image. I'm not sure how I should go about making those images available in the build – next/image supports imported images and places them in .next/static/media but I'm not sure how I could achieve the same thing "dynamically" when generating the pages.

Am I better off having a seperate process where these are copied to some external location for serving and then rewrite the urls? Am I think about this incorrectly?

0 Replies