1

So close yet so far to finishing my site. Can't for the life of me get assets to load on the web page. They work fine on the local host. Have tried what feels like every combination of URL and baseurl. Been working on it for the entire day and I want to tear my hair out.

Code: https://github.com/debrincat/dd_blog.git

Website: https://debrincat.github.io/dd_blog/

DeBrincat
  • 11
  • 1

2 Answers2

1

The images are not working as the image location is incorrect.
As in most of the places including the Error 404 page, the link is given wrong, as:
<a class="logo__link" href="deandebrincat/">Dean DeBrincat</a>

Instead you should have used,
<a class="logo__link" href="/">Dean DeBrincat</a>
And for the images:
Use <img src="/images/04-1.jpg" alt="Page not found"> instead of <img src="deandebrincat/images/04-1.jpg" alt="Page not found">

m24197
  • 1,038
  • 1
  • 4
  • 12
0

The issue is that the location of your images is at:

https://debrincat.github.io/dd_blog/images/p1.jpg

Where as your HTML is pointing to:

https://debrincat.github.io/dd_blog//images/p1.jpg

To fix this, in your you need to change each image to point to "images/p1.jpg" not "/p1/kitty.jpg".

When you put "/" before the link, it means an absolute path, which is the path in the highest directory of the project. You want the relative path, so we deleted the first /.

Something wrong in html:

<img src="/images/p1.jpg" alt="Dean DeBrincat's Picture">

You can find this error by pressing F12 in the browser and clicking console

William Mou
  • 301
  • 2
  • 4
  • However every page and such also doesn't work. I don't understand how every single page is wrong because of the / but it works locally? Is there not something I can change in either the url or base url to fix – DeBrincat Feb 13 '21 at 09:18