Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github pages, bootstrap css remotely: Failed to load resource: the server responded with a status of 404 (Not Found)

I have my customized bootstrap website which I push on github pages. Locally it works very fine, no problem at all, but when is online the style is messy and these messages appear on the console:

Failed to load resource: the server responded with a status of 404 (Not Found)   https://nickname.github.io/repo/vendor/font-awesome/css/font-awesome.min.css Failed to load resource: the server responded with a status of 404 (Not Found)

in my code, css is declared as follow:

<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

why locally works and not remotely?

like image 497
Colet Avatar asked Nov 06 '16 10:11

Colet


2 Answers

Thank you all. The problem was that recently Github updated to Jekyll v3.3, which ignores vendored files by default. As I was not using Jekyll for my Pages site, I had to add a .nojekyll file to the root of my repository to disable Jekyll from building my site. Once I did that, my site built with my vendored files without any problems.

like image 117
Colet Avatar answered Oct 17 '22 02:10

Colet


It looks like you are using Jekyll for your GitHub page. As for the Jekyll 3.3 from Nov 2016, the vender folder is ignored.

Jekyll now ignores the vendor and node_modules directories by default.

You can either rename the vender folder to some name like libs and refer to the new path, or follow Jekyll's suggestion

If you need those directories included in your site, set exclude: [] in your site's configuration file.

Hope it helps:)

like image 2
hackjutsu Avatar answered Oct 17 '22 02:10

hackjutsu