2

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.

6
  • Please add a link to "your fork" Commented Apr 26, 2017 at 3:06
  • It says that I need more than 10 reputation to add a second link :( github.com/aulon/mjeshtri here it is Commented Apr 26, 2017 at 8:13
  • I mentioned in the comment of the first answer, but you are right, I should have posted it here as well. My url: aulon.github.io/mjeshtri Commented Apr 26, 2017 at 8:27
  • I saw it the moment I hit send.. :) Commented Apr 26, 2017 at 8:29
  • Have you tried serving the site from the gh-pages branch? Also, the modernizr.js you seem to be missing can be sourced from the parent repo's site's source-code Commented Apr 26, 2017 at 8:36

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

16 Comments

I apologize, I could not post more than two links due to my low number of reputation. Here is my url: aulon.github.io/mjeshtri I changed the content of baseurl to the name of my repository, as asked in the tutorial of the repo I forked. Still it does not work.
Thanks @surveyCorps. I see that other requests are working well, it's not the baseurl. When you create the site, can you check in your _site folder if the modernizer.js is there?
I added another comment, i can't see the modernizr file in your repo as well
First and foremost thank you for your time! I saw that in the console error, and I was searching for that file in the original repo, but it was not there. I opened a new issue on the original github repo.
Have you checked if the same error appears with the origianl template?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.