Image in static folder not working

Hi, i’m new to hugo. I put a .jpg file in a folder called img inside the static folder, like so:
static/img/image.jpg, and in my post I did "errorlog" but on the site the image doesn’t show. There’s a broken image there.
How can i solve this?


First of all, it would be very useful to point us to your repository to understand your caode.
Second, I don’t at all understand

in my post I did “erorlog”

which has nothing to do with an image…

Sorry. My repository: here
What I meant was that I typed the line:
屏幕截图 2023-08-18 220725
in the second post.
Also please ignore the gallery images, that was another way of displaying images I failed to use.

Also, here’s the blog site: here

You are serving your site from a subdirectory:

So /img/foo.jpg doesn’t resolve to what you want.

The easiest way to handle this is by keeping your images with your page (a page bundle).

└── posts/
    ├── post-1/
    │   ├── foo.jpg
    │   └──



Stupid question: How do i create a page bundle? Do i just manually put them in a folder? What should i write in

hugo new content posts/post-1/

That’s where your markdown content goes. For example, instead of creating post like content/posts/ you create content/posts/lorem-ipsum/ Then you can put all your images for that page inside the lorem-ipsum folder and refer to them in your file. The command shared by Joe simplifies all this for you.