Reputation: 263
I am trying to create a website using Github pages and Jekyll. After finding one preferred template, forking it, and running the website, I see that my website is not the same as the template.
I receive this error under "inspect element -> console":
Failed to load resource: the server responded with a status of 404 (Not Found)
A friend of mine said that Jekyll could not load the resource because this website is dynamic, whereas Github only hosts static pages.
Is it possible to host this template on GitHub?
Image of my website:
UPDATE: There seems to be missing a file titled modernizr.js
which I could not find in the original repo. I created a new issue and hope the owners of the repo respond. This however is also shown when inspecting the original template. So this might not be the problem.
SECOND UPDATE: When I inspect both the original template, and my version of the website, under Sources
I see that assest/css
of the original template has two more .css
files. My repo has those files, but my website does not seem to load them.
Upvotes: 2
Views: 1498
Reputation: 7141
Without seeing the actual URL or knowing if the screenshot is the local or hosted website, it's a bit difficult to say what's going on. If possible, you could send a link or clarify if the screenshot is local or hosted.
However, usually this 404 indicates a base_url problem. It is possible, that on GitHub you are hosting from a subfolder, while you don't do that local.
If this is the case, you can fix it by using a baseurl. You can add the base URL in _config.yml. Or you could set it at generation time by using:
--baseurl URL
Another option would be to use environments. Personally, I would create a simple shell script for generating for GitHub and use the --baseurl modified, but that's totally a matter of taste.
Re your friends answer, GitHub is indeed hosting the website static. Actually you are running Jekyll "dynamic" local, but it's also generating static content. Thus Jekyll serve does nothing else than putting static content to a folder, which is then served by web rick. There is no "real" dynamics like in PHP. It should also not have anything to do with your problem.
UPDATE: I was checking your sites repository and it seems there is no file called modernizerjs. https://github.com/aulon/mjeshtri/tree/master/assets/js Is it possible you forgot to commit it?
UPDATE 2: This is the problem: https://github.com/st4ple/solid-jekyll/blob/master/_includes/css/style.css#L13-L14 The files are both imported, but this import does not respect the baseurl. You can either process this file by adding front matter and applying the base url, or you remove these two lines and link it from head.html directly. I would do the second one.
Upvotes: 1