Hi guys, I’m Hugo first-time user and I’m having a problem loading the fonts and images in production on GitHub Pages.
Right now I’m working on the index/landing layouts/index.html page and while everything works fine locally I can’t get fonts and images loaded in production cause of the 404 I’m getting due to the wrong path.
I attempted to resolve this by reviewing the documentation and community forum, but was unsuccessful. Thus, I am creating this topic.
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
For the fonts, it all depends on the location of the CSS and the font files relative to each other. A relative font path in the CSS is interpreted relative to the CSS’ location.