New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of theme ends up with Jekyll error #416

Open
ssierral opened this Issue Feb 21, 2017 · 9 comments

Comments

Projects
None yet
4 participants
@ssierral

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
@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Mar 2, 2017

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

ashmaroli commented Mar 2, 2017

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

@OneGneissGuy

This comment has been minimized.

Show comment
Hide comment
@OneGneissGuy

OneGneissGuy May 8, 2017

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

OneGneissGuy commented May 8, 2017

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

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli May 8, 2017

@OneGneissGuy I've updated my earlier comment for clarity. You need to remove the references to includes {% include icon-github.html username="jekyll" %} within about.md to unlink from minima. If you do not have this line in your about.md, what does the error message say otherwise, at GitHub and locally?

@OneGneissGuy I've updated my earlier comment for clarity. You need to remove the references to includes {% include icon-github.html username="jekyll" %} within about.md to unlink from minima. If you do not have this line in your about.md, what does the error message say otherwise, at GitHub and locally?

@OneGneissGuy

This comment has been minimized.

Show comment
Hide comment
@OneGneissGuy

OneGneissGuy May 8, 2017

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:

OneGneissGuy commented May 8, 2017

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:

@OneGneissGuy

This comment has been minimized.

Show comment
Hide comment
@OneGneissGuy

OneGneissGuy May 8, 2017

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

OneGneissGuy commented May 8, 2017

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

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli May 8, 2017

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

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

@OneGneissGuy

This comment has been minimized.

Show comment
Hide comment
@OneGneissGuy

OneGneissGuy May 8, 2017

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.

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.

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli May 8, 2017

@OneGneissGuy I forked your site and applied above workaround. Check this temporary link

@OneGneissGuy I forked your site and applied above workaround. Check this temporary link

DominicBisset added a commit to DominicBisset/blog that referenced this issue Aug 1, 2017

Added new detault layouts
Another attempted fix for blank-page issue based on github/pages-gem#416 (comment)

dirdival pushed a commit to dirdival/dirdival.github.io that referenced this issue Sep 8, 2017

dirdival
Back to theme 'minima'
As always are some problems 'on production'.
I changed theme via github page and after that
some 'strange' things happened - more clear,
after rebuild on github was blank page.
Logs from run:
$ bundle exec jekyll serve
...
Build Warning: Layout 'home' requested in index.md does not exist

See more details here: github/pages-gem#416
@bezoris

This comment has been minimized.

Show comment
Hide comment
@bezoris

bezoris Oct 16, 2017

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

bezoris commented Oct 16, 2017

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

regisd added a commit to regisd/regisd.github.io that referenced this issue Nov 26, 2017

Use theme slate
Work around “Layout 'post' requested in _posts/*.md does not exist.” by
adding _layouts/post.html

github/pages-gem#416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment