Links on my repos doesnt seem to be woking anymore

here is my repo: Blog
css, javascripts, link to other pages does not work anymore. It works locally but not on github anymore, it used to work before. I checked the git logs there was no major change I did that would affect it(that I know of).

When I opened the site:
Check main.css:

Is getting 404 error.

Same for:

It’s a path problem.

Correct one:

On [username], the site is located at a sub-directory. Hence the resource paths being similar to You can either set baseurl config to /blog and try again or change the liquid variable in layouts to use the relative_url and absolute_url filters:

<link rel="stylesheet" href="{{ 'assets/css/main.css' | relative_url }}">

@SidV my path locally is {{site.baseurl}}/assets/js/image-preload,js

I don’t know why {{site.baseurl}} does not work anymore, it used to work last week.

In my config.yml baseurl is set to baseurl=’’

@ashmaroli I tried setting baseurl to /blog before and still wont link correctly.

Just now I tried using a custom domain, it works fine. But I don’t get why it does not work in gh-pages. All of my other repos have the same config.yml they work fine on gh-pages links and everything. I just can’t understand why this certain repo wont work on gh-pages.

That’s the problem.
I think you must use:

baseurl: "/blog/" #important: start with /
url: ""

@SidV yea the problem is the baseurl:'' It used to work a week ago. the problem with putting baseurl:/blog/ is that it wont work locally. I used to be able to work locally and push to github and both would work fine. Well I will try to revert back to jekyll 3.4 because all of my repos below 3.5 still work with baseurl=’’ for github.

Hi Juscuizon… You can work locally with baseurl if you apply --baseurl in your CMD line…

eg: bundle exec Jekyll serve --baseurl

Hope that can help.

@sparky i have no problem with my local baseurl, it is just with github, baseurl:'' does not work anymore on github it used to work about a week ago.

What exactly are you trying to achieve with baseurl: ''?

The correct way to use it has been best summarized here by one of the Jekyll maintainers:

1 Like