Problems with rendering on Github Pages

I created a page for my band in the last few days and wanted to publish it to Github pages. I’ve done it bevore and didn’t run into any problems.

I followed the guide for hosting on Github Pages and everything seemed to work before. I’m not the best at programming etc. so it is possible that i’ve overlooked something really simple but I’m at my wits end.
The problems i’ve run into are:

  • Image and CSS rendering. Images and some stuff that worked locally on my machine are not displaying right. For example, images not showing up. Especially in the header or in the gallery. And posts showing way to much and breaking the visual structure of the site.
  • The site doesn’t work anymore on my local machine. It gives me the 404 Error page.

All i’ve done is push to Github and adding a workflow. I checked the image links, but they seem to be correct.

Link to the repo: GitHub - Pfnuesel/dekadenz
Link to the Pages site: Dekadenz Diarrhö

If anyone has some tips or sees the problem, i’m thankful for every lead.

Cheers

Forgot to mention my Hugo version is: v0.123.7+extended on Linux Ubuntu

A bit more detail would have been helpful – not everybody is aware that your “gallery” is accessed using the “Fotos” menu. And I don’t see any errors with the images in the header, but then you don’t say what you expect there.

Now, if you open “Fotos - Dekadenz Diarrhö”, you see these errors in the browser’s developer console (and you’d probably see them, too):

Apparently, the paths to your images are not correct. The correct one would be (eg)
https://pfnuesel.github.io/dekadenz/konzerte/post/post2.jpg
You are serving your pages from “Dekadenz Diarrhö”, not from “https://pfnuesel.github.io/

It’s all about how you reference your images in “infos/fotos.md”. I’m not sure about the correct way to specify the img URL in your case, but I’d try to use a relative URL instead of an absolute one. That’s what you do with your thumbnail in the posts.

1 Like

Sorry, forgot about the language change. Will try to keep that in mind in the future!

Very weird. In a different project the paths referred automatically to the static folder and worked fine. Seems i have to reference the repo folder in this one.

Thank you very much it worked to some extend! I think I can fix it now.

Static gets copied to your public directory (eg “static/img” ends up in “public/img”). But your images are elsewhere. You’ll find lots of threads here concerning similar issues (“My images/CSS/whatever work fine locally but not in deployment”).

1 Like

depends o if your site is served from a subfolder.

heres a similar topic with a nice solution

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.