سؤال

After upgrading my web application based on Jekyll 1.4.3 to Jekyll 2.0.2, my home page does not incorporate the specified layout file.

Here are the steps to reproduce:

Download https://github.com/morea-framework/basic-template/tree/jekyll-2.0.  

This is the jekyll-2.0 branch of my web application, which is a stripped down version to illustrate the problem. If you clone the repo, be sure to switch to the jekyll-2.0 branch.

gem uninstall jekyll
gem install jekyll -v '1.4.3'

This installs the version of jekyll in which the site builds correctly. For reasons not apparent to me, I ran into problems when I had both 1.4.3 and 2.0.2 installed simultaneously.

cd basic-template/master/src
jekyll serve --baseurl ''

This brings up my web application. If you now go to http://localhost:4000, you should see:

site correctly displayed under Jekyll 1.4.3

Now control-c to stop the application, and invoke:

gem uninstall jekyll
gem install jekyll
jekyll serve --baseurl ''

These three commands uninstalls Jekyll 1.4.3, installs Jekyll 2.0.2, and reruns Jekyll. Now if you refresh http://localhost:4000, you should see:

enter image description here

As you can see, the CSS styling is no longer present. That's because the layout specified in the Front Matter has for some reason not been included.

Can anyone tell me why my code no longer works correctly under Jekyll 2.0.2?

هل كانت مفيدة؟

المحلول

Your post references the post.html layout in it's front matter, which in turn references the default layout. The default layout doesn't exist in your _layouts folder:

https://github.com/morea-framework/basic-template/blob/jekyll-2.0/src/_layouts/post.html

You should always have a default layout.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top