pages-gem: Change of theme ends up with Jekyll error

Before submitting an issue, please be sure to

This issue affects

  • The site generated by GitHub Pages
  • Building sites locally

What did you do (e.g., steps to reproduce)

I created a pages site and tried to change theme from minima to jekyll-theme-dinky. And then ran the usual steps.

  • Modified _config.yml for using theme: jekyll-theme-dinky
  • Executed bundle install
  • bundle update github-pages
  • bundle exec jekyll serve

As it did not work I tried to modify it online at github with the settings tool for automatically changing the theme of the site.

What did you expect to happen?

Github page to work as usual with the modified theme.

What happened instead?

For my local site I got the following error:

     Build Warning: Layout 'post' requested in _posts/2017-02-05-welcome-to-jekyll.markdown does not exist. 
  Liquid Exception: no implicit conversion of nil into String in about.md  
jekyll 3.3.1 | Error:  no implicit conversion of nil into String

For the github-pages automatic theme changer I got only:

The page build failed with the following error:   
Page build failed.

Additional information

I did some research and found out that this was fixed for jekyll 3.4.0, and was generated by issue Jekyll issue number 5750. However Github-pages has dependencies on Jekyll 3.3.1 and I could not force the local site to be build at least on 3.4.0.

  • Link to the live site (if applicable):
  • Link to the source repo (if applicable): Repo

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 18 (1 by maintainers)

Commits related to this issue

Most upvoted comments

For anyone running in to this issue under different circumstances, this error can also occur because of unconventional frontmatter naming schemes across different themes.

For instance, when setting up a new site let’s say you use the sample post from jekyllrb.com/docs/posts/

---  
layout: post  
title:  "Welcome to Jekyll!"  
date:   2015-11-17 16:16:01 -0600  
categories: jekyll update  
---

If you decide to apply, say, the ‘Minimal Mistakes’ theme (https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/), this error will pop up on build.

This happens because your build is requesting the ‘post’ layout as defined in the sample frontmatter, which does not exist in this particular theme. A quick look at the Minimal structure tab –

├── _layouts
|  ├── archive-taxonomy.html   # tag/category archive for Jekyll Archives plugin
|  ├── archive.html            # archive tlisting documents in an array
|  ├── compress.html           # compresses HTML in pure Liquid
|  ├── default.html            # base for all other layouts
|  ├── home.html               # home page
|  ├── single.html             # single document (post/page/etc)    <<<
|  └── splash.html             # splash page

– shows us that in this particular theme we need to specify the ‘single’ layout for posts, not ‘post’.

Making this change to our post frontmatter resolves the issue and allows us to build without error.

---
layout: single    <<<
title:  "Welcome to Jekyll!"
date:   2015-11-17 16:16:01 -0600
categories: jekyll update
---

The takeaway is: remember that naming conventions are not uniform. This is one of the great things about Jekyll–that pretty much anything is editable–but it also means that things like this happen when we stray from convention in our customizations.

Best, Chris

Locally when I run : bundle exec jekyll serve --watch I get the following:

Build Warning: Layout 'post' requested in _posts/2017-05-07-welcome-to-jekyll.markdown does not exist. 
Build Warning: Layout 'page' requested in about.md does not exist. 
Build Warning: Layout 'home' requested in index.md does not exist. 

about.md and index.md here:

The issue seems to be with one of the plugins used by GitHub Pages. For now, if you want to switch to any other theme supported on GitHub Pages, simply add a _layouts directory to your site’s root with following files:

_layouts/pages.html

---
layout: default
---
{{ content }}

_layouts/posts.html

---
layout: default
---
{{ content }}

Note: You need to remove this directory if you ever decide on using default Minima again

When I change the theme, I get a blank page at my url in github pages, though /about is populated in plain text.

Solution: substitute post, page, and home with default. That’s it. I’m not sure why jekyll new does create a blog to begin with. Doesn’t sound too logical.

Has this issue been resolved? I am experiencing the same issue as @ssierral and have followed the same steps to change the them as, but I do not have any {% include – %} to remove as suggested by @ashmaroli. I am using Jekyll 3.4.0 on Ubuntu 16.04

Removing the two {% include icon-github.html username="jekyll" %} inside about.md should help you switch themes easily.

Hi, I’ve added these files and updated _config.yml to enable the jekyll-theme-midnight but I still encounter the same issue as before- the site comes up blank.