# Image linking

**URL:** <https://discourse.gohugo.io/t/image-linking/47315>\
**Category:** support\
**Tags:** images\
**Created:** [December 1, 2023, 3:45pm UTC](https://discourse.gohugo.io/t/image-linking/47315 "2023-12-01T15:45:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frost26](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frost26/32/20787_2.png) [@Frost26](https://discourse.gohugo.io/u/Frost26)\
**Post date:** [December 1, 2023, 3:45pm UTC](https://discourse.gohugo.io/t/image-linking/47315/1 "2023-12-01T15:45:12Z")

</div>

I am having an issue with linking images. I am using Hugo on my local Linux machine, and I have set up my site with the theme, etc. I am creating a new post with the markdown file and added all the content. However, when I try to link the images using the following method, and run the local server to display the page, I get the text but no image is displayed. I have tried specifying multiple different paths, but I am still encountering the same issue.

![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/a/7/a7a12fa7b480427f28e448f56617d12e3af51ca0.png)

All of the image files are in the static/images folder and I have looked online and most people are either using “(images/xxx.png)” or just the image file name “(xxx.png)”. And all spellings have been checked and names even changed as a test, even using different file format for images.

Does anyone know what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [December 1, 2023, 3:59pm UTC](https://discourse.gohugo.io/t/image-linking/47315/2 "2023-12-01T15:59:55Z")

</div>

What’s your `baseURL` in the configuration file?

---

<div class="post-metadata">

**Author:** ![Frost26](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frost26/32/20787_2.png) [@Frost26](https://discourse.gohugo.io/u/Frost26)\
**Post date:** [December 1, 2023, 5:41pm UTC](https://discourse.gohugo.io/t/image-linking/47315/3 "2023-12-01T17:41:24Z")

</div>

I pre-set it to my domain. Also I’m getting the same even after I have put the site into Github pages.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 1, 2023, 6:16pm UTC](https://discourse.gohugo.io/t/image-linking/47315/4 "2023-12-01T18:16:22Z")

</div>

A URL without a leading slash is relative to the current page.

A URL with a leading slash is relative to the server root.

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [December 1, 2023, 8:12pm UTC](https://discourse.gohugo.io/t/image-linking/47315/5 "2023-12-01T20:12:57Z")

</div>

Just noticed you said the images are in the static folder! For that, you will need to add a leading slash as Joe suggested. `[image](/image/test.jpg)`.

---

<div class="post-metadata">

**Author:** ![Frost26](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frost26/32/20787_2.png) [@Frost26](https://discourse.gohugo.io/u/Frost26)\
**Post date:** [December 2, 2023, 4:26pm UTC](https://discourse.gohugo.io/t/image-linking/47315/6 "2023-12-02T16:26:11Z")

</div>

Well that’s embarrassing because Im pretty sure I did this like two days ago. Either way that works. So I appreciate the help from both of you @jmooring @Arif, Thank you!

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [December 2, 2023, 4:28pm UTC](https://discourse.gohugo.io/t/image-linking/47315/7 "2023-12-02T16:28:36Z")

</div>

> [@Frost26](#):
>
> Either way that works

That is incorrect. Either way _may_ work on the home page, because both resolve to a file in the server root.
