pages-gem: Change of theme ends up with Jekyll error
Before submitting an issue, please be sure to
- Read the contributing instructions
- Update to the latest Gem version (either
gem update github-pages
orbundle update github-pages
)
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
- Added new detault layouts Another attempted fix for blank-page issue based on https://github.com/github/pages-gem/issues/416#issuecomment-299772018 — committed to DominicBisset/blog by DominicBisset 7 years ago
- 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.... — committed to dirdival/dirdival.github.io by deleted user 7 years ago
- Use theme slate Work around “Layout 'post' requested in _posts/*.md does not exist.” by adding _layouts/post.html https://github.com/github/pages-gem/issues/416 — committed to regisd/regisd.github.io by regisd 7 years ago
- feat: Change the theme into `hacker` Change the theme and modify `about.markdown` and `index.markdown`. https://github.com/github/pages-gem/issues/416 https://github.com/pages-themes/hacker — committed to shunya-fug/shunya-fug.github.io by shunya-fug 3 years ago
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/
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 –
– 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.
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: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
_layouts/posts.html
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
, andhome
withdefault
. That’s it. I’m not sure whyjekyll 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" %}
insideabout.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.