Root level assets not loaded on Github Pages

Hi, I’m building a simple blog based on the minima theme using Jekyll. It worked well locally but when I deployed it on Github Pages, root-level assets like favicon.ico etc. are not loaded. I also had to set the baseurl to / in _config.yml to make Github Pages load the stylesheet from /assets/css/main.css correctly. Any help would be appreciated. Thanks.

Here’s my current _config.yml:

title: AIwaffle
description: >- # this means to ignore newlines until "baseurl:"
  An AI learning platform for beginners.
baseurl: "/" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g.
github_username:  AIwaffle

# Build settings
markdown: kramdown
theme: minima
  - jekyll-feed

Link to site:
Link to repo:

that is most likely what your baseurl should be. If you just have / it is loading from whatever css your username repo is using which is probably the same it sounds like.

/AIwaffle-blog doesn’t seem to be working either locally or on github pages.

I think it is - sort of.

The logo is not loading cause the path does not have the baseurl, try prepending relative url like the link does in your header include:

<a class="site-title" rel="author" href="{{ "/" | relative_url }}">
      <img src="/assets/images/logo.svg" alt="AIwaffle logo" class="header-logo"/>

you need to do the same thing to all the icons, since you are using GH pages with a project, the root of the site is really a sub folder, your icon paths do not include the subfolder (baseurl) in the path so they are trying to load from the root of your username repo rather than the root of the project (sub folder in your username folder).

1 Like

Now it works. Thank you very much.