CSS style not loading once site deployed

Hi there,

I have a problem with my CSS not loading after I deploy my site.
Website: https://othrif.github.io/
Github repo: https://github.com/othrif/notes_othmanerifki

When I run a local server with hugo, the site works fine. But when I deploy it to Github pages, I loose the CSS.

At least for the index page, I manually changed these lines after building the site:othrif.github.io/blob/master/index.html#L41-L42

For some reason, I get https://othrif.github.iocss instead of https://othrif.github.io/css. this fixed the style on the index page but the rest of the pages have problems.

Any pointers are appreciated.

1 Like

Some CSS seems to be loading for me. I’ll try running it myself later, but I see Python files in there, which GitHub pages won’t run. Maybe that’s the issue?

Edit: I think I know what the problem is. Look at lines 41 and 42. No need to use the GitHub pages link, instead, link to it like this:

<link href="/path/to/file.css" rel="stylesheet">

Thanks @Mr-Steal-Your-Script, indeed that was the issue. It is working fine now!

1 Like