CSS stylesheet keeps reverting to localhost instead of github page

Hi. I am using the latest version of Hugo and am using hugo-theme-console.
My github pages repo is: GitHub - whitson-buck/whitson-buck.github.io: My Personal Website

When I make a new post, the website works, but the css is non-functional. This is because it keeps linking to http://localhost:1313 instead of my repo. I am running hugo server in my folder but surely that isn’t causing this, right?

See image attached.

Share your project repository so that we can see your configuration and templates.

1 Like

no, it is hugo server but you hold it wrong

you push your generated public directory to your github pages repo. and build it with hugo server (cause there’s the livereload within the index.html)
you manually fixed that and later with replacing the hrefs.

to generate a publishable version you have to use hugo which will respect your sites baseURL.

not hugo server. the server is only for development and yes it uses localhos:1313.

  • you build your site using a Jekyll workflow - that’s at least uneccessary but may cause problems.
    You upload already generated content, and there’s no need to use jekyll build workflow at all.
    Check out the “Static HTML” action. A setup guide is here: How to host your first site for free on GitHub Pages - DEV Community

  • you also could consider to simply your setup, by committing the sources to your gh-pages repo and use a hugo build workflow to build and publish here’s the hugo documentation

    Host on GitHub Pages | Hugo

p.s. imho you have quite a complex setup with submodules … maybe overly complex

1 Like