File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default function DocImage({
2424 // If the image src is not an absolute URL, we assume it's a relative path
2525 // and we prepend /mdx-images/ to it.
2626 if ( src . startsWith ( './' ) ) {
27- src = path . join ( '/mdx-images' , src ) ;
27+ src = '/mdx-images/' + src . slice ( 2 ) ; // Remove './' and prepend '/mdx-images/'
2828 }
2929 // account for the old way of doing things where the public folder structure mirrored the docs folder
3030 else if ( ! src ?. startsWith ( '/' ) && ! src ?. includes ( '://' ) ) {
@@ -34,6 +34,9 @@ export default function DocImage({
3434 // parse the size from the URL hash (set by remark-image-size.js)
3535 const srcURL = new URL ( src , 'https://example.com' ) ;
3636 const imgPath = srcURL . pathname ;
37+
38+ // Debug: log the final URL (remove this after testing)
39+ console . log ( 'DocImage - Final src:' , src , 'imgPath:' , imgPath ) ;
3740 const [ width , height ] = srcURL . hash // #wxh
3841 . slice ( 1 )
3942 . split ( 'x' )
You can’t perform that action at this time.
0 commit comments