Images are available in the GitHub repository but not displayed in Netlify deploying

I’m trying to deploying a static site using an Hugo Theme through GitHub and Netlify, but i do not know why the images aren’t displayed.

In a local environment there is not this problem.


Obs.: I am using universal hugo theme

If you open DevTools you’ll see some errors, that is the first hint

Then if I inspect one of your broken images, for example this one

<img src="" alt=" soon" class="hidden-xs hidden-sm">

I notice you’re including static in the img src path. You need to remove that

Hi @zwbetz! Tks for your support!

I do not have a large experience with blogdown and this is my first experience with this static site generator.

I have tried this in a complete new static site using the function: blogdown::serve_site and I realized the same problem, during the local serving there is not any problem (display all the images), when I tried to deply in Netlify I’ve lost the images. I do not know how I could solve this.



Since your question is more blogdown related (which I have no experience with, and is off topic for this forum) I’d recommend posting it to the R Studio forums


A wild guess at part of the problem, since I don’t know blogdown either: Looking at your site I see the broken post images, so if I then look at the content files, I see something like:

banner: img/banners/banner-5.jpg
- lorem
date: "2015-10-10T13:07:31+02:00"
- ipsum
title: Migrate from Jekyll
draft: true

That img path is assuming relativity from the location of the post, but, the images are actually in /static/img/... so, you need to add a leading slash in the frontmatter.

banner: /img/banners/banner-5.jpg
1 Like

Unfortunately @RickCogley, it didn´t work…tks for help!

The ~ in the url is wrong. Search for it, take it out.
Seconly as mentioned before: /static/ is most probably too not part of the url as all static items are copied into the root directory on build.

Currently there’s some problems as there’s no / between the end of your domain name as the folder your assets are located.

I think you need to have a trailing / in your baseURL setting. So change to read baseURL = ""