Hugo site not rendering on github pages

I have created a portfolio using Hugo and deploy it on github pages. The portfolio is rendering properly localy, every thing is fine. baseURL = “” I build it over “ananke” theme.

Drop it on github pages But when i open the site it’s not rendering properly, images are missing, links are broken. Seems like a css problem, checked that there is a main.min.css file in the public folder generated after conversion.

If anyone can help pls.

  • Added the statement: canonifyURLs = true
  • Added the “/” at the end of the baseURL name
  • Converted it to html using ./hugo -D
  • Tried all i can find internet and decided to open an issue.

the link to the repo is repository

Sorry if I’m off topic but you’re versioning the HTML produced by Hugo, I’m not sure it’s a good idea.
By the way if you share the source of your code it will be easiest to help you. Your config seems good but if we can try it, it will be better!

1 Like

Screenshot 2023-03-23 130343

It is an easy fix, your images and css are not resolving as either absolute or relative links.
So for the first image you want
src=“/images/data.jpg” or “
What you have at the moment is “

1 Like

i have putted the github repo in the issue, u can access to the code.
Thanks in advance

Again, your repository contains the HTML produced by Hugo, but not the source code: your Hugo’s config, the templates/layouts, the Markdown files, etc. I can’t help you.
If you just want to correct the HTML, @andrewd72 is correct.

Ah sorry for the misunderstanding…
I am trying to fix the html according to @andrewd72 solution, but i want to fix the issue in the source code too so next time i will be ready to go.
Just pushed the source code on the link :


Thanks for the reply and the solution. Going to try that , and i will edit this answer to let you know that i fixed it and close the issue

Realy appreciate the help

As @andrewd72 said, your URLs have problem, you can correct that in your config.toml file: baseURL = ""
Try that in first.

1 Like

I wasn’t suggesting you fix the output html, just showing where the problem was so that you know where to look to fix the templates and/or config.

1 Like

@antoinentl @andrewd72 Thanks , it’s working , really easy fix, just added https in the config file.

Thanks a lot , really appreciate the help.

1 Like

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