Images from assets folder not showing on Github Page

None of my pictures will show from my assets folder.  Does anyone have any suggestions.

Hey @bethanybeachbum,

Thanks for being here! sharing you repo here would help our community take a look and see how we can help.

Greetings @andreagriffiths11,

Since the original question is not answered, and I have the same issue, I’m going to “jump on the ride”.

Here is the address to My repository. It is a private repository for the moment, but I’ve taken the liberty to make you a collaborator.

I’m just starting with Github Pages, Jekyll, Markdown and Git. So my blog is “under construction”. In the local server, everything looks as intended. I can see the images of the only post with images. Once I push the changes to the repository, GitHub seems it does not “find” the files.

To try to solve the issue, I have tried to load the image using what I guess is html script:

<img src="/assets/images/efield_distances.jpg">

And to add the slash within a relative path in markdown:

![E-field-distances](/../assets/images/efield_distances.jpg)

Nothing seems to work. Any lights on the problem are mos welcomed.
In advance, thank you very much for your help.

Hi @diazlg! This topic is so old, it’s a wonder you managed to find it :laughing:

You’re most likely facing the same problem in this thread here, I’d recommend having a read of that and looking at my solution:

Because your site has a repository name PSLightning in the URL this can cause some differences in how you need to reference your assets between your Pages site and on GitHub.com.

In this case I’d recommend converting your image references to markdown, then using a non-relative path starting with a /, but without a specific domain (no https://diazlg.github.io/).

The / causes the browser to search from the root of your domain, rather than relative to the folder you’re in, so make sure to build your path as if you’re starting from the root of your repository when entering the path to your images.

Finally, to make it work on Pages, you’ll need to make sure your site’s baseurl value is set correctly. You’ll need to create a file called _config.yml at the root of your site (if you don’t have one already) and set the following:

baseurl: /PSLightning

This should make your images work on both Pages and on GitHub.com.