# \[SOlved\] How to... insert image in my post?

**URL:** <https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473>\
**Category:** support\
**Created:** [July 25, 2015, 1:40pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473 "2015-07-25T13:40:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pietrondo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pietrondo/32/561_2.png) [@pietrondo](https://discourse.gohugo.io/u/pietrondo)\
**Post date:** [July 25, 2015, 1:40pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/1 "2015-07-25T13:40:24Z")

</div>

Hi, I have a big question… how can I insert image in the post? where i need to put them? in witch directory?

thanks…

---

<div class="post-metadata">

**Author:** ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)\
**Post date:** [July 25, 2015, 2:00pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/2 "2015-07-25T14:00:00Z")

</div>

> how can I insert image in the post? where i need to put them? in witch directory?

With [MarkDown formatting](https://guides.github.com/features/mastering-markdown/), like this:

```
![Example image](/static/image.png)

```

The images should be put in the `static` folder, which will be copied to the root of the website (so `www.example.com/image.png`) by Hugo. I don’t like that, and so I put them in the `static/static` folder, so their url is `www.example.com/static/image.png`.

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [July 26, 2015, 8:54am UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/3 "2015-07-26T08:54:31Z")

</div>

You can organize `/static` if you like, as well. Say, `/static/img` or whatever.

---

<div class="post-metadata">

**Author:** ![pietrondo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pietrondo/32/561_2.png) [@pietrondo](https://discourse.gohugo.io/u/pietrondo)\
**Post date:** [July 26, 2015, 6:19pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/4 "2015-07-26T18:19:15Z")

</div>

Ok thanks you

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [July 27, 2015, 1:20am UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/5 "2015-07-27T01:20:43Z")

</div>

Note also you can use html directly in your markdown files. If the simple Markdown format is not enough, that is.

---

<div class="post-metadata">

**Author:** ![muashraf](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@muashraf](https://discourse.gohugo.io/u/muashraf)\
**Post date:** [June 21, 2016, 2:30pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/6 "2016-06-21T14:30:52Z")

</div>

And what if we want to add a bootstrap img class to the image element?

---

<div class="post-metadata">

**Author:** ![muashraf](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@muashraf](https://discourse.gohugo.io/u/muashraf)\
**Post date:** [June 21, 2016, 2:31pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/7 "2016-06-21T14:31:37Z")

</div>

> [@muashraf](#):
>
> And what if we want to add a bootstrap img class to the image element?

And what if we want to add a bootstrap img class to the image element?

---

<div class="post-metadata">

**Author:** ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)\
**Post date:** [June 21, 2016, 2:41pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/8 "2016-06-21T14:41:44Z")

</div>

> [@muashraf](#):
>
> And what if we want to add a bootstrap img class to the image element?

Take a look at Hugo’s [shortcodes](https://gohugo.io/extras/shortcodes/).

---

<div class="post-metadata">

**Author:** ![JesseZhuang](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@JesseZhuang](https://discourse.gohugo.io/u/JesseZhuang)\
**Post date:** [June 23, 2016, 2:56am UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/9 "2016-06-23T02:56:50Z")

</div>

I want to add that with hugo 0.16 the path to refer to the image is

[/img/image.png]

hugo will copy this image to

public/img/image.png

which makes sense although the actual path is static/img/image.png.

The markdown preview won’t be able to show the image.

---

<div class="post-metadata">

**Author:** ![griestopf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/griestopf/32/2052_2.png) [@griestopf](https://discourse.gohugo.io/u/griestopf)\
**Post date:** [September 14, 2016, 9:21am UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/10 "2016-09-14T09:21:46Z")

</div>

I am new to Hugo. I understand the preferred way is to put ALL images of ALL content into a common “static” folder (while possibly creating subdirectories for images below that static folder) and use absolute paths (starting with a ‘/’) in my markdown. I don’t like this because it disables subdirectories of my content to be self-contained. Why isn’t it possible to add an image subdirectory to each content subdirectory or put the images directly into the content directory? The benefit would for example be that md editors with preview functionality such as Visual Studio Code could directly show the images in their previews as you can use relative paths.  
I observed that this seems to work when calling hugo serve with the “–renderToDisk” option. Why does this NOT work with hugo serving from memory? Is there any other drawback besides longer rendering times I will encounter when putting images directly below the content folder?

Thank you,  
Christoph

---

<div class="post-metadata">

**Author:** ![griestopf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/griestopf/32/2052_2.png) [@griestopf](https://discourse.gohugo.io/u/griestopf)\
**Post date:** [September 14, 2016, 9:41am UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/11 "2016-09-14T09:41:53Z")

</div>

Sorry, I just noticed that in general my attempt seems to work - even with hugo serving from memory. My fault was to name the directory “\_image”. Subdirectories below “content” starting with an underscore seem to be ignored by hugo serving from memory while being copied to the outputdirectory when hugo renders to disk.

---

<div class="post-metadata">

**Author:** ![michael\_henderson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/michael_henderson/32/10490_2.png) [@michael\_henderson](https://discourse.gohugo.io/u/michael_henderson)\
**Post date:** [September 14, 2016, 1:22pm UTC](https://discourse.gohugo.io/t/solved-how-to-insert-image-in-my-post/1473/12 "2016-09-14T13:22:56Z")

</div>

Closed on September 14, 2016, 1:22pm UTC


