Displaying an image in a post

I am totally new to HUGO and having problems displaying an image in a post.
I created my post and called it post01. In the markdown file I added the following.
I have copied my image into the posts folder and also a sub folder called post01.
None of the following show the image and it is not in the source code when the
server is run. What am I missing?
![test image1] (/post01.jpg)
![test image2] (IMG/post01.jpg)
![test image3] (/IMG/post01.jpg)
![test image4] (post01/post01.jpg)
![test image5] (/post01/post01.jpg)

Is there somewhere I can download a example .md file with the image code in place…?

I would say the space between ] ( is the error if this is not a formatting thing you did for this forum.

you can add code to the forum by using three backticks before and after the code.

![test image1](/post01.jpg)
![test image2](IMG/post01.jpg)
![test image3](/IMG/post01.jpg)
![test image4](post01/post01.jpg)
![test image5](/post01/post01.jpg)

There is no space. Should there be?

no, there should not. but in your copied code there were.
where is the image located in your directory (relative to the md file with the tags above)?

Thanks for your assistance. I have copied the image into the same folder, a sub folder and also in the static folder.

Not sure if you can assume to use normal markdown to reference bundled images. Try a test. Put one in static and try accessing it from there.

If the image is in /static/filename.jpg you can reference it with ![test image1](/filename.jpg).
the / always starts looking at the system root. everything in static gets copied over to the root.

1 Like

Thanks for your help guys, having the images in the same folders appears to work. However I never managed to
get the replaceable image code working.

I added an html img tag the list.html and set the file variable for the filename.
{{.Title}}

<a href="{{.URL}}"><img src="{{.File}}.jpg" width="300" height="auto" border="0" alt="{{.Title}}"/></a>