@manishsindur
Posted
Removing a / from the src attribute before assets likely solved the problem of loading an image because it changed the path resolution behaviour in HTML.
Make sure to check your Github as i made a Pull request
When you specify a path in the src attribute of an img tag without a leading /, the browser interprets it as a relative path. By removing the /, you made the path relative to the current page's URL instead of an absolute path.
- For example, if your page URL is https://www.example.com/recipes/omelette.html and the original src attribute was src="/assets/images/image-omelette.jpeg", the browser would look for the image at https://www.example.com/assets/images/image-omelette.jpeg.
- By removing the leading / and having src="assets/images/image-omelette.jpeg", the browser now looks for the image relative to the current page's URL, resulting in https://www.example.com/recipes/assets/images/image-omelette.jpeg.
So, removing the / changed the path resolution to be relative to the current page, which likely resolved the issue of the image not loading.
Marked as helpful