Adding a link to an image in a .md file that opens another .md file

I am using the casper theme. In there the folder structure is like this:


All the .md files in post folder are pages.
in the post folder I have two .md files, let’s call them and
In the I have an image, let’s call it image.png.

I want to add a link to image.png such that when the image is clicked, it opens and shows its content i.e I want the webpage address to become when image in is pressed.

How can I do that? Thanks in advance for your help.

For clarification, are you asking how to write an HTML link? Have you tried doing it, and it is failing?

Just want to know if you are asking an HTML question, or a Hugo question. :slight_smile:

<a href=""><img src="/image.png" /></a>

Just to clarify: you want to make an image in one page link to a second page? That’s just a combination of the markdown syntaxes for links and images:

Link: [Text](URL)
Image: ![Alt Text](URL)

Linked image: [![Alt Text](Image URL)](Link URL)

And, for bonus points, you can use the ref and relref shortcodes to generate the link to the other page. So, for your example:

[![This is my image](/path/to/image.png)]({{< relref "post/" >}})

Thanks for the response, I was asking about markdown, not HTML. I appreciate your answer.

Thank you very much, this is exactly what I was looking for :slightly_smiling: