[Solved] Having problem to insert a specific image

Hi!
I would like to insert an image in my post. My images folder looks as following:

public
    img
        fberrez.jpeg
        planning.png

I can insert “/img/fberrez.jpeg” in my post but “/img/planning.png” does not work.
I tried the markdown syntax and Hugo shortcodes.

Does not work:

!["example of my first impossible day planning"](/img/planning.png "example of my first impossible day planning")

Work:

!["example of my first impossible day planning"](/img/fberrez.jpeg "example of my first impossible day planning")

Hugo version: 0.47.1

Would you have an explanation to give me?

I’m not familiar with that syntax. Does this work instead?

![example of my first impossible day planning](/img/planning.png)
  • Why do you have the string double quoted in the Alt text field of the image?
  • What does the same string appended to the link portion of the image path mean? I’ve removed it.

I already tried your syntax but it does not solve my problem.

Thanks anyway :slight_smile:

I assume you have those in your static folder, under static/img, correct?

Things to check:

To add to what @RickCogley said, if nothing helps, share your site source. That’s the best way to move forward. Right now, we are all just guessing, which is not very efficient.

Yeah perfect, it works.

My image was in public/img and not in static/img.

Thanks guys

It is possible to put something in public, deploy public to a web server, and see what you added after the hugo build. However, it is best to treat public as an output folder only, doing everything within the Hugo project folder instead. No surprises that way.